Repository navigation
Hash the jobs a job needs into its hash - #30
Merged
Merged
Conversation
A job's hash covered its own inputs but not the jobs it needs. When test needs build and uses its artifact, a change to build's inputs alone made build run while test skipped on its unchanged hash: a false skip. hash_job's digest computation becomes job_digest (same place, same steps), which now ends with the whole digest of every job the job needs, in sorted order, transitively, through the small needs_hash module. A job it doesn't need stays out. A cycle (which the loader already rejects) is an error rather than a recursion. Tests: a mockci scenario where changing build's input makes test run, and a hash test for a two-step chain plus an unrelated job. STATUS 22 records it as resolved; the inputs and jobs docs say what the hash now covers.
ndbroadbent
force-pushed
the
providers/hash-needs
branch
from
December 4, 2026 02:27
628cd8d to
a4ee8e7
Compare
ndbroadbent
added a commit
that referenced
this pull request
Dec 4, 2026
Replaces DIRECTION's short "Pass-record stores" section with the design for order-of-work item 4: - cigen_plan hashes every job and looks them up in one batch; each job's if: reads its output, fail-open (anything but an exact "skip" runs). - cigen_gate is the one required check, so no required check is ever "skipped"; the alternatives (early exit, posted statuses) and their costs. - The PassStore trait and the HTTP protocol VisualCI's API is specified from: keys, lookup/record, scope decided by the server from OIDC claims, expiry, fail-open errors. - How untrusted runs are kept from writing trusted passes, per backend. - Why it can't skip falsely, the migration from the per-job flow, and what mockci needs. Found while writing it: a job's hash didn't include the jobs it needs, a false skip in today's flow, fixed separately in PR #30.
ndbroadbent
added a commit
that referenced
this pull request
Dec 4, 2026
ndbroadbent
added a commit
that referenced
this pull request
Dec 4, 2026
Ports #30's needs hashing into hashing::hash_job: a job's hash covers the hashes of the jobs it needs, transitively, and without --modules-digest it uses the modules digest this cigen computes. cigen explain lists the needed jobs with their hashes.
This was referenced Dec 4, 2026
ndbroadbent
added a commit
that referenced
this pull request
Dec 4, 2026
Ports #30's needs hashing into hashing::hash_job: a job's hash covers the hashes of the jobs it needs, transitively, and without --modules-digest it uses the modules digest this cigen computes. cigen explain lists the needed jobs with their hashes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased onto
mainafter #28. A false skip in today's flow, found while designing the planner (#29). A job's hash covered its own inputs but not the jobs itneeds. Whentestneedsbuildand uses its artifact, a change tobuild's inputs alone madebuildrun whiletestskipped on its unchanged hash.What changed
src/hashing/) can port it.hash_jobstays where it is, and its digest computation becomesjob_digestin the same file with the same steps. At the end,job_digesthashes in the whole digest of every job the jobneeds, through a small newsrc/commands/needs_hash.rs:--modules-digestfrom its generated config. A needed job's module expansions are already covered by its derived inputs.needschange once (the cigen version is in every hash anyway). Generated output is unchanged.inputs.mdlists "the jobs itneeds" among what a hash covers;jobs.mdsays so underneeds. STATUS: "Derived inputs" says so, and a new known problem 22 is marked Resolved (PR Hash the jobs a job needs into its hash #30) (Match globs with :(glob) pathspecs: **/*.md now includes root files #28 took 20 and 21).Testing
derived_inputs::changing_a_job_this_job_needs_makes_it_run(mockci). It failed before the change (buildran,testskipped) and passes now.derived_inputs::a_job_hash_covers_the_jobs_it_needs_transitively_and_no_others: changing a job two steps upstream changes the hash, and changing an unrelated job doesn't.task cigreen.#29 (the design) currently adds this as an open STATUS 20. I'll drop that from #29 when it rebases, so only this PR's Resolved entry remains.