record-graph-events: sync schema/sources to the data branch (fixes #203) - #206
Merged
Conversation
The collector only appended event files, so the data branch's schema/ went stale and newly introduced event kinds (ReferrerObserved, ArtifactDeleted) failed to index — both via cssc-graph and graph-service (SCHEMA_DIR defaults to <DATA_ROOT>/schema). Snapshot the producing commit's schema/ + sources.yaml before switching to the data branch, then refresh them there so the branch stays a valid, self-contained data root. Idempotent: an unchanged schema stages no diff; the commit now fires on new events OR a schema change. Fixes #203
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the record-graph-events GitHub Actions workflow so the supply-chain-graph-data branch remains a self-contained data root by keeping supply-chain-graph/schema/ and supply-chain-graph/sources.yaml in sync with the code that produced the recorded events, preventing indexing failures due to stale schemas.
Changes:
- Snapshot
supply-chain-graph/schema/andsupply-chain-graph/sources.yamlbefore switching the working tree to the data branch. - After switching to
supply-chain-graph-data, refreshschema/andsources.yamlfrom the snapshot and stage them. - Update the “no-op” condition/message so schema-only updates can still be committed even when no new event files are added.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot review: the comment said 'producing commit' but the checkout is the default branch's latest commit. Reword to state we intentionally sync the latest schema — additive evolution means the newest schema validates the whole accumulated ledger.
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.
Fixes #203.
Problem
The
record-graph-eventscollector appended event files tosupply-chain-graph-databut never updated that branch'sschema/. So after a new event kind ships (e.g.ReferrerObserved,ArtifactDeleted), the branch's stale schema rejects the events —cssc-graph index <branch>andgraph-service(whoseSCHEMA_DIRdefaults to<DATA_ROOT>/schema) both fail withunknown kind. Confirmed against the live data branch (9ReferrerObservedevents currently un-indexable without a manual--schema-dir).Fix
Keep the data branch a valid, self-contained data root:
supply-chain-graph/schema/+sources.yamlbefore the checkout that switches the working tree to the data branch.schema/+sources.yamlon the branch from the snapshot andgit addthem.Validation
actionlint+shellcheckclean.Follow-ups (filed)