Skip to content

demo: add alter_job entry showing name without _stmt suffix#48

Open
ebembi-crdb wants to merge 2 commits into
masterfrom
demo/alter-job-stmt-suffix
Open

demo: add alter_job entry showing name without _stmt suffix#48
ebembi-crdb wants to merge 2 commits into
masterfrom
demo/alter-job-stmt-suffix

Conversation

@ebembi-crdb
Copy link
Copy Markdown
Owner

What this demonstrates

The correct _stmt suffix scenario:

  • name: "alter_job" — no _stmt suffix; this becomes the BNF/HTML filename
  • stmt: "alter_job_stmt" — the grammar rule name in sql.y

The BZL files previously had alter_job_stmt entries (the pre-existing state before this diagrams.go entry was added). This PR renames them to alter_job — not adds a second entry alongside them.

File Change
diagrams.go Added stmtSpec{name: "alter_job", stmt: "alter_job_stmt"}
BUILD.bazel "alter_job_stmt""alter_job" in FILES
bnf.bzl alter_job_stmt.bnfalter_job.bnf
docs.bzl alter_job_stmt.bnfalter_job.bnf
diagrams.bzl No change — svg genrule already strips _stmt, so alter_job.html was already present

ebembi-crdb and others added 2 commits February 24, 2026 19:47
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
@github-actions
Copy link
Copy Markdown

SQL Diagram Generation Report

Validation Passed

🔄 Diagram changes detected
A PR has been opened to sync these changes: ebembi-crdb/generated-diagrams#24

SKIP DOC Warnings (click to expand)

The following grammar rules are suppressed from documentation:

The following grammar rules are suppressed with SKIP DOC:
1986:| alter_virtual_cluster_stmt   /* SKIP DOC */
2579:    /* SKIP DOC */
2591:    /* SKIP DOC */
2716:    /* SKIP DOC */
2733:    /* SKIP DOC */
3044:    /* SKIP DOC */
3050:    /* SKIP DOC */
3102:    /* SKIP DOC */
3110:    /* SKIP DOC */
3262:  SET CYCLE                        { /* SKIP DOC */
3643:    /* SKIP DOC */
3664:  INCLUDE_ALL_SECONDARY_TENANTS { /* SKIP DOC */ }
4245:  TENANT  { /* SKIP DOC */ }
4249:  TENANT_NAME { /* SKIP DOC */ }
4840:    /* SKIP DOC */
4983:  /* SKIP DOC */
5022:    /* SKIP DOC */
5029:    /* SKIP DOC */
5037:    /* SKIP DOC */
5047:    /* SKIP DOC */
5059:  TENANT { /* SKIP DOC */ }
6251:    /* SKIP DOC */
6289:    /* SKIP DOC */
6366:    /* SKIP DOC */
6489:    /* SKIP DOC */
6775:   /* SKIP DOC */
6784:    /* SKIP DOC */
7206:    /* SKIP DOC */
7217:    /* SKIP DOC */
7222:    /* SKIP DOC */
7227:    /* SKIP DOC */
7246:    /* SKIP DOC */
7251:    /* SKIP DOC */
7258:    /* SKIP DOC */
7263:    /* SKIP DOC */
7268:    /* SKIP DOC */
7273:    /* SKIP DOC */
7280:    /* SKIP DOC */
7287:    /* SKIP DOC */
7302:		/* SKIP DOC */
7312:    /* SKIP DOC */
7317:    /* SKIP DOC */
7324:    /* SKIP DOC */
7343:    /* SKIP DOC */
7376:    /* SKIP DOC */
7834:| set_exprs_internal   { /* SKIP DOC */ }
8139:    /* SKIP DOC */
8168:    /* SKIP DOC */
8269:    /* SKIP DOC */
8278:    /* SKIP DOC */
8287:    /* SKIP DOC */
8347:    /* SKIP DOC */
8354:    /* SKIP DOC */
8364:    /* SKIP DOC */
8369:    /* SKIP DOC */
8394:    /* SKIP DOC */
8400:    /* SKIP DOC */
8477:    /* SKIP DOC */
8485:    /* SKIP DOC */
8490:		/* SKIP DOC */
8499:    /* SKIP DOC */
8520:    /* SKIP DOC */
8525:    /* SKIP DOC */
8934:    /* SKIP DOC */
8939:    /* SKIP DOC */
8944:    /* SKIP DOC */
8949:    /* SKIP DOC */
8954:    /* SKIP DOC */
8985:| TRACING { /* SKIP DOC */ }
8988:    /* SKIP DOC */
9030:    /* SKIP DOC */
9051:    /* SKIP DOC */
9104:    /* SKIP DOC */
9110:    /* SKIP DOC */
9116:		/* SKIP DOC */
9122:		/* SKIP DOC */
9139:    /* SKIP DOC */
9144:    /* SKIP DOC */
9149:    /* SKIP DOC */
9195: /* SKIP DOC */
9291:    /* SKIP DOC */
9296:    /* SKIP DOC */
9795:    /* SKIP DOC */
9960:    /* SKIP DOC */
9968:    /* SKIP DOC */
9981:    /* SKIP DOC */
9991:   /* SKIP DOC */
10024:    /* SKIP DOC */
10029:    /* SKIP DOC */
10034:    /* SKIP DOC */
10074:    /* SKIP DOC */
10083:    /* SKIP DOC */
10092:    /* SKIP DOC */
10097:    /* SKIP DOC */
10102:    /* SKIP DOC */
10107:    /* SKIP DOC */
10112:    /* SKIP DOC */
10121:    /* SKIP DOC */
10131:    /* SKIP DOC */
10307:| for_with_lookahead_variants { /* SKIP DOC */ }
10314:| FOR_JOB { /* SKIP DOC */ }
10509:    /* SKIP DOC */
10518:    /* SKIP DOC */
10883:    /* SKIP DOC */
10892:    /* SKIP DOC */
11201:    /* SKIP DOC */
11217:    /* SKIP DOC */
11307:| WITH DATA    { /* SKIP DOC */ /* This is the default */ }
11698:    /* SKIP DOC */
12205:| CYCLE                        { /* SKIP DOC */
12261:    /* SKIP DOC */
12342:    /* SKIP DOC */
12365:    /* SKIP DOC */
12643:    /* SKIP DOC */
12649:    /* SKIP DOC */
12654:    /* SKIP DOC */
12659:    /* SKIP DOC */
13683:| abort_stmt               /* SKIP DOC */
14013:    /* SKIP DOC */
14028:    /* SKIP DOC */
14174:    /* SKIP DOC */
14675:    /* SKIP DOC */
15098:    /* SKIP DOC */
15103:    /* SKIP DOC */
15108:    /* SKIP DOC */
15130:    /* SKIP DOC */
15135:    /* SKIP DOC */
15148:    /* SKIP DOC */
15153:    /* SKIP DOC */
15228:    /* SKIP DOC */
15314:    /* SKIP DOC */
15643:    /* SKIP DOC */
15715:    /* SKIP DOC */
15744:    /* SKIP DOC */

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
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.

1 participant