Repository navigation
Conversation
|
I don’t think this part can be automated while the metadata is sha256-only. A new entry records whatever the repository served at that moment, so the only safeguard is a human checking new coordinates and hashes. With this trigger, the PR goes green automatically, and since no-one is going to check each entry by hand, it essentially just moves the attack surface from the supply chain to the GitHub Action workers. Maybe we can add only the |
Dependabot cannot regenerate java-sdk/gradle/verification-metadata.xml, so its Gradle bumps fail CI until a committer dispatches the refresh workflow. That workflow then only appended to the file while the prek hook rebuilds it from an empty list, so even a refreshed PR stayed red on Static checks over the superseded entries, as apache#76616 did. Regeneration runs dependency code with verification off, which must not share a job with a write token, and the result is the trust list itself, so it cannot be committed unchecked. Claude-Session: https://claude.ai/code/session_01BVx6g77DD1Qpsu2hvLEZxk
A PR head older than the validator carries a script that ignores --validate and runs Gradle instead, with the write token in its environment. Gradle also merges duplicate entries, so a duplicate could add a hash to a retained artifact while the validator only saw the last one. Claude-Session: https://claude.ai/code/session_01BVx6g77DD1Qpsu2hvLEZxk
The merge commit includes earlier bot commits on the PR, so a checksum entry removed by one bot commit could return with a different hash in the next and pass validation as a new entry. Claude-Session: https://claude.ai/code/session_01BVx6g77DD1Qpsu2hvLEZxk
The metadata is checksum-only, so a new entry records whatever the repository served when it was generated, and only a human checking the new coordinates and hashes makes it trustworthy. Running the refresh on every Dependabot PR would remove the one deliberate step where that review is expected to happen. Automating it needs signature verification with trusted keys first.
A new artifact entry with no sha256 passed validation, because there was nothing to compare against the baseline. The validator's contract is that the file only gains or loses generated checksum entries, and an entry without one is not something Gradle writes.
e52123e to
67fc15d
Compare
Thanks for the feedback, TP! |
Why
Dependabot cannot regenerate
java-sdk/gradle/verification-metadata.xml, so a committer dispatchesjava-sdk-dependabot-verification-metadata.ymlfor each Gradle bump. #76714 made that workflow run the prek hook's script. Two problems remain:contents: writetoken. During regeneration, verification is off and dependency code runs.The job also ran on
ubuntu-slim, whose limit is 15 minutes. One dispatch for #76616 took 13m13s.How
The workflow stays manual (
workflow_dispatchonly).Three jobs:
resolveregeneratecache-mode: none)publishValidation:
publishtreats the artifact as untrusted, because a job running dependency code produced it. The new--validatemode rejects:<components>, which coversverify-metadataandtrusted-artifactsThe script and the baseline come from the dispatched ref, normally
main. A PR head may hold an older script, which would ignore--validateand run Gradle with the token present. The PR head is not the baseline either, because an entry removed by an earlier bot commit could return with a different hash as a new entry.A rejected file needs a human to run the hook and find out why.
What this does not do
It does not run on Dependabot PRs automatically. An earlier revision did. The metadata is checksum-only, so a new entry records what the repository served at that moment, and the validator cannot judge a hash for a new coordinate. The dispatch stays the deliberate step, and the committer who dispatches reviews the new entries. Automating it needs signature verification with trusted keys first.
CI for the bot's commit waits for a maintainer's approval, because
GITHUB_TOKENpushed it. This approval is not a review of the entries, and green CI checks against the same file.java-sdk/DEVELOPMENT.mdsays this.Verification
scripts/tests/ci/prek/test_regenerate_java_sdk_verification_metadata.pyprek) on the changed fileslychee-dockeraction_requireduntil approved. Before the bot commit,Java SDK release verificationfailed; after approval it passedlychee-dockerdid not start, because the local Docker proxy refused the bind mount. The change adds no links to Markdown files.Not tested: a validator rejection in a real run, which only the unit tests cover. Whether Static checks accepts the bot's file was not run on the fork. An earlier revision of this PR produced a file byte-identical to the hook's output for #76616.
related: #76616
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5.5, Fable 5.2) following the guidelines