Closed maheshsattala closed 3 months ago
The recent changes enhance the Kairon framework's command-line interface by modifying the is_resend
argument from a positional to an optional flag in the add_subparser
function. This improves usability by allowing users to omit the flag if not needed. Additionally, the test suite has been updated to ensure proper handling of the is_resend
argument in various scenarios, thereby reinforcing the robustness of the message broadcasting functionality.
Files | Change Summary |
---|---|
kairon/cli/message_broadcast.py | Modified add_subparser to change is_resend from a positional to an optional argument, improving command-line usability while maintaining backward compatibility. |
tests/unit_test/cli_test.py | Added tests for --is_resend handling in the CLI, verifying correct behavior with and without the flag, enhancing test coverage for message broadcasting functionality. |
tests/unit_test/events/events_test.py | Updated execute method calls in tests for MessageBroadcastEvent to include is_resend parameter, ensuring consistent behavior across various test scenarios. |
sequenceDiagram
participant User
participant CLI
participant MessageBroadcastEvent
User->>CLI: Invoke command with --is_resend
CLI->>MessageBroadcastEvent: execute(event_id, is_resend="True")
MessageBroadcastEvent-->>CLI: Process message for resend
CLI-->>User: Return success message
User->>CLI: Invoke command without --is_resend
CLI->>MessageBroadcastEvent: execute(event_id, is_resend="False")
MessageBroadcastEvent-->>CLI: Process message normally
CLI-->>User: Return success message
🐇 In the meadow, hops a little sprite,
With flags of options, oh what a delight!
"Resend or not," the rabbit does cheer,
For every command, the path is now clear.
A hop and a skip, let’s spread the news,
In Kairon’s world, we let users choose! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Added test for the checking whether default values coming or not for parse_args
Summary by CodeRabbit
New Features
--is_resend
flag as optional.Bug Fixes
is_resend
argument.Tests
--is_resend
argument.is_resend
parameter in message broadcasting scenarios.