Emit ArtifactDeleted graph events on quarantine cleanup (closes #199) - #202
Merged
Conversation
Completes #199: the delete path now records every removed artifact (image + referrers) in the supply-chain-graph, closing the loop with ArtifactPromoted on golden. - delete-image gains a deleted-json output: a JSON array of the artifacts actually removed ({digest, tag?} for the image + each referrer), emitted on every exit path. - New stage-deletion-events action turns deleted-json into one ArtifactDeleted event per artifact (occurrence = the quarantine repo, reason=promoted); content ids match cssc_graph. - All three promote workflows stage + upload deletion events after the delete step (separate graph-events-del* artifact; the collector's graph-events* pattern picks it up). Schema/ingest for ArtifactDeleted already landed in #201. Closes #199
Contributor
There was a problem hiding this comment.
Pull request overview
This PR completes the “deletion emission” half of #199 by capturing which artifacts were actually removed during quarantine cleanup and emitting one ArtifactDeleted supply-chain-graph event per removed artifact, so the graph can record tombstones for both the promoted image and its referrers.
Changes:
- Extend
delete-imageto outputdeleted-json(a JSON array of removed{digest, tag?}entries) for downstream event staging. - Add a new composite action
stage-deletion-eventsthat convertsdeleted-jsoninto schema-alignedArtifactDeletedevent files (content-id compatible withcssc_graph.identity.content_id). - Wire deletion event staging + artifact upload into the promote workflows after the quarantine delete step; update docs to reflect the new output/event kind.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
docs/reference/workflow-actions.md |
Documents the new delete-image deleted-json output. |
docs/architecture/observability/supply-chain-graph.md |
Updates the workflow→event mapping to include ArtifactDeleted for promote workflows. |
.github/workflows/_promote-override.yml |
Adds id: delete, stages deletion events, and uploads graph-events-del. |
.github/workflows/_promote-from-quarantine.yml |
Stages and uploads deletion events per matrix job (graph-events-del-*). |
.github/workflows/_promote-from-quarantine-sbom.yml |
Same as above for the SBOM variant. |
.github/actions/stage-deletion-events/action.yml |
New action to create per-artifact ArtifactDeleted event files from deleted-json. |
.github/actions/delete-image/action.yml |
Adds deleted-json output and records deleted referrers/image digest for event emission. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot review: the sha256-<subject> fallback referrer index deletions
bumped referrers-deleted but weren't added to deleted-json, so their
ArtifactDeleted events were missed. Capture the version's digest (.name)
and append {digest, tag} on successful deletion.
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.
Completes #199 (part 2 — the emission companion to the merged #201).
What
The quarantine-cleanup path now records every removed artifact (the image and each referrer) in the supply-chain-graph as
ArtifactDeleted, closing the loop withArtifactPromotedon golden. (Schema +cssc_graphingest forArtifactDeletedalready landed in #201.)Changes
delete-image: newdeleted-jsonoutput — a JSON array of the artifacts actually removed ({digest, tag?}for the image + each referrer), emitted on every exit path (token-skip, version-not-found, success). Resolves the image digest once up front so the image entry is populated even without referrer deletion.stage-deletion-eventsaction: turnsdeleted-jsoninto oneArtifactDeletedevent per artifact (occurrence = the quarantine repo,reason: promoted); skips entries without a digest; content ids matchcssc_graph.identity.content_id.graph-events-deland upload asgraph-events-del*. The genericrecord-graph-eventscollector (pattern: graph-events*,merge-multiple) commits them unchanged. (Addedid: deleteto the override workflow's delete step.)Validation
shellcheckclean on both action scripts.delete-image:deleted-jsoncorrectly lists the deleted referrer + the tagged image.stage-deletion-eventsmocked run: emits schema-validArtifactDeletedevents (referrer + tagged image) with matching content ids.actionlintclean for the new steps (pre-existing info/style warnings in untouched jobs remain).Closes #199