Skip to content

fix: dependency cache bugs for fork PR CI#1394

Merged
sd-db merged 12 commits intomainfrom
sd-db/fix/warm-cache-comprehensive
Apr 13, 2026
Merged

fix: dependency cache bugs for fork PR CI#1394
sd-db merged 12 commits intomainfrom
sd-db/fix/warm-cache-comprehensive

Conversation

@sd-db
Copy link
Copy Markdown
Collaborator

@sd-db sd-db commented Apr 13, 2026

Summary

Fixes issues preventing the dependency cache (#1386) from working on fork PRs:

  • uv cache path: setup-uv overrode the cache dir to a temp path. Use cache-local-path to pin it.
  • uv offline lookups: cache is scoped by index URL hash. Set UV_INDEX_URL to match the warmer's JFrog URL.
  • Pre-commit broken symlinks: warmer's Python path differed from consumer's. Use setup-python in warmer.
  • pip offline: PIP_NO_INDEX blocks all index access. Create a pip wheelhouse and use PIP_FIND_LINKS.
  • Version-specific wheels: create test envs for all matrix versions in the warmer.
  • Misc: removed no-op strategy.fail-fast, added missing id: coverage_comment.

Test plan

  • warm-cache job succeeds on this PR
  • All main.yml jobs pass offline

pypa/hatch@install bundles hatchling, so hatch env create never
downloads it via uv. Explicitly install hatchling via uv to populate
the cache — needed for uv's build isolation in offline mode.
setup-uv forcibly overrides UV_CACHE_DIR to a temp path even when set
in job env. Use the cache-local-path input parameter instead, which
setup-uv respects. This ensures uv writes to ~/.cache/uv (matching
the cache save/restore paths) instead of a temp dir.
uv pip install --system uses a different cache resolution path than
uv's build isolation. Use uv build --wheel which triggers the exact
same build isolation mechanism that consumers use, ensuring hatchling
is cached in the right format.
…ling)

hatch -v build triggers uv's build isolation which caches hatchling.
The separate uv build --wheel step was redundant. With cache-local-path
now correctly set, hatch build writes to ~/.cache/uv.
uv cache is index-URL-scoped — entries are keyed by the URL hash of
the index that was used to download them. The warmer downloads via
JFrog, so cache entries are stored under JFrog's URL hash. Without
setting the same URL in offline mode, uv defaults to pypi.org's hash
and finds nothing.

Set UV_INDEX_URL to JFrog's URL (without credentials) in offline mode.
uv never contacts it — it only uses the hash to find the right cache
bucket.

Verified locally: warmer populates cache online, consumer creates hatch
envs + runs code-quality + builds offline successfully.
@github-actions
Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

Use setup-python in warmer instead of uv python install so Python
paths match the consumer. Only create default + verify hatch envs.
Remove temporary debug step from main.yml.
Three issues fixed:
1. Pre-commit venv broken symlink: warmer used uv python install
   (path differs from consumer's setup-python). Fix: use setup-python
   3.10 for default env, uv python install only for 3.11-3.13 test
   matrix (their symlinks don't matter — only wheels are cached).

2. pip has no offline mode: PIP_NO_INDEX blocks all index access
   including build deps like setuptools. Fix: warmer creates a pip
   wheelhouse (~/.cache/pip-wheelhouse), consumer sets PIP_FIND_LINKS
   to use it.

3. Test matrix needs version-specific wheels: restored uv python
   install 3.11-3.13 and test env creation for all versions.
@sd-db sd-db changed the title fix: cache hatchling build dep for offline uv builds fix: warm cache bugs — uv cache path, pre-commit symlinks, pip wheelhouse Apr 13, 2026
pip download fails when dependency specs with commas (e.g.
"click>=8.2.0, <9.0.0") are passed as shell-expanded args.
Write to a requirements file and use -r instead.

Verified locally: full E2E offline test passes (env create,
code-quality, build). Verify step has platform mismatch locally
but will work on CI (Linux wheels).
@sd-db sd-db changed the title fix: warm cache bugs — uv cache path, pre-commit symlinks, pip wheelhouse fix: dependency cache bugs for fork PR CI Apr 13, 2026
@sd-db sd-db merged commit 40bc0d6 into main Apr 13, 2026
12 of 16 checks passed
@sd-db sd-db deleted the sd-db/fix/warm-cache-comprehensive branch April 13, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants