Commit 64c5024
ebembi-crdb
demo: add create_policy entry showing name/stmt suffix and inline diagram 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: None1 parent 5011a32 commit 64c5024
4 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
831 | 831 | | |
832 | 832 | | |
833 | 833 | | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
834 | 844 | | |
835 | 845 | | |
836 | 846 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
0 commit comments