Repository navigation
chore(locks): regenerate hash locks to clear upstream PyPI drift - #500
Conversation
The Hash-lock drift check (producers-ci.yml lock-drift) regenerates all three locks with regen-locks.sh against live PyPI and has been failing on every PR touching producers/ since new upstream releases landed. This commit is the exact regen-locks.sh output from CI run 36452021746 (job 109028872797, 2026-09-28 16:35 UTC), applied byte-for-byte from the job's git diff. No .in / pyproject / script changes. pip stays at 26.1.2 (pip<26.2 hold from GoogleCloudPlatform#412 still respected); pip-tools 7.6.0 -> 7.6.1.
caohy1988
left a comment
There was a problem hiding this comment.
Rejection criteria recorded before reading the diff:
- Reject if the patch changes anything outside the three specified locks, differs from the cited CI regeneration diff, or violates the
pip<26.2hold. - Reject if a lock loses required hashes/dependencies or introduces an option/marker change that breaks hash-enforced installation.
- Reject if regeneration immediately re-drifts or the dependency updates cause the receiver/producers checks to fail.
Independent Astra review of de0d845e016b158255873f2f7657aff48ac190ac → c44001f8a31f47fd5f85f74c893fb820b838815b. No other reviewer's review, PR review/comment, vault note, or shared review artifact was read.
What I tried and verified:
- Read the PR description, commit message, full diff, generator, Dockerfile, generator-guard tests, producers workflow/manifest, and image self-test.
git diff --name-statuscontains exactly the three contracted files;git diff --checkpasses. - Independently ran
gh run view 36452021746 -R GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK --job 109028872797 --log. Removed only the job/step/timestamp envelope and extracted the complete three-file patch. It is byte-for-byte equal to the specified base-to-headgit diff: 63,943 bytes, SHA-2562e478ee44e3e15fb9ef6f6a58fffe0b77151bfbd7afde4200511954431d6ed6efor both. Source job. - Parsed every logical requirement and independently used pip's requirements-file parser: generator 13, runtime 32, build 8 entries, all exact pins with SHA-256 hashes. No executable index/options, direct URLs, or platform-marker changes. The
--no-indexadditions are comments at line 5 of each lock; pip ignores them. The unchanged hold indeploy/otlp_receiver/pip-tools.in:27is honored bypip==26.1.2atdeploy/otlp_receiver/pip-tools.lock:58. - Compared package sets and versions against base: no packages removed and no major-version jumps. Runtime retains all 32 packages.
protobufwas already 7.x andcryptographyalready 50.x. The only added package is hashedtomlkit==0.15.1, attributed to hatchling in both toolchain locks (deploy/otlp_receiver/pip-tools.lock:44,producers/build-requirements.lock:33). All direct core/receiver requirements inproducers/pyproject.toml:41and:56accept the locked versions. - Ran
PYTHONDONTWRITEBYTECODE=1 python3 -m pytest -c producers/pyproject.toml producers/tests/test_regen_locks_guards.py producers/tests/test_release_workflow_contract.py -p no:cacheprovider --tb=short -q: 17 passed. These include executed guard, rollback/signal, and convergence-failure tests. - Inspected Producers CI run 36464719073, whose recorded head is the reviewed SHA. All five Python 3.10–3.14 producers jobs report 547 passed, 4 skipped. Although the workflow installs floating
[dev,receiver]dependencies (.github/workflows/producers-ci.yml:88), I compared its install logs to the runtime lock: all 32 runtime versions match in every matrix job. - Inspected the receiver image job: both Dockerfile hash-enforced installs ran successfully, all 32 runtime versions match, factories/version checks passed, bad-token HTTP returned 401, and authenticated protobuf export returned 200 with 1 published record and 0 dead letters. The locked build/backend and wheel build also passed in the producers build job.
- Tried to falsify immediate stability using the head's drift-check log: it converged in one generator phase, regenerated both downstream locks, and passed the three-file
git diff --exit-codeat 2026-09-28 18:23 UTC, after the cited 16:35 UTC output.
Findings:
- P0: None.
- P1: None.
- P2: None introduced by this patch; no corrective change requested.
Limits and residual risk: I could not locally rerun regen-locks.sh or the Docker self-test: docker info fails because this Mac's client API is 1.40 while the daemon requires at least 1.44. Docker execution evidence above comes from the actual head's CI logs. Future PyPI releases or added distributions can still cause drift because the unchanged generator resolves live inputs; the successful current run disproves immediate re-drift, not future drift. The PR already identifies that separate follow-up, so expanding this three-lock patch is unnecessary.
Final gh pr checks after foreground waiting: 20 passed, 4 skipped, no failures or pending checks (including the broader SDK test matrix and package build). Worktree remains clean; no branch changes, pushes, or merges.
VERDICT: APPROVE @ c44001f
caohy1988
left a comment
There was a problem hiding this comment.
Blind review, Fable (Claude) · PR #500 @ c44001f8a31f47fd5f85f74c893fb820b838815b (base de0d845)
I reviewed this as an attempt to disprove it. I did not read any other review or comment on this PR before posting.
Rejection criteria (set before reading the diff)
- RC1 (fidelity): the three locks at head differ from what
deploy/otlp_receiver/regen-locks.shproduces today. That means the PR diff ≠ the diff printed by run 36452021746 / job 109028872797, orHash-lock drift checkis not green on this head. - RC2 (scope + hash integrity): any file outside the three locks changes. Or a pin lacks
--hash. Or an uncommented option/index line (--no-index,--index-url,--find-links, …) would changepip install --require-hashes. Orpip-tools.lockpinspip>=26.2(breaks the #412 hold). Or the hashes don't match the real PyPI artifacts. - RC3 (runtime safety): the upgraded deps break the receiver image or producers CI. Or a dropped transitive dep or a marker change breaks install/import on the Dockerfile's Python 3.12 / linux-amd64.
Result: none of the criteria is met. Evidence below.
What I tried
-
Scope.
git diff --stat de0d845..c44001fshows 3 files:pip-tools.lock(+26/−22),requirements.lock(+374/−288),build-requirements.lock(+17/−13). It is a single commit whose parent isde0d845. There are no.in,pyproject.toml, Dockerfile, script, or workflow edits. -
Re-extracted the CI diff myself.
- Run 36452021746 is the
pull_requestrun for #499. The job checked out388572e, which is8994f97merged intode0d845: the same base as this PR. #499 touches none of the lock inputs. - I stripped the log prefixes from
gh run view 36452021746 --job 109028872797 --log, leaving 859 diff lines. That text has the same SHA-256 (2e478ee4…) asgit diff de0d845 c44001f -- <3 locks>. - Applying the CI patch to the base files in a scratch repo reproduces the exact head blobs
acbd022/f7b449f/611cdc6(full SHA-1 match). The byte-for-byte claim holds.
- Run 36452021746 is the
-
Independent regen today. I replicated
regen-locks.sh:49-100faithfully:- same pinned
python:3.12-slim@sha256:423ed6ab…digest, run as--platform linux/amd64(Python 3.12.13); - same
pip install --require-hashes/pip-compilecommands and the same/srcand/outpaths; - a fresh container per phase, with inputs and outputs moved as tar streams instead of bind mounts.
At 2026-09-28 18:33:55Z it converged and all three outputs were byte-identical to the head blobs. Separately, this PR's own lock-drift job (run 36464719073, job 109071796192, merge
a7a5909) converged in phase 1 and passedgit diff --exit-codeat 18:23Z. - same pinned
-
Hash authenticity. For all 44 unique pins across the three locks, the lock's
--hashset exactly equals the sha256 digests PyPI lists for that version. There are no subsets and no unknown hashes, nothing is yanked, and every file was uploaded on or before 2026-09-25. Pins shared between locks carry identical hashes in each file. -
Structural diff. I parsed the old and new locks.
- No pin lacks hashes, no option lines are uncommented, and there are no markers.
requirements.lockhas the same 32 packages, none added or removed. There are no major-version jumps: 21 minor/patch bumps.- The generator and build locks gain only
tomlkit==0.15.1, because hatchling 1.32.4 now hasRequires-Dist: tomlkit>=0.11.1. - The changed
viacomments match upstream metadata.google-api-core2.39.0 now requiresopentelemetry-api>=1.44.0.gunicorn26.2.0 has no deps, andpackagingremains viagoogle-cloud-bigquery. - The hash-count shifts (
charset-normalizer93→172,google-crc32c33→31) equal PyPI's artifact counts. - The CI image install built nothing from source:
cffi,charset-normalizer,cryptography,google-crc32c,grpcio, andprotobufall came from x86_64 cp312/abi3 wheels.
-
pip hold.
pip==26.1.2(deploy/otlp_receiver/pip-tools.lock:58) satisfiespip<26.2(deploy/otlp_receiver/pip-tools.in:27). -
--no-index. It appears only in the#header line (line 5 of each lock). pip ignores comment lines, andregen-locks.sh:53compares lock bodies with comments stripped. pip-compile forwards--no-indexto pip only when the parsed value is truthy (piptools/scripts/compile.py:291), and the resolution demonstrably ran against PyPI. It is harmless for install and resolution. See P2-1 for its real cause. -
Runtime. All checks are green on
c44001f: 20 pass, and the 4 zizmor jobs were skipped.- The receiver image self-test got 401 for a bad token and 200 with
published: 1and 0 dead-lettered. - Producers build installed
build-requirements.lockwith hashes and built the sdist and wheel with--no-isolation. - I also replicated both Dockerfile stages locally on linux/amd64 (
Dockerfile:27-30,:36-41). Installing all 32 runtime pins with--require-hashesworked, andpip checkreported "No broken requirements found". Both factories import, neitherbuildnorhatchlingis present, and an OTLPExportLogsServiceRequestround-trips (protobuf upb backend).
- The receiver image self-test got 401 for a bad token and 200 with
-
Tests.
producers/tests/test_regen_locks_guards.pypassed locally (13 passed). Note thatProducers test (3.10–3.14)installs floating.[dev,receiver](producers-ci.yml:88), not the lock. They corroborate rather than consume it: the 3.12 job resolved the same versions as the lock for the key bumped packages I checked (google-cloud-bigquery 3.45.2, pubsub 2.41.0, api-core 2.39.0, protobuf 7.36.2, grpcio 1.84.0, otel 1.45.0, gunicorn 26.2.0, urllib3 2.8.0, cryptography 50.0.1, crc32c 1.9.0) and got 547 passed, 4 skipped.
Findings
P0: none. P1: none.
P2-1: the PR body misattributes the --no-index header token, and the header is now misleading.
- Cause: the
clickbump 8.4.2 → 8.5.0 (pip-tools.lock:11), not pip-tools 7.6.1. - How it happens: under click 8.5.0, a flag option without an explicit default gets
.default == Sentinel.UNSET. pip-tools'get_compile_commandthen fails itsoption.default == valueskip (piptools/utils.py:366). For a flag with no negative form, it emits the positive name (utils.py:387) even though the value isFalse. - Reproduced in a 2×2 matrix of py3.12 venvs:
- with click 8.5.0, pip-tools 7.6.0 and 7.6.1 both write
--no-indexinto the header; - with click 8.4.2, both write a clean header;
ctx.params['no_index'] == Falsein all four.
- with click 8.5.0, pip-tools 7.6.0 and 7.6.1 both write
- Impact: none on install or resolution. But anyone who re-runs the header command by hand passes a real
--no-index, which fails without--find-links. - Fix: reword that sentence in the PR body.
- Follow-up (script change, out of scope here): export
CUSTOM_COMPILE_COMMAND=deploy/otlp_receiver/regen-locks.shinto the pip-compile containers. pip-tools honors it (piptools/writer.py:139), so headers stay stable across generator and click upgrades and header-only drift goes away.
P2-2: the stated reason for the pip<26.2 hold is now stale. This is a follow-up; this PR correctly keeps the hold.
pip-tools.in:21-26says the newest pip-tools predates pip 26.2 and is equally affected.- The pip-tools 7.6.1 locked here ships a pip ≥ 26.2 shim: it passes
allow_editableswhenPIP_VERSION_MAJOR_MINOR >= (26, 2)(piptools/_internal/_pip_api/command_methods.py:55). Its metadata still says onlypip>=22.2, and CI already prints thepip 26.1.2 -> 26.2.1notice. - Suggestion: in a separate PR, try lifting the hold and let the convergence loop prove pip 26.2.x + pip-tools 7.6.1 works. Failing that, at least update the comment.
P2-3: the check will re-drift on the next relevant upstream release. The PR's own Follow-up section acknowledges this, so it doesn't block. For scale: since the previous refresh (#412, 2026-08-10), 21 of the 32 runtime pins had moved.
- Suggestion: the generator's locked pip (26.1.2) supports
--uploaded-prior-to <datetime>. Passing--pip-args="--uploaded-prior-to=<timestamp committed in the repo>"to the threepip-compilecalls (regen-locks.sh:61,93,97) would make the check deterministic: it would drift only when a refresh PR bumps the timestamp. First verify that pip-tools forwards the flag to itsPackageFinder. - Alternative: run drift only when lock inputs change, plus a scheduled refresh job.
Not verified
- I did not run the full
selftest.sh(Pub/Sub emulator path) locally; for that I rely on the green CI run onc44001f. docker buildwasn't usable here (no buildx, and the legacy builder can't cross-build), so I replicated the image stage by stage withdocker run.- I did not run the
regen-locks.shwrapper itself (bind mounts and transactional copyback) locally. The copyback is covered by the 13 guard tests. - I checked only linux/amd64. That is the only release platform:
release-tracing.yml:215runs a plaindocker buildonubuntu-latest.
VERDICT: APPROVE @ c44001f
98984ff
into
GoogleCloudPlatform:main
…st (#501) * chore(release): 0.5.4 — compaction_windows view, smoke-test unpickling allowlist Bump the version to 0.5.4 and cut the CHANGELOG for the ten PRs merged since v0.5.3 (#490–#497, #499, #500). [Unreleased] is left empty; the #494 entry moves into [0.5.4]. * docs(changelog): tighten 0.5.4 compatibility notes List every incidental name #490/#496 removed and where each lives now, fix the permission repair to `chmod go-w`, scope the log-dir symlink rule to logs outside the state directory, and qualify the tracing checks' platform fallbacks. * chore(release): date 0.5.4 for 2026-09-29
What
Regenerates the three hash-locked files so the Hash-lock drift check goes green again:
deploy/otlp_receiver/pip-tools.lockdeploy/otlp_receiver/requirements.lockproducers/build-requirements.lockWhy
lock-driftinproducers-ci.ymlrerunsregen-locks.shagainst live PyPI and diffs against the checked-in locks. New upstream releases since the last refresh make it fail on every PR that touchesproducers/(seen on #499). The drift is unrelated to any feature PR, so it is fixed here onmainrather than folded into #499.How
The content is the exact
regen-locks.shoutput from CI run 36452021746, job 109028872797 (2026-09-28 16:35 UTC), applied byte-for-byte from that job'sgit diff. No.in,pyproject.toml, Dockerfile, or script changes.Notable bumps: pip-tools 7.6.0 to 7.6.1 (pip stays 26.1.2, so the
pip<26.2hold from #412 is still honored), build 1.6.1, hatchling 1.32.4, google-cloud-bigquery 3.45.2, grpcio 1.84.0, opentelemetry 1.45.0, protobuf 7.36.2, urllib3 2.8.0, cryptography 50.0.1. The autogenerated header comment now shows--no-index(a side effect of the newer click 8.5.0 in the generator env, per review); it is a comment only and does not affect install or resolution, which ran against PyPI.Verification
CI on this PR reruns the regen and the receiver image self-test. Expect
Hash-lock drift checkgreen unless PyPI publishes again before the run (the check floats against live PyPI).Follow-up (not in this PR)
Because the check regenerates against live PyPI, it will re-drift on the next upstream release. A durable fix (for example, running drift as a scheduled/lock-path-only job, or pinning resolution time) is a separate decision.