ci(cache): improve uv cache effectiveness by keying on uv.lock instead of pyproject.toml #3559

Open
opened 2026-04-05 19:36:43 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: task/ci-uv-lock-cache-key
  • Commit Message: ci(cache): key uv package cache on uv.lock hash for improved cache hit rate
  • Milestone: Backlog
  • Parent Epic: #1678

Description

The CI pipeline currently caches uv packages based on the hash of pyproject.toml. This is suboptimal because pyproject.toml can change (e.g., metadata edits, tool config updates) without altering the resolved dependency set, causing unnecessary cache misses. Conversely, the uv.lock file is the authoritative record of the exact resolved dependency tree — a cache key derived from its hash will only invalidate when dependencies actually change.

Switching the cache key from pyproject.toml to uv.lock will improve cache hit rates and reduce total CI execution time, directly contributing to the goals of the parent Epic.

Subtasks

  • Update .forgejo/workflows/ci.yml to use uv.lock as the cache key source instead of pyproject.toml
  • Verify the updated cache step restores correctly on a branch where only pyproject.toml metadata changes (no dep changes)
  • Update features/ci_workflow_validation.feature to assert the cache key references uv.lock
  • Run nox (all default sessions), fix any errors
  • Verify coverage ≥ 97% via nox -s coverage_report

Definition of Done

  • .forgejo/workflows/ci.yml cache step uses uv.lock (not pyproject.toml) as the hash source for the cache key
  • features/ci_workflow_validation.feature is updated to cover the new cache key assertion
  • Cache hit rate is demonstrably improved (no spurious misses on metadata-only pyproject.toml changes)
  • All nox stages pass
  • Coverage ≥ 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.8.0. 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: ca-new-issue-creator

## Metadata - **Branch**: `task/ci-uv-lock-cache-key` - **Commit Message**: `ci(cache): key uv package cache on uv.lock hash for improved cache hit rate` - **Milestone**: Backlog - **Parent Epic**: #1678 ## Description The CI pipeline currently caches `uv` packages based on the hash of `pyproject.toml`. This is suboptimal because `pyproject.toml` can change (e.g., metadata edits, tool config updates) without altering the resolved dependency set, causing unnecessary cache misses. Conversely, the `uv.lock` file is the authoritative record of the exact resolved dependency tree — a cache key derived from its hash will only invalidate when dependencies actually change. Switching the cache key from `pyproject.toml` to `uv.lock` will improve cache hit rates and reduce total CI execution time, directly contributing to the goals of the parent Epic. ## Subtasks - [ ] Update `.forgejo/workflows/ci.yml` to use `uv.lock` as the cache key source instead of `pyproject.toml` - [ ] Verify the updated cache step restores correctly on a branch where only `pyproject.toml` metadata changes (no dep changes) - [ ] Update `features/ci_workflow_validation.feature` to assert the cache key references `uv.lock` - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage ≥ 97% via `nox -s coverage_report` ## Definition of Done - [ ] `.forgejo/workflows/ci.yml` cache step uses `uv.lock` (not `pyproject.toml`) as the hash source for the cache key - [ ] `features/ci_workflow_validation.feature` is updated to cover the new cache key assertion - [ ] Cache hit rate is demonstrably improved (no spurious misses on metadata-only `pyproject.toml` changes) - [ ] All nox stages pass - [ ] Coverage ≥ 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.8.0. 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: ca-new-issue-creator
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Low — CI cache optimization is a performance improvement, not a functional issue. The current cache works, just less effectively.
  • Milestone: v3.7.0 — CI infrastructure improvements belong to the CI Quality Gates epic.
  • Story Points: 1 — XS — Simple cache key change in CI configuration.
  • MoSCoW: Could Have — Performance optimization for CI. Nice to have but not blocking anything.
  • Parent Epic: #2810 (CI Quality Gates Restoration)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Low — CI cache optimization is a performance improvement, not a functional issue. The current cache works, just less effectively. - **Milestone**: v3.7.0 — CI infrastructure improvements belong to the CI Quality Gates epic. - **Story Points**: 1 — XS — Simple cache key change in CI configuration. - **MoSCoW**: Could Have — Performance optimization for CI. Nice to have but not blocking anything. - **Parent Epic**: #2810 (CI Quality Gates Restoration) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo added this to the v3.7.0 milestone 2026-04-05 19:45:10 +00:00
freemo removed this from the v3.7.0 milestone 2026-04-06 23:38:38 +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.

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