Skip to content

ci: simplify venv cache key and consolidate poetry env - #679

Merged
bdraco merged 1 commit into
mainfrom
ci/simplify-venv-cache-key
May 17, 2026
Merged

bdraco merged 1 commit into
mainfrom
ci/simplify-venv-cache-key

Conversation

@bdraco

@bdraco bdraco commented May 17, 2026

Copy link
Copy Markdown
Member

Follow-up cleanup of the venv cache landed in #675.

What

Three trims, all behavior-preserving (or, in the first case, eliminating a no-op):

  1. Drop ${{ env.ImageOS }}-${{ env.ImageVersion }}- from both cache keys. I'd added these as a "safety" knob meant to invalidate the cache on runner image flips, but they don't actually work as written — env context only resolves workflow-declared env vars, not runner process env vars like ImageOS/ImageVersion. The post-merge run on main makes this visible: the emitted key was venv-v1-Linux---py3.12-use_cython-… — the --- is two empty interpolations. They've been doing nothing.
  2. Merge the two hashFiles() calls into a single call covering poetry.lock, pyproject.toml, build_ext.py, src/dbus_fast/**/*.py, and src/dbus_fast/**/*.pxd. The split into two calls had no functional difference (the resulting cache key is the concatenation either way) and just made the line noisier.
  3. Promote POETRY_VIRTUALENVS_IN_PROJECT: "true" to workflow-level env: instead of declaring it on both test and benchmark jobs. Single source of truth; matches how the rest of the workflow handles cross-cutting config.

Why

#675's cache key was over-engineered, and the post-merge logs (venv-v1-Linux---py3.12-…) make the bug in the safety addition obvious. Trimming the dead bits keeps the working parts and is easier to read.

Notes

  • The post-merge pycairo BadZipFile failures on test (3.10–3.13, use_cython) were a transient PyPI/wheel issue, not caused by ci: cache poetry venv keyed on lockfile and cython sources #675's caching. Logs show poetry cache is not found (setup-python cache missed) and our venv cache also missed on that run — pycairo's wheel was downloaded fresh and the download landed corrupt. Out of scope for this PR; a rerun should clear it.
  • If runner-image-flip safety becomes desirable later, it needs to be done via a run: step that reads $ImageVersion from the shell and exposes it as a step output — the bare ${{ env.ImageVersion }} reference is silently empty. Worth a separate PR if we decide we want it.

@codecov

codecov Bot commented May 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.90%. Comparing base (f4d9965) to head (fa30e51).
⚠️ Report is 111 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #679   +/-   ##
=======================================
  Coverage   89.90%   89.90%           
=======================================
  Files          29       29           
  Lines        3527     3527           
  Branches      606      606           
=======================================
  Hits         3171     3171           
  Misses        211      211           
  Partials      145      145           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented May 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing ci/simplify-venv-cache-key (fa30e51) with main (f4d9965)

Open in CodSpeed

@bdraco
bdraco merged commit c951cba into main May 17, 2026
19 of 20 checks passed
@bdraco
bdraco deleted the ci/simplify-venv-cache-key branch May 17, 2026 20:11

This branch had an error being deployed

1 failed deployment
release — fa30e51e Deployed May 17, 2026 by bdraco via release #2432
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.

1 participant