-
Notifications
You must be signed in to change notification settings - Fork 82
feat: add human-readable JSON companions for XDR event fixtures and CI review gate #442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Christopherdominic
merged 2 commits into
Bonizozo:main
from
darcszn:feat/xdr-fixture-json-companions
Aug 24, 2026
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: Fixture Review Gate | ||
|
|
||
| # This workflow triggers on any PR that touches an XDR or JSON event-fixture | ||
| # file under contracts/tipjar/tests/fixtures/. Its sole job is to ensure that | ||
| # the PR body contains an explicit reviewer acknowledgment before the PR can | ||
| # be merged. | ||
| # | ||
| # Why this exists: | ||
| # Binary XDR golden files are not human-readable in a standard `git diff`. | ||
| # The companion .json files decode the same payload into a reviewable form, | ||
| # but only if someone actually looks at them. This gate makes that look | ||
| # mandatory — the CI check goes red until the PR body contains a checked | ||
| # checkbox from the fixture review section of the PR template. | ||
| # | ||
| # To pass this check: | ||
| # 1. Review the diff of every changed .json companion file. | ||
| # 2. Tick the appropriate checkbox in the "Fixture diff review" section of | ||
| # the PR description (see .github/pull_request_template.md). | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main, develop] | ||
| paths: | ||
| - 'contracts/tipjar/tests/fixtures/*.xdr' | ||
| - 'contracts/tipjar/tests/fixtures/*.json' | ||
| - '.github/workflows/fixture-review.yml' | ||
|
|
||
| jobs: | ||
| require-fixture-review-acknowledgment: | ||
| name: Require fixture-diff review acknowledgment | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check PR body for fixture review checkbox | ||
| env: | ||
| PR_BODY: ${{ github.event.pull_request.body }} | ||
| run: | | ||
| set -eu | ||
|
|
||
| # Accept either of these checked-box patterns: | ||
| # [x] Fixture files changed, and the JSON companion diff was reviewed. | ||
| # [X] No fixture files changed in this PR. | ||
| # The second option is included so a PR that only touches | ||
| # fixture-review.yml itself (workflow change, no fixture diff) can | ||
| # still pass by ticking the "no fixtures changed" box. | ||
| if printf '%s\n' "$PR_BODY" | grep -Eiq '\[[xX]\].*(fixture|no fixture)'; then | ||
|
Christopherdominic marked this conversation as resolved.
|
||
| echo "Fixture review acknowledgment found. ✓" | ||
| exit 0 | ||
| fi | ||
|
|
||
| cat <<'MSG' | ||
| ────────────────────────────────────────────────────────────────────── | ||
| FIXTURE REVIEW GATE FAILED | ||
| ────────────────────────────────────────────────────────────────────── | ||
| This PR modifies one or more XDR or JSON fixture files under | ||
| contracts/tipjar/tests/fixtures/ | ||
|
|
||
| Those files are golden event-schema fixtures. The companion .json | ||
| files exist precisely so that reviewers can see "the token field | ||
| moved from position 2 to position 3" in a readable diff, rather than | ||
| staring at an opaque binary blob. | ||
|
|
||
| Before this PR can be merged: | ||
| 1. Open the "Fixture diff review" section of the PR description. | ||
| 2. Review every changed .json file in the PR diff. | ||
| 3. Tick the checkbox that describes what changed and confirm you | ||
| reviewed it. | ||
|
|
||
| See CONTRIBUTING.md § "Event fixture golden files" for the full | ||
| process, including how to regenerate fixtures with UPDATE_FIXTURES=1. | ||
| ────────────────────────────────────────────────────────────────────── | ||
| MSG | ||
| exit 1 | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.