demo: add alter_job entry showing name without _stmt suffix#48
Open
ebembi-crdb wants to merge 2 commits into
Open
demo: add alter_job entry showing name without _stmt suffix#48ebembi-crdb wants to merge 2 commits into
ebembi-crdb wants to merge 2 commits into
Conversation
Demonstrates the correct scenario: diagrams.go uses name: "alter_job"
(no _stmt suffix) with stmt: "alter_job_stmt" (the grammar rule name).
The BZL files previously had "alter_job_stmt" entries; they are renamed
here to "alter_job" to match what docgen generates as the output filename.
This is the rename-not-add pattern the automation must apply.
- diagrams.go: new stmtSpec{name: "alter_job", stmt: "alter_job_stmt"}
- BUILD.bazel: "alter_job_stmt" → "alter_job" in FILES list
- bnf.bzl: alter_job_stmt.bnf → alter_job.bnf
- docs.bzl: alter_job_stmt.bnf → alter_job.bnf
- diagrams.bzl: no change needed (svg genrule already strips _stmt,
so alter_job.html was already present)
Release note: None
SQL Diagram Generation Report✅ Validation Passed 🔄 Diagram changes detected SKIP DOC Warnings (click to expand)The following grammar rules are suppressed from documentation: This comment was generated by the SQL Diagram CI workflow. |
ebembi-crdb
pushed a commit
that referenced
this pull request
Feb 24, 2026
…gram update Add a diagrams.go entry for create_policy_stmt using name "create_policy" (without the _stmt suffix) and inline the four opt_ sub-rules: opt_policy_type, opt_policy_command, opt_policy_roles, opt_policy_exprs. This demo directly addresses Ryan's two feedback points: 1. BNF files missing: fixed by merged PRs #45 and #47. The CI now runs docgen directly (not via bazel run) and packages .bnf files correctly. alter_job.bnf in the generated-diagrams PR from demo #48 confirms this. 2. HTML content unchanged: the alter_job demo used a grammar simple enough that the diagrams.go entry produced identical HTML, so no diff was detected and no PNG was generated. create_policy_stmt is different: diagrams.bzl already has create_policy.html (generated without any inlining), so the four sub-rules appear as opaque reference boxes. Adding the inline list expands those sub-rules directly into the BNF, changing the HTML content. CI detects the diff, sets has_changes=true, generates a PNG preview, and posts it in the PR comment. Bazel file changes: - docs/generated/sql/bnf/BUILD.bazel: create_policy_stmt -> create_policy - pkg/gen/bnf.bzl: create_policy_stmt.bnf -> create_policy.bnf - pkg/gen/docs.bzl: create_policy_stmt.bnf -> create_policy.bnf - pkg/gen/diagrams.bzl: already has create_policy.html, no change needed Release note: None
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.
What this demonstrates
The correct
_stmtsuffix scenario:name: "alter_job"— no_stmtsuffix; this becomes the BNF/HTML filenamestmt: "alter_job_stmt"— the grammar rule name insql.yThe BZL files previously had
alter_job_stmtentries (the pre-existing state before thisdiagrams.goentry was added). This PR renames them toalter_job— not adds a second entry alongside them.diagrams.gostmtSpec{name: "alter_job", stmt: "alter_job_stmt"}BUILD.bazel"alter_job_stmt"→"alter_job"inFILESbnf.bzlalter_job_stmt.bnf→alter_job.bnfdocs.bzlalter_job_stmt.bnf→alter_job.bnfdiagrams.bzl_stmt, soalter_job.htmlwas already present