Add branch existence check for generated-diagrams (EDUENG-614)#23137
Open
ebembi-crdb wants to merge 1 commit intomainfrom
Open
Add branch existence check for generated-diagrams (EDUENG-614)#23137ebembi-crdb wants to merge 1 commit intomainfrom
ebembi-crdb wants to merge 1 commit intomainfrom
Conversation
Adds a script and daily workflow that verify every crdb_branch_name entry in versions.csv exists as a branch in cockroachdb/generated-diagrams, and flags entries where a proper release-X.Y branch now exists but versions.csv still points to an older one (e.g. v26.2 -> release-26.1 after release-26.2 is created). Files added: - .github/scripts/validate_branch_existence.py - .github/workflows/validate-branch-existence.yml
Files changed:
|
✅ Deploy Preview for cockroachdb-interactivetutorials-docs canceled.
|
✅ Deploy Preview for cockroachdb-api-docs canceled.
|
3 tasks
✅ Netlify Preview
To edit notification comments on pull requests, go to your Netlify project configuration. |
mohini-crl
requested changes
Mar 27, 2026
| @@ -0,0 +1,189 @@ | |||
| #!/usr/bin/env python3 | |||
| """ | |||
Contributor
There was a problem hiding this comment.
Did we check the teamcity job ? How it's gonna affect if we have both the flows? As that teamcity job is still active?
|
|
||
| def branch_exists(branch: str) -> bool: | ||
| if branch not in _cache: | ||
| result = _api_get(f"repos/{GENERATED_DIAGRAMS_REPO}/branches/{branch}") |
Contributor
There was a problem hiding this comment.
The code calls the API path /repos/{repo}/branches/{branch} with branch interpolated directly. If a branch name ever contains characters that require URL-encoding it would be safer to encode the branch name
| # --------------------------------------------------------------------------- | ||
| # Output | ||
| # --------------------------------------------------------------------------- | ||
|
|
Contributor
There was a problem hiding this comment.
The PR includes a manual test plan — consider adding a lightweight unit test (or an integration mode that runs against a small sample versions.csv) to make local iteration faster.
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.
Summary
Adds a script and daily GitHub Actions workflow to verify that every
crdb_branch_nameentry inversions.csvexists as a branch incockroachdb/generated-diagrams.Two failure modes caught:
branch_missing: the listed branch does not exist ingenerated-diagramsat allbranch_mismatch: a properrelease-X.Ybranch now exists ingenerated-diagramsbutversions.csvstill points to an older one (e.g.v26.2→release-26.1afterrelease-26.2is created)Files added:
.github/scripts/validate_branch_existence.py— stdlib-only Python script, no pip installs required.github/workflows/validate-branch-existence.yml— triggers onversions.csvchanges in PRs and runs daily at 07:00 UTCOn PR failure: posts/updates a bot comment with details and blocks merge.
On scheduled failure: opens a GitHub issue (or updates an existing open one) with label
sql-diagram-validation.Context
Addresses EDUENG-614, part of the follow-up to the production build outage on 2026-01-29 discussed in #docs-site-status.
The anchor integrity check (EDUENG-613) is in a separate PR.
Test plan
python .github/scripts/validate_branch_existence.pyfrom repo root and confirm it exits 0versions.csvchange in a test PR