fix: sequence passthrough artifact download after producer upload - #183
Merged
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
A live orchestrate run of cascade-example-2env (run 27626828892) failed: the
matrix image build uploaded its passthrough artifact, but the dependent bundle
build's
Download artifacts for Build (bundle)step failed withArtifact not found for name: build-image.Root cause is a job-ordering race, not a name mismatch. For a build declaring
artifact: { upload: ... }, cascade emits a sibling<build>-uploadjob. Aconsumer declaring
artifact: { downloads: [<producer>] }gets a<consumer>-downloadpre-job. That pre-job'sneeds:was[setup, <consumer direct deps>]and never included<producer>-upload, so thedownload ran before the upload finished. The run log confirms the ordering: the
download attempt at 14:59:45 failed eight seconds before the upload even started
at 14:59:53. The artifact name matched (
build-image); the artifact simply didnot exist yet. A consumer
depends_onwould not help, because it only sequencesthe consumer after the producer callback, which can finish before its separate
upload job does.
Fix
writePassthroughDownloadJobnow adds each producer's<producer>-uploadjob tothe download pre-job's
needs:(deduplicated, and only when the producerdeclares an upload). This establishes the missing happens-after edge so the
artifact exists before the download runs.
Before:
After:
The diff against the real 2env manifest is exactly this one line.
Verification
TestGenerator_PassthroughArtifact_DownloadNeedsUploadJobreproduces thedefect (matrix producer, consumer with no
depends_on, mirroring 2env) andasserts the download job's
needs:includesbuild-image-upload. Red beforethe change, green after.
go build ./...,go test ./...(1357 pass), andgolangci-lint run ./...all green.
build-image-uploadedge on the bundle download job.No e2e scenario was added. The e2e harness
BuildConfigdoes not expose theartifactpassthrough field (e2e/harness/scenario.go), and the act runner isstarted with no artifact server (
e2e/harness/act.go), soupload-artifact/download-artifactcannot execute under the harness at all. The race onlymanifests at runtime with a real artifact backend. The deterministic generator
test on the emitted
needs:ordering plus the live 2env run are the appropriatecoverage.