TEST-INFRA: [ci-pipeline-design] Implement dependency caching in CI #1858

Open
opened 2026-04-02 23:59:43 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: chore/ci-dependency-caching
  • Commit Message: chore(ci): implement dependency caching in CI pipeline
  • Milestone: v3.8.0
  • Parent Epic: #1678

Background and Context

The CI pipeline currently does not cache dependencies between runs. This leads to longer build times as dependencies are downloaded and installed from scratch on every run. Implementing dependency caching will significantly speed up the CI pipeline.

Current Behavior

Dependencies are downloaded and installed from scratch on every CI pipeline run, regardless of whether they have changed. This results in unnecessary network I/O and installation time on every run.

Expected Behavior

Dependencies are cached between CI runs. When dependencies have not changed (i.e., pyproject.toml has not been modified), the cache is restored and the install step is skipped or accelerated, significantly reducing pipeline wall-clock time.

Acceptance Criteria

  • Dependency caching is configured in the CI pipeline (.forgejo/workflows/ci.yml).
  • The cache key is derived from the contents of pyproject.toml so that the cache is automatically invalidated when dependencies change.
  • CI build times are measurably reduced compared to runs without caching.
  • The CI pipeline remains reliable and all jobs complete successfully with caching enabled.

Supporting Information

  • Parent Epic: #1678 — "Epic: CI Execution Time Optimization — Timeouts, Concurrency, and Coverage Artifact Sharing"
  • Related issue: #1812 — "ci-pipeline-design: Use a shared cache for all CI jobs"
  • CI workflow file: .forgejo/workflows/ci.yml

Subtasks

  • Investigate the best way to implement dependency caching for nox and the CI environment.
  • Implement dependency caching for all nox sessions.
  • Verify that the CI pipeline is using the cache and that build times are reduced.
  • Update features/ci_workflow_validation.feature to assert dependency caching configuration is present.
  • Run nox (all default sessions) and fix any errors.
  • Verify coverage ≥ 97% via nox -s coverage_report.

Definition of Done

  • Dependency caching is implemented in the CI pipeline.
  • CI build times are significantly reduced.
  • The CI pipeline remains reliable.
  • features/ci_workflow_validation.feature is updated to cover the caching configuration.
  • 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.
  • All nox stages pass.
  • Coverage >= 97%

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

## Metadata - **Branch**: `chore/ci-dependency-caching` - **Commit Message**: `chore(ci): implement dependency caching in CI pipeline` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Background and Context The CI pipeline currently does not cache dependencies between runs. This leads to longer build times as dependencies are downloaded and installed from scratch on every run. Implementing dependency caching will significantly speed up the CI pipeline. ## Current Behavior Dependencies are downloaded and installed from scratch on every CI pipeline run, regardless of whether they have changed. This results in unnecessary network I/O and installation time on every run. ## Expected Behavior Dependencies are cached between CI runs. When dependencies have not changed (i.e., `pyproject.toml` has not been modified), the cache is restored and the install step is skipped or accelerated, significantly reducing pipeline wall-clock time. ## Acceptance Criteria - Dependency caching is configured in the CI pipeline (`.forgejo/workflows/ci.yml`). - The cache key is derived from the contents of `pyproject.toml` so that the cache is automatically invalidated when dependencies change. - CI build times are measurably reduced compared to runs without caching. - The CI pipeline remains reliable and all jobs complete successfully with caching enabled. ## Supporting Information - Parent Epic: #1678 — "Epic: CI Execution Time Optimization — Timeouts, Concurrency, and Coverage Artifact Sharing" - Related issue: #1812 — "ci-pipeline-design: Use a shared cache for all CI jobs" - CI workflow file: `.forgejo/workflows/ci.yml` ## Subtasks - [ ] Investigate the best way to implement dependency caching for nox and the CI environment. - [ ] Implement dependency caching for all nox sessions. - [ ] Verify that the CI pipeline is using the cache and that build times are reduced. - [ ] Update `features/ci_workflow_validation.feature` to assert dependency caching configuration is present. - [ ] Run `nox` (all default sessions) and fix any errors. - [ ] Verify coverage ≥ 97% via `nox -s coverage_report`. ## Definition of Done - [ ] Dependency caching is implemented in the CI pipeline. - [ ] CI build times are significantly reduced. - [ ] The CI pipeline remains reliable. - [ ] `features/ci_workflow_validation.feature` is updated to cover the caching configuration. - [ ] 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. - [ ] All nox stages pass. - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-02 23:59:53 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: MoSCoW/Could Have — CI/test infrastructure improvement.

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

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: MoSCoW/Could Have — CI/test infrastructure improvement. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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.

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