Skip to content

Commit 6196222

Browse files
authored
ci: end of maintenance (EOM) for TiDB v7.1 — remove labels and branch protection (#1284)
1 parent 49c9b0f commit 6196222

5 files changed

Lines changed: 227 additions & 118 deletions

File tree

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
name: tidb-eol-cleanup
3+
description: Perform end-of-maintenance (EOM) cleanup for a TiDB LTS version (X.Y) — remove version labels, drop branch protection rules, and update blocker configs across prow configs.
4+
---
5+
6+
# TiDB Version End-of-Maintenance (EOM) Cleanup
7+
8+
Use this skill when a TiDB LTS version reaches end-of-maintenance (EOM). Replace `X.Y` with the actual version number (e.g., `7.1`). Note: this is EOM, not EOL — the version is no longer under maintenance support but the code is not deleted.
9+
10+
## Files Modified
11+
12+
All paths are relative to `prow/config/`:
13+
14+
| File | Changes |
15+
|------|---------|
16+
| `external_plugins_config.yaml` | Issue triage, label plugin, label blocker |
17+
| `labels.yaml` | Remove version-specific label definitions |
18+
| `labels.md` | Regenerated via script |
19+
| `config.yaml` | Branch protection rules (branch-protection section only) |
20+
21+
## Step 1: `external_plugins_config.yaml`
22+
23+
### 1a. Remove `X.Y` from `ti-community-issue-triage` `maintain_versions`
24+
25+
```yaml
26+
# Before:
27+
maintain_versions: ["X.Y", "7.5", "8.1", "8.5"]
28+
# After:
29+
maintain_versions: ["7.5", "8.1", "8.5"]
30+
```
31+
32+
### 1b. Remove version labels from `ti-community-label` `additional_labels`
33+
34+
Search for and remove these labels from ALL `additional_labels` lists under `ti-community-label`:
35+
36+
- `needs-cherry-pick-release-X.Y`
37+
- `affects-X.Y`
38+
- `may-affects-X.Y`
39+
40+
These are quoted or unquoted depending on the list. Remove each occurrence line, leaving any `# - affects-{{.ver}}` comments in place. Expect ~18 occurrences across ~8 repo groups.
41+
42+
Also remove `type/cherry-pick-for-release-X.Y` from the global `cherryPickerExcludeLabels` and `cherryPickerExcludeLabelsWithoutLgtm` lists.
43+
44+
### 1c. Add `X.Y` to `ti-community-label-blocker`
45+
46+
Add a blocking rule at the top of `block_labels` for the `pingcap`/`tikv`/`pingcap-inc`/`PingCAP-QE` orgs group:
47+
48+
```yaml
49+
- regex: ^(may-)?affects-X\.Y$
50+
actions:
51+
- labeled
52+
- unlabeled
53+
trusted_users:
54+
- ti-chi-bot
55+
- ti-chi-bot[bot]
56+
message: "You cannot manually add or delete the affects/may-affects version labels, only I and the trusted members have permission to do so."
57+
```
58+
59+
## Step 2: `labels.yaml`
60+
61+
Remove these label definitions from the default labels section:
62+
63+
- `needs-cherry-pick-release-X.Y` (4 lines: name, color, description, target)
64+
- `affects-X.Y` (4 lines: name, color, description, target)
65+
- `type/cherry-pick-for-release-X.Y` (8 lines: name, color, description, target, prowPlugin, isExternalPlugin, addedBy)
66+
67+
After editing, regenerate `labels.md`:
68+
69+
```bash
70+
cd configs
71+
bash scripts/update-labels.sh
72+
```
73+
74+
## Step 3: `config.yaml` — Branch Protection
75+
76+
Remove all `release-X.Y` and older branches from the **branch-protection** section only (do NOT touch the `tide:` section).
77+
78+
### Branches to remove
79+
80+
All `release-M.N` where `M.N <= X.Y` in TiDB version numbering. Keep:
81+
- `release-1.x`, `release-2.x` for tidb-operator/tispark (different product versioning)
82+
- Anything above `X.Y`
83+
84+
### CRITICAL: YAML Anchor Handling
85+
86+
Many branch entries use YAML anchors. When a branch being removed defines an anchor (`&name`), you MUST relocate that anchor to the next-highest branch that remains.
87+
88+
**Step 3a. Simple refs (no anchor)** — just remove the line:
89+
```yaml
90+
# Remove:
91+
release-X.Y: *some-anchor
92+
```
93+
94+
**Step 3b. Anchor definitions with inline blocks** — remove the block AND move the anchor:
95+
```yaml
96+
# Before (remove release-X.Y with inline block):
97+
release-X.Y: &anchor-name
98+
protect: true
99+
required_status_checks:
100+
contexts:
101+
- "tide"
102+
strict: false
103+
restrictions: *branch-protection_restrictions
104+
release-X.Z: *anchor-name # next branch
105+
# After (move anchor to next branch, keep inline block):
106+
release-X.Z: &anchor-name
107+
protect: true
108+
required_status_checks:
109+
contexts:
110+
- "tide"
111+
strict: false
112+
restrictions: *branch-protection_restrictions
113+
```
114+
115+
**Step 3c. After all edits, verify no null anchors exist.** Every `&anchor-name` must have `protect: true` (or similar non-null content) immediately below it. A bare `release-X.Y: &anchor-name` with no following block means all `*anchor-name` references get `null` protection.
116+
117+
### Repos to check
118+
119+
Common repos with release branches: tikv/client-c, tikv/copr-test, tikv/pd, tikv/tikv, pingcap/monitoring, pingcap/tidb, pingcap/tiflow, pingcap/tidb-binlog, pingcap/tiflash, pingcap-inc/enterprise-extensions, pingcap-inc/enterprise-plugin, pingcap-inc/tiflash-scripts.
120+
121+
### Exceptions
122+
123+
- `pingcap/docs` and `pingcap/docs-cn`: docs team maintains these independently. Do NOT modify.
124+
- `tidb-operator` and `tispark` branches use different version schemes — do NOT touch.
125+
126+
## Gotchas
127+
128+
- The edit tool's fuzzy matching can reformat multi-line YAML strings from single-line `description: text` to multi-line `description:\n text`. This is semantically equivalent but makes diffs noisy. Be prepared for this.
129+
- Always run `update-labels.sh` after editing `labels.yaml` to keep `labels.md` in sync.
130+
- After branch-protection edits, verify: no null anchors, all `release-7.2`/`7.3`/`7.4` are present if they existed before, and no release ≤ X.Y branches remain (except docs).

prow/config/config.yaml

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ branch-protection:
2828
release-8.5: *client-c-branch-pt
2929
release-8.1: *client-c-branch-pt
3030
release-7.5: *client-c-branch-pt
31-
release-7.1: *client-c-branch-pt
3231

3332
client-go:
3433
branches:
@@ -66,7 +65,6 @@ branch-protection:
6665
release-8.5: *copr-test-branch-pt
6766
release-8.1: *copr-test-branch-pt
6867
release-7.5: *copr-test-branch-pt
69-
release-7.1: *copr-test-branch-pt
7068

7169
client-rust:
7270
branches:
@@ -136,26 +134,7 @@ branch-protection:
136134
restrictions: *branch-protection_restrictions
137135
release-8.4: *pd-release-branch-pt-with-tools-chunks-old
138136
release-8.3: *pd-release-branch-pt-with-tools-chunks-old
139-
release-7.1:
140-
protect: true
141-
required_status_checks:
142-
contexts:
143-
- "dco"
144-
- "tide"
145-
- "statics"
146-
- "chunks (1)"
147-
- "chunks (2)"
148-
- "chunks (3)"
149-
- "chunks (4)"
150-
- "chunks (5)"
151-
- "chunks (6)"
152-
- "chunks (7)"
153-
- "chunks (8)"
154-
- "chunks (9)"
155-
- "chunks (10)"
156-
- "tso-function-test"
157-
strict: true
158-
restrictions: *branch-protection_restrictions
137+
159138
release-7.5: &pd-release-branch-pt-with-13-chunks
160139
protect: true
161140
required_status_checks:
@@ -263,7 +242,6 @@ branch-protection:
263242
release-8.2: *tikv-release-branch-pt
264243
release-8.1: *tikv-release-branch-pt
265244
release-7.5: *tikv-release-branch-pt
266-
release-7.1: *tikv-release-branch-pt
267245

268246
pingcap:
269247
repos:
@@ -299,9 +277,6 @@ branch-protection:
299277
release-7.4: *monitoring-branch-pt
300278
release-7.3: *monitoring-branch-pt
301279
release-7.2: *monitoring-branch-pt
302-
release-7.1: *monitoring-branch-pt
303-
release-7.0: *monitoring-branch-pt
304-
release-6.6: *monitoring-branch-pt
305280

306281
ng-monitoring:
307282
branches:
@@ -394,18 +369,14 @@ branch-protection:
394369
- "tide"
395370
strict: false
396371
restrictions: *branch-protection_restrictions
397-
release-6.2: &tidb-release-branch-pt
372+
release-7.2: &tidb-release-branch-pt
398373
protect: true
399374
required_status_checks:
400375
contexts:
401376
- "license/cla"
402377
- "tide"
403378
strict: false
404379
restrictions: *branch-protection_restrictions
405-
release-6.6: *tidb-release-branch-pt
406-
release-7.0: *tidb-release-branch-pt
407-
release-7.1: *tidb-release-branch-pt
408-
release-7.2: *tidb-release-branch-pt
409380
release-7.3: *tidb-release-branch-pt
410381
release-7.4: *tidb-release-branch-pt
411382
release-7.5: *tidb-release-branch-pt
@@ -585,15 +556,14 @@ branch-protection:
585556
- "tide"
586557
strict: false
587558
restrictions: *branch-protection_restrictions
588-
release-7.1: &tiflow-release-branch-pt
559+
release-7.2: &tiflow-release-branch-pt
589560
protect: true
590561
required_status_checks:
591562
contexts:
592563
- "license/cla"
593564
- "tide"
594565
strict: false
595566
restrictions: *branch-protection_restrictions
596-
release-7.2: *tiflow-release-branch-pt
597567
release-7.3: *tiflow-release-branch-pt
598568
release-7.4: *tiflow-release-branch-pt
599569
release-7.5: *tiflow-release-branch-pt
@@ -618,7 +588,7 @@ branch-protection:
618588
- "license/cla"
619589
strict: true
620590
restrictions: *branch-protection_restrictions
621-
release-7.1: *tidb-binlog-branch-pt
591+
622592
release-7.2: *tidb-binlog-branch-pt
623593
release-7.3: *tidb-binlog-branch-pt
624594
release-7.4: *tidb-binlog-branch-pt
@@ -648,15 +618,14 @@ branch-protection:
648618
- "license/cla"
649619
strict: false
650620
restrictions: *branch-protection_restrictions
651-
release-7.1: &tiflash-release-branch-pt
621+
release-7.5: &tiflash-release-branch-pt
652622
protect: true
653623
required_status_checks:
654624
contexts:
655625
- "tide"
656626
- "license/cla"
657627
strict: false
658628
restrictions: *branch-protection_restrictions
659-
release-7.5: *tiflash-release-branch-pt
660629
release-8.1: *tiflash-release-branch-pt
661630
release-8.2: *tiflash-release-branch-pt
662631
release-8.3: *tiflash-release-branch-pt
@@ -734,7 +703,7 @@ branch-protection:
734703
- "tide"
735704
strict: false
736705
restrictions: *branch-protection_restrictions
737-
release-7.1: *enterprise-extensions-branch-pt
706+
738707
release-7.5: *enterprise-extensions-branch-pt
739708
release-8.1: *enterprise-extensions-branch-pt
740709
release-8.2: *enterprise-extensions-branch-pt
@@ -757,7 +726,7 @@ branch-protection:
757726
- "tide"
758727
strict: false
759728
restrictions: *branch-protection_restrictions
760-
release-7.1: *enterprise-plugin-branch-pt
729+
761730
release-7.5: *enterprise-plugin-branch-pt
762731
release-8.1: *enterprise-plugin-branch-pt
763732
release-8.2: *enterprise-plugin-branch-pt
@@ -790,7 +759,7 @@ branch-protection:
790759
- "tide"
791760
strict: true
792761
restrictions: *branch-protection_restrictions
793-
release-7.1: *tiflash-scripts-branch-pt
762+
794763
release-7.2: *tiflash-scripts-branch-pt
795764
release-7.3: *tiflash-scripts-branch-pt
796765
release-7.4: *tiflash-scripts-branch-pt

0 commit comments

Comments
 (0)