TEST-INFRA: [ci-pipeline-design] Implement CI dependency caching to speed up builds #1616

Closed
opened 2026-04-02 23:14:09 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: task/ci-implement-dependency-caching
  • Commit Message: chore(ci): implement uv cache and nox venv caching to speed up CI builds
  • Milestone: v3.2.0
  • Parent Epic: (no CI pipeline Epic found — see orphan note below)

Background and Context

The current CI pipeline, as defined in noxfile.py, does not explicitly cache Python dependencies between runs. While nox reuses virtual environments locally, any changes to pyproject.toml or other dependency-defining files will trigger a full re-installation of all dependencies in CI. This can significantly slow down CI builds, especially for a project with many dependencies.

Expected Behavior

The CI pipeline should cache Python dependencies between runs so that builds are faster when dependencies have not changed. Specifically:

  1. Cache the uv cache directory: The uv backend for nox uses a cache directory (/tmp/uv-cache by default). Caching this directory between CI runs allows uv to reuse downloaded packages instead of fetching them from PyPI on every run.
  2. Cache the nox virtual environments: The .nox directory, which contains the virtual environments created by nox, can also be cached to avoid recreating and repopulating virtual environments from scratch on every run.

Subtasks

  • Investigate the caching capabilities of the CI platform (Forgejo Actions).
  • Configure the CI pipeline (.forgejo/workflows/ci.yml) to cache the uv cache directory.
  • Configure the CI pipeline to cache the .nox directory.
  • Verify that the caching mechanism is working as expected and that it improves build times.
  • Document the caching mechanism in docs/development/ci-cd.md.
  • Run nox (all default sessions), fix any errors.
  • Verify coverage >= 97% via nox -s coverage_report.

Definition of Done

This issue is complete when:

  • The CI pipeline is configured to cache the uv cache directory between runs.
  • The CI pipeline is configured to cache the .nox virtual environments directory between runs.
  • Build times are measurably reduced when dependencies have not changed.
  • The caching mechanism is documented in docs/development/ci-cd.md.
  • All subtasks above are completed and checked off.
  • All nox stages pass.
  • Coverage >= 97%.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

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

## Metadata - **Branch**: `task/ci-implement-dependency-caching` - **Commit Message**: `chore(ci): implement uv cache and nox venv caching to speed up CI builds` - **Milestone**: v3.2.0 - **Parent Epic**: *(no CI pipeline Epic found — see orphan note below)* ## Background and Context The current CI pipeline, as defined in `noxfile.py`, does not explicitly cache Python dependencies between runs. While `nox` reuses virtual environments locally, any changes to `pyproject.toml` or other dependency-defining files will trigger a full re-installation of all dependencies in CI. This can significantly slow down CI builds, especially for a project with many dependencies. ## Expected Behavior The CI pipeline should cache Python dependencies between runs so that builds are faster when dependencies have not changed. Specifically: 1. **Cache the `uv` cache directory**: The `uv` backend for `nox` uses a cache directory (`/tmp/uv-cache` by default). Caching this directory between CI runs allows `uv` to reuse downloaded packages instead of fetching them from PyPI on every run. 2. **Cache the `nox` virtual environments**: The `.nox` directory, which contains the virtual environments created by `nox`, can also be cached to avoid recreating and repopulating virtual environments from scratch on every run. ## Subtasks - [ ] Investigate the caching capabilities of the CI platform (Forgejo Actions). - [ ] Configure the CI pipeline (`.forgejo/workflows/ci.yml`) to cache the `uv` cache directory. - [ ] Configure the CI pipeline to cache the `.nox` directory. - [ ] Verify that the caching mechanism is working as expected and that it improves build times. - [ ] Document the caching mechanism in `docs/development/ci-cd.md`. - [ ] Run `nox` (all default sessions), fix any errors. - [ ] Verify coverage >= 97% via `nox -s coverage_report`. ## Definition of Done This issue is complete when: - [ ] The CI pipeline is configured to cache the `uv` cache directory between runs. - [ ] The CI pipeline is configured to cache the `.nox` virtual environments directory between runs. - [ ] Build times are measurably reduced when dependencies have not changed. - [ ] The caching mechanism is documented in `docs/development/ci-cd.md`. - [ ] All subtasks above are completed and checked off. - [ ] All nox stages pass. - [ ] Coverage >= 97%. - [ ] A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - [ ] The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - [ ] The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.2.0 milestone 2026-04-02 23:14:40 +00:00
Author
Owner

⚠️ Orphan Issue — Manual Linking Required

This issue was created automatically but no parent Epic for CI pipeline design work was found in the repository. Per CONTRIBUTING.md, every issue must be linked to a parent Epic using Forgejo's dependency system (child blocks parent).

Action required: A maintainer should either:

  1. Create a CI Pipeline Design Epic and link this issue as a child (this issue should block the Epic), or
  2. Link this issue to an existing relevant Epic.

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

⚠️ **Orphan Issue — Manual Linking Required** This issue was created automatically but no parent Epic for CI pipeline design work was found in the repository. Per `CONTRIBUTING.md`, every issue must be linked to a parent Epic using Forgejo's dependency system (child **blocks** parent). **Action required**: A maintainer should either: 1. Create a CI Pipeline Design Epic and link this issue as a child (this issue should **block** the Epic), or 2. Link this issue to an existing relevant Epic. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
Author
Owner

Closing as duplicate of #1589 (dependency caching improvement). This CI caching improvement is already tracked.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Closing as duplicate of #1589 (dependency caching improvement). This CI caching improvement is already tracked. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo 2026-04-02 23:31:13 +00:00
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#1616
No description provided.