Skip to content

record-graph-events: sync schema/sources to the data branch (fixes #203) - #206

Merged
toddysm merged 2 commits into
mainfrom
fix/collector-sync-schema
Aug 15, 2026
Merged

record-graph-events: sync schema/sources to the data branch (fixes #203)#206
toddysm merged 2 commits into
mainfrom
fix/collector-sync-schema

Conversation

@toddysm

@toddysm toddysm commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Fixes #203.

Problem

The record-graph-events collector appended event files to supply-chain-graph-data but never updated that branch's schema/. So after a new event kind ships (e.g. ReferrerObserved, ArtifactDeleted), the branch's stale schema rejects the events — cssc-graph index <branch> and graph-service (whose SCHEMA_DIR defaults to <DATA_ROOT>/schema) both fail with unknown kind. Confirmed against the live data branch (9 ReferrerObserved events currently un-indexable without a manual --schema-dir).

Fix

Keep the data branch a valid, self-contained data root:

  • Snapshot the producing commit's supply-chain-graph/schema/ + sources.yaml before the checkout that switches the working tree to the data branch.
  • After switching, refresh schema/ + sources.yaml on the branch from the snapshot and git add them.
  • Commit now fires on new events OR a schema change; idempotent when the schema is unchanged (identical content stages no diff).

Validation

  • actionlint + shellcheck clean.
  • Simulated the full git flow locally (bare origin + data branch): the branch's schema advanced v1→v2 (new kind schema present) alongside the recorded event.

Follow-ups (filed)

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

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 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/ and supply-chain-graph/sources.yaml before switching the working tree to the data branch.
  • After switching to supply-chain-graph-data, refresh schema/ and sources.yaml from 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.

Comment thread .github/workflows/record-graph-events.yml Outdated
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.
@toddysm
toddysm merged commit 479bf4e into main Aug 15, 2026
3 checks passed
@toddysm
toddysm deleted the fix/collector-sync-schema branch August 15, 2026 02:22
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.

Collector must sync schema/ to the supply-chain-graph-data branch (new event kinds fail to index)

2 participants