-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/webhook dynamisation #2
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request refactors and modernizes the notification and CLI command codebase by simplifying event structures, enhancing type safety, and translating all French documentation and comments to English for better international maintainability.
- Removes redundant event fields (
runner_id,techno,restarted) and adds new required fields (duration,image_size,image_name) to event classes - Updates the notification event factory to match new simplified event structures and field requirements
- Translates all French docstrings, comments, and CLI help text to English throughout the codebase
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ | Removed French comments from test files and updated test data to match new event field requirements |
| src/services/webhook_service.py | Translated all French docstrings and comments to English |
| src/services/notification_service.py | Updated notification methods to use simplified event structures without redundant fields |
| src/services/docker_service.py | Translated docstrings to English and added image size/duration tracking to build operations |
| src/services/config_service.py | Translated docstrings and comments from French to English |
| src/presentation/cli/commands.py | Translated all CLI command help text and docstrings from French to English |
| src/notifications/ | Simplified event classes by removing redundant fields and updated factory logic accordingly |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/presentation/cli/commands.py:424
- The French console messages 'Scheduler arrêté manuellement' and 'Erreur dans le scheduler' should be translated to English to maintain consistency with the PR's documentation changes.
scheduler_service.start()
except KeyboardInterrupt:
console.print("[yellow]Scheduler arrêté manuellement.[/yellow]")
scheduler_service.stop()
except Exception as e:
console.print(f"[red]Erreur dans le scheduler: {str(e)}[/red]")
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
tests/cli/test_commands_scheduler.py
Outdated
| scheduler_service.start.assert_called_once() | ||
| scheduler_service.stop.assert_called_once() | ||
| console.print.assert_called_once_with( | ||
| "[yellow]Scheduler arrêté manuellement.[/yellow]" |
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message 'Scheduler arrêté manuellement' should be translated to English to maintain consistency with the PR's goal of English language standardization.
| "[yellow]Scheduler arrêté manuellement.[/yellow]" | |
| "[yellow]Scheduler stopped manually.[/yellow]" |
tests/cli/test_commands_scheduler.py
Outdated
| # Vérifier que les méthodes attendues ont été appelées | ||
| scheduler_service.start.assert_called_once() | ||
| console.print.assert_called_once_with( | ||
| f"[red]Erreur dans le scheduler: {str(test_exception)}[/red]" |
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message 'Erreur dans le scheduler' should be translated to English to maintain consistency with the PR's goal of English language standardization.
| f"[red]Erreur dans le scheduler: {str(test_exception)}[/red]" | |
| f"[red]Error in scheduler: {str(test_exception)}[/red]" |
src/presentation/cli/commands.py
Outdated
| console = Console() | ||
|
|
||
| # Sous-commande pour les webhooks | ||
| webhook_app = typer.Typer(help="Commandes pour tester et déboguer les webhooks") |
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help text 'Commandes pour tester et déboguer les webhooks' should be translated to English to maintain consistency with the PR's documentation changes.
| webhook_app = typer.Typer(help="Commandes pour tester et déboguer les webhooks") | |
| webhook_app = typer.Typer(help="Commands to test and debug webhooks") |
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17f4153 to
87510de
Compare
4eccaaf to
e170fe5
Compare
This pull request refactors and improves the notification and CLI command codebase, focusing on simplifying event structures, enhancing type safety, and improving English language consistency throughout the code and documentation. The key changes include removing unused or redundant event fields, updating event and factory logic to match new data structures, and rewriting CLI command help and comments in English for clarity.
Event model and type improvements:
runner_id,techno,techno_version, andrestarted) inRunnerStarted,RunnerStopped, and related event classes to simplify the event model.durationandimage_sizeforBuildCompleted, andimage_nameforBuildFailedandUpdateAvailable, to provide more detailed and consistent event data. [1] [2]Notification factory and event construction:
_iter_eventsinfactory.py) to match the new event structures, including handling new fields and removing obsolete ones, ensuring correct event instantiation from operation results. [1] [2] [3]CLI command and documentation improvements:
General code and documentation cleanup:
These changes collectively modernize the notification system, make event handling more robust, and improve the developer experience by clarifying documentation and reducing unnecessary complexity.