Redesign CI pipeline to utilize tox environments - #78
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
🟡 Changes recommended
Several naming/clarity issues (misleading "Run test suite" step names in the lint/fix jobs and a duplicate "Linting Code Base" job display name with redundant linting) run counter to the PR's stated precision goal and should be resolved first.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR restructures the CI workflow (.github/workflows/ci.yml) so that the previously single tox job is split into three dedicated jobs — tox-lint, tox-fix, and tox-testing — with the testing job gated on the successful completion of the lint and fix jobs. It aligns CI with the native tox environments already defined in pyproject.toml ([tool.tox]), where env names lint, fix, and the 3.14/3.13/3.12 matrix values all exist and are invoked via tox r --env <name>.
Changes:
- Split the monolithic
toxjob intotox-lint,tox-fix, andtox-testing, each provisioning tox and running its specific environment. - Made
tox-testingdepend on bothtox-lintandtox-fix, and parameterized the test command with--env ${{ matrix.py }}. - Kept per-Python matrix (
3.14,3.13,3.12) for the testing job only.
File summaries
| File | Description |
|---|---|
.github/workflows/ci.yml |
Splits the CI tox job into separate lint/fix/testing jobs, adds needs gating, and targets tox environments explicitly; introduces some copied-over step names and a display-name collision with the existing lint job. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🔵 Needs a closer look
The new lint/fix jobs contain misleading/leftover step configuration and over-broad tox provisioning, and the tox-lint job duplicates the existing lint job's name and function.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
.github/workflows/ci.yml:37
- These two steps in the
tox-lintjob look like copy-paste leftovers from the test job and are misleading. The "Setup test suite" step runstox r -vv --notestwithout-e, which provisions the entireenv_list(lint, fix, 3.14, 3.13, 3.12, cov, type, pkg_meta) even though this job only runs thelintenv — wasting CI time installing dependencies for environments that are never executed. In addition, the "Run test suite" step name and thePYTEST_ADDOPTSenv var are irrelevant here because thelintenv runs yamllint/flake8/pymarkdownlnt, not pytest. Scoping the provisioning to-e lint, renaming the step, and droppingPYTEST_ADDOPTSmakes the job accurate and faster.
This issue also appears on line 54 of the same file.
.github/workflows/ci.yml:60
- Same issue as the
tox-lintjob: the "Setup test suite" step runstox r -vv --notestwithout-e, provisioning the fullenv_listinstead of just thefixenv, and the "Run test suite" step name plus thePYTEST_ADDOPTSenv var are misleading since thefixenv runs pyupgrade/git, not pytest. Scope the provisioning to-e fix, rename the step, and dropPYTEST_ADDOPTS.
- name: Setup test suite
run: tox r -vv --notest
- name: Run test suite
run: tox r -e fix --skip-pkg-install
env:
PYTEST_ADDOPTS: "-vv --durations=10"
.github/workflows/ci.yml:17
- This new
tox-lintjob uses the display name "Linting Code Base", which is identical to the pre-existinglintjob (line 98). Two jobs sharing the exact same display name produces ambiguous status checks in the GitHub UI and in branch-protection required-check configuration. Beyond the name collision, the two jobs are now redundant: thistox-lintjob runs yamllint/flake8/pymarkdownlnt via the toxlintenv, and the oldlintjob runs yamllint/flake8 directly. Consider removing the oldlintjob (now superseded bytox-lint) or, at minimum, giving this job a distinct name.
name: Linting Code Base
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Renaming the CI jobs/status checks can affect branch-protection required-check settings, which cannot be verified from the diff and warrants human confirmation.
Review details
Suppressed comments (1)
.github/workflows/ci.yml:60
- The
Setup test suitestep runstox r -vv --notest, which provisions every environment inenv_list(lint,fix,cov,type,pkg_meta, plus any available interpreter envs) even though this job only runs thefixenvironment. Scoping the provisioning with-e fixavoids building and installing environments that are never used here, saving CI time. Additionally,PYTEST_ADDOPTShas no effect in this job since thefixenvironment runs pyupgrade/git rather than pytest, so it can be dropped (this appears to be a copy-paste leftover from the testing job).
- name: Setup test suite
run: tox r -vv --notest
- name: Run fixing suite
run: tox r -e fix --skip-pkg-install
env:
PYTEST_ADDOPTS: "-vv --durations=10"
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
* Redesign CI pipeline to utilize tox environments for linting and fixing code base * Fix syntax for tox environment specification in CI pipeline * Refactor CI pipeline to rename linting and fixing suite steps for clarity
This pull request restructures the CI workflow to separate linting, code fixing, and testing into distinct jobs, improving clarity and maintainability. The testing job now explicitly depends on the completion of linting and fixing jobs, and job names and commands have been updated for precision.
CI Workflow Improvements:
toxjob into three separate jobs:tox-lint(for linting),tox-fix(for code fixing), andtox-testing(for running tests), each with clear naming and dedicated steps. (.github/workflows/ci.yml)tox-testingjob to depend on the successful completion of bothtox-lintandtox-fix, ensuring code quality checks before running tests. (.github/workflows/ci.yml)tox-testingto specify the environment using${{ matrix.py }}for more accurate test execution. (.github/workflows/ci.yml)