Open
Conversation
Contributor
Reviewer's GuideRefactors the build-modules CI workflow to delegate testing to reusable composite actions, with automatic detection of Poetry vs uv as the Python package manager, while preserving the existing linting and testing behavior per module. Sequence diagram for updated build-modules CI workflow with package manager detectionsequenceDiagram
actor Dev
participant GitHub as GitHub_Actions
participant WF as build-modules_workflow
participant JM as find-modules_job
participant JB as build-module_job
participant DP as detect-pm_step
participant P as test-with-poetry_action
participant U as test-with-uv_action
participant RS as result-status_job
Dev->>GitHub: push_or_pull_request
GitHub->>WF: trigger_build-modules_workflow
WF->>JM: run_find-modules
JM-->>WF: modules_matrix
WF->>JB: start_build-module_matrix_for_each_module
JB->>JB: setup-python_3_11
JB->>DP: run_detect-pm
DP-->>JB: package_manager=poetry_or_uv
alt Poetry_project
JB->>P: use_test-with-poetry_with_module
P-->>JB: lint_and_tests_completed
else uv_project
JB->>U: use_test-with-uv_with_module
U-->>JB: lint_and_tests_completed
end
JB-->>WF: job_result
WF->>RS: run_result-status_with_needs
alt any_job_failed_and_modules_found
RS-->>GitHub: workflow_failure
else all_jobs_success_or_no_modules
RS-->>GitHub: workflow_success
end
Flow diagram for package manager detection and test selectionflowchart TD
A[Start build-module job for a module] --> B[Setup Python 3.11]
B --> C[Check if uv.lock exists in MODULE_PATH]
C -->|Found uv.lock| D[Set package_manager=uv]
C -->|Not found| E[Set package_manager=poetry]
D --> F[Use composite action test-with-uv with module]
E --> G[Use composite action test-with-poetry with module]
F --> H[Upload artifacts]
G --> H[Upload artifacts]
H --> I[End job]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
test-with-poetryandtest-with-uvcomposite actions duplicate most of the logic (Black, mypy, pytest invocation); consider extracting the common steps into a shared composite or parameterizing a single action to reduce maintenance overhead. - The package manager detection relies solely on the presence of
uv.lock; if you expect uv projects that might not commit a lock file, consider also checkingpyproject.toml(e.g., for[tool.uv]) or another uv-specific marker to avoid incorrectly defaulting to Poetry. - The
id: install-dependenciesandid: execute-testsin the composite actions are not used by subsequent steps; you can remove these ids to simplify the actions unless you plan to consume their outputs later.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `test-with-poetry` and `test-with-uv` composite actions duplicate most of the logic (Black, mypy, pytest invocation); consider extracting the common steps into a shared composite or parameterizing a single action to reduce maintenance overhead.
- The package manager detection relies solely on the presence of `uv.lock`; if you expect uv projects that might not commit a lock file, consider also checking `pyproject.toml` (e.g., for `[tool.uv]`) or another uv-specific marker to avoid incorrectly defaulting to Poetry.
- The `id: install-dependencies` and `id: execute-tests` in the composite actions are not used by subsequent steps; you can remove these ids to simplify the actions unless you plan to consume their outputs later.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the “Build Modules” CI workflow by moving module test/lint commands into reusable local composite actions and adding support for uv-managed modules, selected automatically per module.
Changes:
- Added local composite actions to test modules with Poetry and with uv.
- Updated
build-modules.ymlto detect the package manager per module and invoke the corresponding action. - Minor workflow formatting/cleanup (e.g., normalized YAML spacing/indentation).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/build-modules.yml | Detects per-module package manager (uv vs Poetry) and routes testing to the corresponding composite action. |
| .github/actions/test-with-uv/action.yaml | New composite action encapsulating uv-based dependency sync, linting, type-checking, and tests. |
| .github/actions/test-with-poetry/action.yaml | New composite action encapsulating Poetry-based dependency install, linting, type-checking, and tests. |
Co-authored-by: Copilot <[email protected]>
otetard
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update the build-module workflow:
Summary by Sourcery
Update the module build workflow to support both Poetry and uv via reusable composite actions for testing modules.
CI:
Tests: