Commit f506949
authored
Add workflow to refresh jsonschema_for_docs.json after each release (#5200)
## Summary
- New `.github/workflows/update-schema-docs.yml` triggers on `v*` tag
pushes (and manual `workflow_dispatch`, which auto-detects the latest
`v*` tag).
- Regenerates `bundle/schema/jsonschema_for_docs.json` from `main` (full
tag history is required so `since_version.go` can stamp
`x-since-version`), asserts only that file changed, and pushes the
result to the dedicated `docgen` branch. `main` is never modified.
- `docgen` was bootstrapped as an orphan branch containing only
`README.md`; the workflow adds `bundle/schema/jsonschema_for_docs.json`
and updates it on every release.
## Why
`bundle/internal/schema/since_version.go` derives `x-since-version` from
`git tag --list 'v*'` at generation time, so the committed file becomes
stale the moment the next tag is pushed. This workflow keeps a clean
publish branch (`docgen`) current automatically, decoupled from main.
## End-to-end test
Triggered the workflow via a temporary branch trigger, verified the file
landed on `docgen` with up-to-date since-versions:
```
$ curl -sfL https://raw.githubusercontent.com/databricks/cli/docgen/bundle/schema/jsonschema_for_docs.json \
| grep -o '"x-since-version": *"v[^"]*"' | sort | uniq -c | sort -rn | head -5
631 "x-since-version": "v0.229.0"
54 "x-since-version": "v0.298.0"
46 "x-since-version": "v0.287.0"
46 "x-since-version": "v0.279.0"
31 "x-since-version": "v0.260.0"
```
Subsequent run (no schema change) correctly logs `docgen already up to
date for v0.299.0; nothing to commit.`1 parent 547f2c7 commit f506949
1 file changed
Lines changed: 121 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
0 commit comments