TEST-INFRA: [ci-pipeline-design] Add dependency caching to CI workflow #1625

Closed
opened 2026-04-02 23:18:02 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: task/ci-add-dependency-caching-to-workflow
  • Commit Message: chore(ci): add uv dependency caching to CI workflow keyed on uv.lock
  • Milestone: v3.8.0
  • Parent Epic: #376

Background and context

The current CI pipeline does not cache dependencies between runs. On every commit, the CI server downloads and installs all dependencies from scratch, which significantly increases build times and wastes bandwidth. Adding a uv cache step keyed on uv.lock will allow subsequent runs to reuse previously downloaded packages, reducing CI execution time.

Expected behavior

The CI workflow caches the uv package cache between runs. The cache is invalidated automatically when uv.lock changes (i.e., when dependencies are added, removed, or updated). CI build time is measurably reduced as a result.

Acceptance criteria

  • The CI workflow caches the uv cache directory between runs.
  • The cache key is derived from hashFiles('uv.lock') so it is invalidated precisely when locked dependencies change.
  • CI build time is reduced by at least 20% on cache-hit runs compared to a cold run.

Supporting information

  • Related issue: #1589 (Improve dependency caching strategy — refines restore keys and evaluates nox env caching; this issue focuses on the foundational step of enabling the cache at all)
  • Related issue: #1535 (Consolidate uv Cache Key — complementary consolidation work)
  • CI workflow file: .forgejo/workflows/ci.yml

Subtasks

  • Identify all jobs in .forgejo/workflows/ci.yml that install uv dependencies.
  • Add a cache step to each relevant job using hashFiles('uv.lock') as the primary cache key.
  • Verify that the cache is populated on the first run and restored on subsequent runs.
  • Measure CI build time before and after the change to confirm ≥20% reduction on cache-hit runs.
  • Update any related documentation or workflow comments to reflect the new caching strategy.
  • Run nox (all default sessions), fix any errors.
  • Verify coverage ≥97% via nox -s coverage_report.

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • 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.
  • The CI workflow caches the uv cache keyed on uv.lock.
  • The cache is invalidated when uv.lock changes.
  • CI build time is reduced by at least 20% on cache-hit runs.
  • All nox stages pass.
  • Coverage >= 97%.

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

## Metadata - **Branch**: `task/ci-add-dependency-caching-to-workflow` - **Commit Message**: `chore(ci): add uv dependency caching to CI workflow keyed on uv.lock` - **Milestone**: v3.8.0 - **Parent Epic**: #376 ## Background and context The current CI pipeline does not cache dependencies between runs. On every commit, the CI server downloads and installs all dependencies from scratch, which significantly increases build times and wastes bandwidth. Adding a `uv` cache step keyed on `uv.lock` will allow subsequent runs to reuse previously downloaded packages, reducing CI execution time. ## Expected behavior The CI workflow caches the `uv` package cache between runs. The cache is invalidated automatically when `uv.lock` changes (i.e., when dependencies are added, removed, or updated). CI build time is measurably reduced as a result. ## Acceptance criteria - The CI workflow caches the `uv` cache directory between runs. - The cache key is derived from `hashFiles('uv.lock')` so it is invalidated precisely when locked dependencies change. - CI build time is reduced by at least 20% on cache-hit runs compared to a cold run. ## Supporting information - Related issue: #1589 (Improve dependency caching strategy — refines restore keys and evaluates nox env caching; this issue focuses on the foundational step of enabling the cache at all) - Related issue: #1535 (Consolidate uv Cache Key — complementary consolidation work) - CI workflow file: `.forgejo/workflows/ci.yml` ## Subtasks - [ ] Identify all jobs in `.forgejo/workflows/ci.yml` that install `uv` dependencies. - [ ] Add a cache step to each relevant job using `hashFiles('uv.lock')` as the primary cache key. - [ ] Verify that the cache is populated on the first run and restored on subsequent runs. - [ ] Measure CI build time before and after the change to confirm ≥20% reduction on cache-hit runs. - [ ] Update any related documentation or workflow comments to reflect the new caching strategy. - [ ] Run `nox` (all default sessions), fix any errors. - [ ] Verify coverage ≥97% via `nox -s coverage_report`. ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - 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. - The CI workflow caches the `uv` cache keyed on `uv.lock`. - The cache is invalidated when `uv.lock` changes. - CI build time is reduced by at least 20% on cache-hit runs. - 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:18:57 +00:00
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:10 +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.

Blocks
Reference
cleveragents/cleveragents-core#1625
No description provided.