Skip to content

Commit b1aff40

Browse files
authored
Merge branch 'main' into unlink-release-download-pages
2 parents 640d62d + eadc3ca commit b1aff40

2,470 files changed

Lines changed: 205440 additions & 15099 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/validate_branch_existence.py

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
GENERATED_DIAGRAMS_REPO = "cockroachdb/generated-diagrams"
4141
GITHUB_API_BASE = "https://api.github.com"
4242
VERSIONS_CSV = Path("src/current/_data/versions.csv")
43+
DOCS_ROOT = Path("src/current")
4344

4445
# ---------------------------------------------------------------------------
4546
# HTTP
@@ -69,6 +70,17 @@ def _api_get(path: str) -> dict | None:
6970
# Core logic
7071
# ---------------------------------------------------------------------------
7172

73+
def has_docs_folder(version: str) -> bool:
74+
"""Return True if a docs folder exists for this version.
75+
76+
Handles both naming conventions: v20_1 (underscore) and v23.1 (dot).
77+
"""
78+
ver = version.lstrip("v")
79+
dot_form = DOCS_ROOT / f"v{ver}"
80+
underscore_form = DOCS_ROOT / f"v{ver.replace('.', '_')}"
81+
return dot_form.is_dir() or underscore_form.is_dir()
82+
83+
7284
_cache: dict[str, bool] = {}
7385

7486

@@ -88,13 +100,16 @@ def load_versions_csv() -> list[dict]:
88100
return list(csv.DictReader(f))
89101

90102

91-
def run_checks(rows: list[dict], _exists_fn=None) -> list[dict]:
103+
def run_checks(rows: list[dict], _exists_fn=None, _has_docs_fn=None) -> list[dict]:
92104
"""Check each versions.csv row for branch existence and staleness.
93105
94106
_exists_fn is injectable for unit tests; defaults to branch_exists.
107+
_has_docs_fn is injectable for unit tests; defaults to has_docs_folder.
95108
"""
96109
if _exists_fn is None:
97110
_exists_fn = branch_exists
111+
if _has_docs_fn is None:
112+
_has_docs_fn = has_docs_folder
98113

99114
failures = []
100115
checked: set[str] = set()
@@ -105,6 +120,11 @@ def run_checks(rows: list[dict], _exists_fn=None) -> list[dict]:
105120
if not branch or branch == "N/A":
106121
continue
107122

123+
# Skip versions that have been archived from the site.
124+
if not _has_docs_fn(version):
125+
print(f" {version:8s}{branch} ... SKIP (archived)")
126+
continue
127+
108128
# (a) Does the listed branch exist?
109129
if branch not in checked:
110130
checked.add(branch)
@@ -179,9 +199,11 @@ def format_comment(failures: list[dict]) -> str:
179199
def _run_self_tests() -> None:
180200
"""Unit tests for run_checks logic using injected exists functions."""
181201

182-
def _quiet(rows, exists_fn):
202+
_no_call = lambda b: (_ for _ in ()).throw(AssertionError("unexpected call"))
203+
204+
def _quiet(rows, exists_fn, has_docs_fn=lambda v: True):
183205
with contextlib.redirect_stdout(io.StringIO()):
184-
return run_checks(rows, _exists_fn=exists_fn)
206+
return run_checks(rows, _exists_fn=exists_fn, _has_docs_fn=has_docs_fn)
185207

186208
# branch_missing: listed branch does not exist
187209
rows = [{"major_version": "v26.1", "crdb_branch_name": "release-26.1"}]
@@ -204,14 +226,25 @@ def _quiet(rows, exists_fn):
204226

205227
# N/A entries are skipped entirely
206228
rows = [{"major_version": "v24.1", "crdb_branch_name": "N/A"}]
207-
failures = _quiet(rows, lambda b: (_ for _ in ()).throw(AssertionError("unexpected call")))
229+
failures = _quiet(rows, _no_call)
208230
assert failures == [], failures
209231

210232
# empty branch field is skipped
211233
rows = [{"major_version": "v25.1", "crdb_branch_name": ""}]
212-
failures = _quiet(rows, lambda b: (_ for _ in ()).throw(AssertionError("unexpected call")))
234+
failures = _quiet(rows, _no_call)
213235
assert failures == [], failures
214236

