TEST-INFRA: [ci-pipeline-design] Cache nox environments to speed up CI jobs #5563

Open
opened 2026-04-09 07:33:17 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Branch: test-infra/cache-nox-environments
  • Commit Message: chore(ci): cache nox environments to speed up CI jobs
  • Milestone: (to be assigned — see backlog note below)
  • Parent Epic: (to be linked — see orphan note below)

Overview

The current CI pipeline effectively caches the uv package cache, which speeds up dependency installation. However, it does not cache the nox virtual environments themselves, which are created in the .nox directory.

On each CI run, nox has to create a new virtual environment for each session, even if the dependencies haven't changed. Caching the .nox directory would allow nox to reuse existing environments, significantly speeding up the setup time for each job.

Proposed Changes

Modify the .forgejo/workflows/ci.yml file to include the .nox directory in the cache. This can be done by adding another actions/cache@v3 step to each job.

Example

- name: Cache nox environments
  uses: actions/cache@v3
  with:
    path: .nox
    key: nox-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
    restore-keys: |
      nox-${{ runner.os }}-${{ matrix.python-version }}-

Duplicate Check

  • Search Queries: cache, nox, environment, venv
  • Results: 2 issues found, but they are not related to caching nox environments.
  • Conclusion: This is not a duplicate issue.

Subtasks

  • Audit the current .forgejo/workflows/ci.yml to identify all jobs that invoke nox
  • Add actions/cache@v3 step for the .nox directory to each relevant job
  • Use a cache key based on OS, Python version, and pyproject.toml hash to ensure cache invalidation on dependency changes
  • Verify that the cache step is placed before the nox invocation in each job
  • Test the pipeline to confirm cache hits on subsequent runs
  • Update any relevant documentation or comments in the workflow file

Definition of Done

  • .forgejo/workflows/ci.yml includes .nox directory caching for all relevant jobs
  • Cache key strategy correctly invalidates on dependency changes (pyproject.toml hash)
  • CI pipeline shows measurable improvement in job setup time on cache hits
  • No regressions introduced in existing CI behaviour
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on the current active milestone. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: new-issue-creator

## Metadata - **Branch**: `test-infra/cache-nox-environments` - **Commit Message**: `chore(ci): cache nox environments to speed up CI jobs` - **Milestone**: *(to be assigned — see backlog note below)* - **Parent Epic**: *(to be linked — see orphan note below)* ## Overview The current CI pipeline effectively caches the `uv` package cache, which speeds up dependency installation. However, it does not cache the `nox` virtual environments themselves, which are created in the `.nox` directory. On each CI run, `nox` has to create a new virtual environment for each session, even if the dependencies haven't changed. Caching the `.nox` directory would allow `nox` to reuse existing environments, significantly speeding up the setup time for each job. ## Proposed Changes Modify the `.forgejo/workflows/ci.yml` file to include the `.nox` directory in the cache. This can be done by adding another `actions/cache@v3` step to each job. ### Example ```yaml - name: Cache nox environments uses: actions/cache@v3 with: path: .nox key: nox-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} restore-keys: | nox-${{ runner.os }}-${{ matrix.python-version }}- ``` ## Duplicate Check - **Search Queries**: `cache`, `nox`, `environment`, `venv` - **Results**: 2 issues found, but they are not related to caching nox environments. - **Conclusion**: This is not a duplicate issue. ## Subtasks - [ ] Audit the current `.forgejo/workflows/ci.yml` to identify all jobs that invoke `nox` - [ ] Add `actions/cache@v3` step for the `.nox` directory to each relevant job - [ ] Use a cache key based on OS, Python version, and `pyproject.toml` hash to ensure cache invalidation on dependency changes - [ ] Verify that the cache step is placed before the `nox` invocation in each job - [ ] Test the pipeline to confirm cache hits on subsequent runs - [ ] Update any relevant documentation or comments in the workflow file ## Definition of Done - [ ] `.forgejo/workflows/ci.yml` includes `.nox` directory caching for all relevant jobs - [ ] Cache key strategy correctly invalidates on dependency changes (`pyproject.toml` hash) - [ ] CI pipeline shows measurable improvement in job setup time on cache hits - [ ] No regressions introduced in existing CI behaviour - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on the current active milestone. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: new-issue-creator
Author
Owner

⚠️ Orphan Issue — Manual Epic Linking Required

This issue was created without a known parent Epic. Per project rules in CONTRIBUTING.md, orphan issues are not permitted — every Issue must be linked to a parent Epic.

Action Required: A human reviewer or the backlog-groomer agent should:

  1. Identify the appropriate parent Epic for CI/test-infrastructure improvements
  2. Create the dependency link so that this issue blocks the parent Epic (child blocks parent direction)

This can be done via the Forgejo API:

curl -s -X POST "https://git.cleverthis.com/api/v1/repos/cleveragents/cleveragents-core/issues/5563/blocks" \
  -H "Authorization: token <FORGEJO_PAT>" \
  -H "Content-Type: application/json" \
  -d '{"owner": "cleveragents", "repo": "cleveragents-core", "index": <PARENT_EPIC_NUMBER>}'

Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: new-issue-creator

⚠️ **Orphan Issue — Manual Epic Linking Required** This issue was created without a known parent Epic. Per project rules in `CONTRIBUTING.md`, orphan issues are not permitted — every Issue must be linked to a parent Epic. **Action Required:** A human reviewer or the `backlog-groomer` agent should: 1. Identify the appropriate parent Epic for CI/test-infrastructure improvements 2. Create the dependency link so that this issue **blocks** the parent Epic (child blocks parent direction) This can be done via the Forgejo API: ```bash curl -s -X POST "https://git.cleverthis.com/api/v1/repos/cleveragents/cleveragents-core/issues/5563/blocks" \ -H "Authorization: token <FORGEJO_PAT>" \ -H "Content-Type: application/json" \ -d '{"owner": "cleveragents", "repo": "cleveragents-core", "index": <PARENT_EPIC_NUMBER>}' ``` --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: new-issue-creator
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#5563
No description provided.