Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(commands): fix error on command notifications #2323

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

maugde
Copy link
Contributor

@maugde maugde commented Jan 29, 2025

fix ANT-2511

@maugde maugde self-assigned this Jan 30, 2025
@maugde maugde force-pushed the fix/2511-error-command-notifications branch from 131b44c to a5bb352 Compare January 31, 2025 08:30
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 31, 2025
@maugde maugde requested a review from smailio February 3, 2025 10:19
@maugde maugde force-pushed the fix/2511-error-command-notifications branch from 6a0face to 8ea2595 Compare February 4, 2025 09:33
@maugde maugde force-pushed the fix/2511-error-command-notifications branch from d6f6678 to 488597f Compare February 4, 2025 14:35
@maugde maugde requested a review from smailio February 4, 2025 14:36
@maugde maugde force-pushed the fix/2511-error-command-notifications branch from 6eb3ae4 to 175e5ad Compare February 5, 2025 09:52
@maugde maugde requested a review from MartinBelthle February 5, 2025 10:02
@maugde maugde force-pushed the fix/2511-error-command-notifications branch from 175e5ad to 1845678 Compare February 5, 2025 13:40
@maugde maugde force-pushed the fix/2511-error-command-notifications branch from baaebb8 to 6e3adef Compare February 6, 2025 12:49
@maugde maugde requested a review from MartinBelthle February 6, 2025 13:50
@@ -9,3 +9,6 @@
# SPDX-License-Identifier: MPL-2.0
#
# This file is part of the Antares project.
import typing as t

CommandNotifier = t.Callable[[int, bool, str], None]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for this

if notifier:
notifier(index - 1, output.status, output.message)
if notifier and cmd.command_id not in command_block_set:
notifier(command_block_dict[cmd.command_id], output.status, output.message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maugde @MartinBelthle :
Actually it's weird to notify only on the first command of a block.
In particular, we will notify with the status of this first command, but not for subsequent commands:
so for example if the first command succeeds and the second one fails, it will be invisible from the listener.

In the end I would propose to change the scope of this work:
I think the notification mechanism is actually not used (it just sends an event to the event bus, but this event type is never used for now. I cannot see a usage in the near future.

--> I propose to simply delete this notifier and the associated event type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants