-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Refactor Edge Worker CLI for smaller module #50738
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
Refactor Edge Worker CLI for smaller module #50738
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 PR refactors the Edge Worker CLI by extracting the previously monolithic _EdgeWorkerCli into a dedicated module and renaming it to EdgeWorker. It also extracts basic signalling functionality into its own module with accompanying tests.
- Refactored Edge Worker CLI class into a separate module and renamed it.
- Updated tests to import and use the new EdgeWorker class.
- Introduced a new signalling module with functions for managing PID files.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| providers/edge3/tests/unit/edge3/worker_api/routes/test_worker.py | Updated import and fixture type hint to use EdgeWorker instead of _EdgeWorkerCli. |
| providers/edge3/tests/unit/edge3/cli/test_signalling.py | Added tests for the new signalling functionality ensuring PID file behavior is as expected. |
| providers/edge3/src/airflow/providers/edge3/cli/signalling.py | New module handling PID file management and signalling for edge workers. |
shubhamraj-git
left a comment
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.
Thanks for the refactor.
Looks good.
* Refactor Edge Worker CLI for smaller module * Ups, delete un-needed redundant test module * Add a test for command --------- Co-authored-by: Shubham Raj <48172486+shubhamraj-git@users.noreply.github.com>
* Refactor Edge Worker CLI for smaller module * Ups, delete un-needed redundant test module * Add a test for command --------- Co-authored-by: Shubham Raj <48172486+shubhamraj-git@users.noreply.github.com>
This is a pure re-factoring PR. The python module providers/edge3/src/airflow/providers/edge3/cli/edge_command.py was just too large.
I splitted the class
_EdgeWorkerCliout into a separate module and renamed it toEdgeWorker. Also extracted some basics for signalling.Should be zero functional change, even if it looks like a large review. Just pushing and changing a lot of names.