TEST-INFRA: [ci-pipeline-design] Implement more granular dependency caching #5669

Open
opened 2026-04-09 08:24:29 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Branch: test-infra/granular-dependency-caching
  • Commit Message: chore(ci): implement more granular dependency caching based on pyproject.toml and uv.lock hashes
  • Milestone: (to be assigned — see backlog note below)
  • Parent Epic: #5407

Overview

The current CI pipeline caches the entire ~/.cache/uv directory. This can lead to stale caches and is not as effective as it could be. We should implement a more granular caching strategy based on the pyproject.toml and uv.lock files.

By keying the cache on the hash of both pyproject.toml and uv.lock, the cache will be automatically invalidated whenever dependencies change, while still providing maximum reuse when they have not changed.

Proposed Changes

Modify the .forgejo/workflows/ci.yml file to update the actions/cache step for the ~/.cache/uv directory to use a more precise cache key:

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

Subtasks

  • Update the ci.yml file to use a cache key based on the hash of the pyproject.toml and uv.lock files.

Definition of Done

  • The CI pipeline uses a more granular caching strategy based on pyproject.toml and uv.lock hashes.
  • The cache is effective and reduces the time it takes to install dependencies.
  • Cache is correctly invalidated when pyproject.toml or uv.lock changes.
  • 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/granular-dependency-caching` - **Commit Message**: `chore(ci): implement more granular dependency caching based on pyproject.toml and uv.lock hashes` - **Milestone**: *(to be assigned — see backlog note below)* - **Parent Epic**: #5407 ## Overview The current CI pipeline caches the entire `~/.cache/uv` directory. This can lead to stale caches and is not as effective as it could be. We should implement a more granular caching strategy based on the `pyproject.toml` and `uv.lock` files. By keying the cache on the hash of both `pyproject.toml` and `uv.lock`, the cache will be automatically invalidated whenever dependencies change, while still providing maximum reuse when they have not changed. ## Proposed Changes Modify the `.forgejo/workflows/ci.yml` file to update the `actions/cache` step for the `~/.cache/uv` directory to use a more precise cache key: ```yaml - name: Cache uv dependencies uses: actions/cache@v3 with: path: ~/.cache/uv key: uv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'uv.lock') }} restore-keys: | uv-${{ runner.os }}-${{ matrix.python-version }}- uv-${{ runner.os }}- ``` ## Subtasks - [ ] Update the `ci.yml` file to use a cache key based on the hash of the `pyproject.toml` and `uv.lock` files. ## Definition of Done - [ ] The CI pipeline uses a more granular caching strategy based on `pyproject.toml` and `uv.lock` hashes. - [ ] The cache is effective and reduces the time it takes to install dependencies. - [ ] Cache is correctly invalidated when `pyproject.toml` or `uv.lock` changes. - [ ] 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

Label compliance fix applied:

  • Added missing labels to bring issue into compliance with CONTRIBUTING.md

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Added missing labels to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
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#5669
No description provided.