Repository navigation
Check that syntax cases match their receipts on every pull request - #45
Merged
Merged
Conversation
A cases file built before its receipts were recorded merged twice and was caught only when SQLBabel pinned it. The check rebuilds each touched dialect's cases with SQLBabel's builder, at main or at the commit a Builder line names, and fails on any difference.
Contributor
Author
|
Independent review at 463224b: changes requested, one finding. The rest holds. Finding: the Builder line accepts any commit, so the check can be satisfied by an unreviewed builder (
What holds
Note: the check guards only what the evidence PR ships. The SQLBabel PR that pins it still runs its own |
actions/checkout fetches any commit by SHA, including one reachable only through a pull request ref, so a Builder line could name an unreviewed builder. The check now fetches SQLBabel's branches and fails unless one contains the builder.
Contributor
Author
|
Fixes-only check at 765a5a0: the Builder restriction is fixed. One stray file needs removing before merge.
|
Contributor
Author
|
Correction to my last comment: the repository does have a |
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.
Why
A cases file built before its receipts were recorded merged twice (#40, and the session 4 commit fixed by #41). Each was caught only when SQLBabel pinned the evidence and its dialect-case check failed.
Changes
.github/workflows/cases-fresh.yml: theCases match their receiptscheck runs on every pull request. It passes at once when nosyntax/<dialect>/changes, so it can be a required check without holding up other pull requests..github/scripts/cases_fresh.py: lists the touched dialects and resolves the SQLBabel builder commit: aBuilder: <40-character SHA>line in the body, or else SQLBabel main's head. It prints the resolved SHA and rejects a branch name or a second Builder line. SQLBabel is checked out with its branches, and the check fails unless a branch contains the builder, so a commit reachable only through a pull request ref cannot be named. It then runs that commit's builder with--checkagainst the pull request's evidence:build_syntax_casesfor Snowflake (families from SQLBabel's Makefile), andbuild_syntax_obligations_<dialect>for each dialect inDIALECT_CASE_DIALECTS. A dialect with no builder fails.README.md: how the check works and when to name a Builder.Verification
Scratch pull request (since deleted) with #40's lambda case and
Builder: 0a8edcc72e937c074e7d1569f456e9e6b0a01f14:syntax/passed at once: https://github.com/sqlstack-io/sqlbabel-evidence/actions/runs/47656985185build_syntax_cases --checkthrough the script passes against the pinned Snowflake evidence. The plan step resolves main's SHA, takes a full SHA, and rejects a branch name and two Builder lines.