Skip to content

Redesign CI pipeline to utilize tox environments - #78

Merged
hspaans merged 3 commits into
masterfrom
77-redesign-ci-pipeline-for-using-tox-environments
Sep 3, 2026
Merged

Redesign CI pipeline to utilize tox environments#78
hspaans merged 3 commits into
masterfrom
77-redesign-ci-pipeline-for-using-tox-environments

Conversation

@hspaans

@hspaans hspaans commented Sep 3, 2026

Copy link
Copy Markdown
Owner

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:

  • Split the original tox job into three separate jobs: tox-lint (for linting), tox-fix (for code fixing), and tox-testing (for running tests), each with clear naming and dedicated steps. (.github/workflows/ci.yml)
  • Updated the tox-testing job to depend on the successful completion of both tox-lint and tox-fix, ensuring code quality checks before running tests. (.github/workflows/ci.yml)
  • Modified the test command in tox-testing to specify the environment using ${{ matrix.py }} for more accurate test execution. (.github/workflows/ci.yml)

@hspaans hspaans self-assigned this Sep 3, 2026
Copilot AI balanced review requested due to automatic review settings September 3, 2026 23:03
@hspaans hspaans linked an issue Sep 3, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 tox job into tox-lint, tox-fix, and tox-testing, each provisioning tox and running its specific environment.
  • Made tox-testing depend on both tox-lint and tox-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.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Copilot AI review requested due to automatic review settings September 3, 2026 23:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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-lint job look like copy-paste leftovers from the test job and are misleading. The "Setup test suite" step runs tox r -vv --notest without -e, which provisions the entire env_list (lint, fix, 3.14, 3.13, 3.12, cov, type, pkg_meta) even though this job only runs the lint env — wasting CI time installing dependencies for environments that are never executed. In addition, the "Run test suite" step name and the PYTEST_ADDOPTS env var are irrelevant here because the lint env runs yamllint/flake8/pymarkdownlnt, not pytest. Scoping the provisioning to -e lint, renaming the step, and dropping PYTEST_ADDOPTS makes 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-lint job: the "Setup test suite" step runs tox r -vv --notest without -e, provisioning the full env_list instead of just the fix env, and the "Run test suite" step name plus the PYTEST_ADDOPTS env var are misleading since the fix env runs pyupgrade/git, not pytest. Scope the provisioning to -e fix, rename the step, and drop PYTEST_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-lint job uses the display name "Linting Code Base", which is identical to the pre-existing lint job (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: this tox-lint job runs yamllint/flake8/pymarkdownlnt via the tox lint env, and the old lint job runs yamllint/flake8 directly. Consider removing the old lint job (now superseded by tox-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

Copilot AI review requested due to automatic review settings September 3, 2026 23:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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 suite step runs tox r -vv --notest, which provisions every environment in env_list (lint, fix, cov, type, pkg_meta, plus any available interpreter envs) even though this job only runs the fix environment. Scoping the provisioning with -e fix avoids building and installing environments that are never used here, saving CI time. Additionally, PYTEST_ADDOPTS has no effect in this job since the fix environment 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

Comment thread .github/workflows/ci.yml
@hspaans
hspaans merged commit 05031f0 into master Sep 3, 2026
10 checks passed
@hspaans
hspaans deleted the 77-redesign-ci-pipeline-for-using-tox-environments branch September 3, 2026 23:31
hspaans added a commit that referenced this pull request Sep 3, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesign CI pipeline for using tox environments

2 participants