Skip to content

Emit ArtifactDeleted graph events on quarantine cleanup (closes #199) - #202

Merged
toddysm merged 2 commits into
mainfrom
feat/graph-events-deletions
Aug 14, 2026
Merged

Emit ArtifactDeleted graph events on quarantine cleanup (closes #199)#202
toddysm merged 2 commits into
mainfrom
feat/graph-events-deletions

Conversation

@toddysm

@toddysm toddysm commented Aug 14, 2026

Copy link
Copy Markdown
Owner

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 with ArtifactPromoted on golden. (Schema + cssc_graph ingest for ArtifactDeleted already landed in #201.)

Changes

  • delete-image: new deleted-json output — 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.
  • New stage-deletion-events action: turns deleted-json into one ArtifactDeleted event per artifact (occurrence = the quarantine repo, reason: promoted); skips entries without a digest; content ids match cssc_graph.identity.content_id.
  • All three promote workflows: after the delete step, stage deletion events into graph-events-del and upload as graph-events-del*. The generic record-graph-events collector (pattern: graph-events*, merge-multiple) commits them unchanged. (Added id: delete to the override workflow's delete step.)

Validation

  • shellcheck clean on both action scripts.
  • End-to-end mocked test of delete-image: deleted-json correctly lists the deleted referrer + the tagged image.
  • stage-deletion-events mocked run: emits schema-valid ArtifactDeleted events (referrer + tagged image) with matching content ids.
  • actionlint clean for the new steps (pre-existing info/style warnings in untouched jobs remain).
  • Docs updated (event table + delete-image outputs).

Closes #199

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
Copilot AI lite review requested due to automatic review settings August 14, 2026 03:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-image to output deleted-json (a JSON array of removed {digest, tag?} entries) for downstream event staging.
  • Add a new composite action stage-deletion-events that converts deleted-json into schema-aligned ArtifactDeleted event files (content-id compatible with cssc_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.

Comment thread .github/actions/delete-image/action.yml
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.
@toddysm
toddysm merged commit 373e114 into main Aug 14, 2026
3 checks passed
@toddysm
toddysm deleted the feat/graph-events-deletions branch August 14, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emit supply-chain-graph events for all artifacts (image + referrers) and deletions

2 participants