237+
# archived versions (no docs folder) are skipped
238+
rows = [{"major_version": "v1.0", "crdb_branch_name": "release-1.0"}]
239+
failures = _quiet(rows, _no_call, has_docs_fn=lambda v: False)
240+
assert failures == [], failures
241+
242+
# non-archived version with missing branch still fails
243+
rows = [{"major_version": "v26.1", "crdb_branch_name": "release-26.1"}]
244+
failures = _quiet(rows, lambda b: False, has_docs_fn=lambda v: True)
245+
assert len(failures) == 1, failures
246+
assert failures[0]["type"] == "branch_missing", failures
247+
215248
print("All self-tests passed.")
216249
sys.exit(0)
217250

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Notify Slack on Doc Review Request
2+
3+
on:
4+
pull_request:
5+
types: [review_requested]
6+
7+
jobs:
8+
notify-slack:
9+
# Only run if docs-prs team was requested as reviewer
10+
if: github.event.requested_team.slug == 'docs-prs'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Send Slack notification
14+
env:
15+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DOC_REVIEW_WEBHOOK_URL }}
16+
PR_TITLE: ${{ github.event.pull_request.title }}
17+
PR_URL: ${{ github.event.pull_request.html_url }}
18+
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
19+
PR_NUMBER: ${{ github.event.pull_request.number }}
20+
LINES_CHANGED: ${{ github.event.pull_request.additions + github.event.pull_request.deletions }}
21+
run: |
22+
jq -n \
23+
--arg title "$PR_TITLE" \
24+
--arg url "$PR_URL" \
25+
--arg author "$PR_AUTHOR" \
26+
--arg number "$PR_NUMBER" \
27+
--arg lines "$LINES_CHANGED" \
28+
'{pr_title: $title, pr_url: $url, pr_author: $author, pr_number: $number, lines_changed: $lines}' \
29+
| curl -X POST "$SLACK_WEBHOOK_URL" \
30+
-H 'Content-Type: application/json' \
31+
--fail-with-body \
32+
-d @-

src/current/_data/releases.yml

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11397,12 +11397,6 @@
1139711397
docker_arm_limited_access: false
1139811398
source: true
1139911399
previous_release: v26.2.0-rc.1
11400-
cloud_only: true
11401-
cloud_only_message_short: 'Available only for select CockroachDB Cloud clusters'
11402-
cloud_only_message: >
11403-
This version is currently available only for select
11404-
CockroachDB Cloud clusters. Binaries for self-hosted clusters will be available
11405-
approximately 2 weeks after Cloud availability.
1140611400

1140711401

1140811402
- release_name: v26.1.4
@@ -11543,3 +11537,66 @@
1154311537
docker_arm_limited_access: false
1154411538
source: true
1154511539
previous_release: v24.1.28
11540+
11541+
11542+
- release_name: v26.2.1
11543+
major_version: v26.2
11544+
release_date: '2026-05-22'
11545+
release_type: Production
11546+
go_version: go1.26.2
11547+
sha: b398a6e1fde74a915daf8e9841303c8ee39c2abe
11548+
has_sql_only: true
11549+
has_sha256sum: true
11550+
mac:
11551+
mac_arm: true
11552+
mac_arm_experimental: true
11553+
mac_arm_limited_access: false
11554+
windows: true
11555+
linux:
11556+
linux_arm: true
11557+
linux_arm_experimental: false
11558+
linux_arm_limited_access: false
11559+
linux_intel_fips: true
11560+
linux_arm_fips: false
11561+
docker:
11562+
docker_image: cockroachdb/cockroach
11563+
docker_arm: true
11564+
docker_arm_experimental: false
11565+
docker_arm_limited_access: false
11566+
source: true
11567+
previous_release: v26.2.0
11568+
cloud_only: true
11569+
cloud_only_message_short: 'Available only for select CockroachDB Cloud clusters'
11570+
cloud_only_message: >
11571+
This version is currently available only for select
11572+
CockroachDB Cloud clusters. To request to upgrade
11573+
a CockroachDB self-hosted cluster to this version,
11574+
[contact support](https://support.cockroachlabs.com/hc/requests/new).
11575+
11576+
11577+
- release_name: v24.3.33
11578+
major_version: v24.3
11579+
release_date: '2026-05-25'
11580+
release_type: Production
11581+
go_version: go1.26.2
11582+
sha: 4553626be4d29aff5517b42da4113363d64bc030
11583+
has_sql_only: true
11584+
has_sha256sum: true
11585+
mac:
11586+
mac_arm: true
11587+
mac_arm_experimental: true
11588+
mac_arm_limited_access: false
11589+
windows: true
11590+
linux:
11591+
linux_arm: true
11592+
linux_arm_experimental: false
11593+
linux_arm_limited_access: false
11594+
linux_intel_fips: true
11595+
linux_arm_fips: false
11596+
docker:
11597+
docker_image: cockroachdb/cockroach
11598+
docker_arm: true
11599+
docker_arm_experimental: false
11600+
docker_arm_limited_access: false
11601+
source: true
11602+
previous_release: v24.3.32

0 commit comments

Comments
 (0)