@@ -20,10 +20,6 @@ on the [#github-management] channel on slack or open an issue in the [kubernetes
20
20
21
21
## Prerequisites
22
22
23
- - [ ] Ensure that your repo has low PR volume (<20 open PRs) and
24
- less number of periodic jobs. The branch rename will re-trigger
25
- prow on _ all_ open PRs, which will cause a huge spike in the CI load.
26
-
27
23
- [ ] Create an issue in your repo to track the branch rename.
28
24
You can paste this checklist in the issue body.
29
25
@@ -42,12 +38,12 @@ covered in this checklist.
42
38
43
39
### Anytime
44
40
45
- These changes are ** non-disruptive** and can be made anytime before
46
- renaming the branch.
41
+ These changes are ** non-disruptive** and can be made anytime before renaming
42
+ the branch.
47
43
48
- - [ ] If a prowjob triggers on the ` master ` branch ( ` branches ` field
49
- of the prowjob), add the ` main ` branch to the list
50
- (see [ kubernetes/test-infra #20665 ] for an example).
44
+ - [ ] If a presubmit or postsubmit prowjob triggers on the ` master ` branch
45
+ ( ` branches ` field of the prowjob), add the ` main ` branch to the list
46
+ (see [ kubernetes/test-infra #20665 ] for an example).
51
47
52
48
- [ ] If the [ ` milestone_applier ` ] prow config references the ` master ` branch,
53
49
add the ` main ` branch to the config (see [ kubernetes/test-infra #20675 ] for an example).
@@ -57,20 +53,45 @@ add the `main` branch to the config.
57
53
58
54
### Just before rename
59
55
60
- These changes are ** disruptive** and should be made just before
61
- renaming the branch.
62
-
63
- - [ ] If a prowjob mentions the ` master ` branch in ` base_ref ` ,
64
- update it to the ` main ` branch. For a periodic job, ensure that
65
- the branch is renamed between periodic job runs.
66
-
67
- - [ ] If a prowjob mentions ` master ` in its name, rename the job to
68
- to not include the branch name. [ ` status-reconciler ` ] should automatically
69
- migrate the PR status contexts to the new job name but this has not been tested yet.
70
- The job with the new name will also appear as a differt job in Testgrid.
56
+ These changes are ** disruptive** and should be made just before renaming the
57
+ branch.
58
+
59
+ - [ ] For periodic prowjobs, or any prowjob that mentions the ` master ` branch
60
+ in ` base_ref ` , update them to the ` main ` branch. Ensure that these changes
61
+ happen in lock-step with the branch rename (jobs triggered in between landing
62
+ these changes and renaming the branch will fail).
63
+ - For bootstrap-based jobs, ensure the branch is explicitly specified,
64
+ e.g. ` kubernetes/foo=main ` . [ kubernetes/test-infra #20667 ] may eventually
65
+ allow for non-disruptive changes.
66
+ - For pod-utils based jobs, ensure the branch is explicitly specified,
67
+ e.g. ` base_ref: main ` . [ kubernetes/test-infra #20672 ] may eventually allow
68
+ for non-disruptive changes.
69
+
70
+ - [ ] If a prowjob mentions ` master ` in its name, rename the job to not include
71
+ the branch name, e.g. ` pull-repo-verify-master ` -> ` pull-repo-verify ` .
72
+ [ ` status-reconciler ` ] should automatically migrate PR status contexts to the
73
+ new job name, and retrigger accordingly, but we have anecdotally found it
74
+ sometimes misses changes.
75
+ - NOTE: our infrastructure doesn't understand the concept of job renames, so
76
+ from the perspective of e.g. https://testgrid.k8s.io the job will appear to
77
+ have lost history and start from scratch.
71
78
72
79
- [ ] If a prowjob calls scripts or code in your repo that explicitly
73
- reference ` master ` , update all references to use ` main ` .
80
+ reference ` master ` , update all references to use ` main ` , or auto-detect the
81
+ remote branch
82
+ - e.g. using git to auto-detect
83
+ ``` sh
84
+ # for existing clones, update their view of the remote
85
+ git fetch origin
86
+ git remote set-head origin -a
87
+ # for new clones, or those updated as above, this prints "main" post-rename
88
+ echo $( git symbolic-ref refs/remotes/origin/HEAD)
89
+ ```
90
+ - e.g. using github's api to auto-detect
91
+ ``` sh
92
+ # gh is https://github.com/cli/cli, this will print "main" post-rename
93
+ gh api /repos/kubernetes-sigs/slack-infra | jq -r .default_branch
94
+ ```
74
95
75
96
- [ ] If the repo has netlify configured for it, ask a member of the GitHub
76
97
Management Team to rename the ` master ` branch to ` main ` in the netlify site config.
@@ -114,8 +135,13 @@ remove it from the config.
114
135
(URLs will be automatically redirected).
115
136
116
137
- [ ] Ensure that CI and PR tests work fine.
138
+ - If there are any outstanding PRs you can /approve to merge, do so to verify
139
+ that presubmits and postsubmits work as expected
117
140
118
141
- [ ] Trial the local development experience with a pre-rename clone.
142
+ - ensure [ Github instructions to rename your local branch] work
143
+ - consider updating your fork's default remote branch name such that if you
144
+ have git autocompletion enabled, typing ` ma<tab> ` will autocomplete to ` main `
119
145
120
146
- [ ] Send a notice about the branch rename to your SIG's mailing list.
121
147
Include the link to the [ GitHub instructions to rename your local branch] .
@@ -126,6 +152,7 @@ Include the link to the [GitHub instructions to rename your local branch].
126
152
[ kubernetes/test-infra#20665 ] : https://github.com/kubernetes/test-infra/pull/20665
127
153
[ kubernetes/test-infra#20667 ] : https://github.com/kubernetes/test-infra/issues/20667
128
154
[ kubernetes/test-infra#20669 ] : https://github.com/kubernetes/test-infra/pull/20669
155
+ [ kubernetes/test-infra#20672 ] : https://github.com/kubernetes/test-infra/issues/20672
129
156
[ kubernetes/test-infra#20675 ] : https://github.com/kubernetes/test-infra/pull/20675
130
157
[ `status-reconciler` ] : https://github.com/kubernetes/test-infra/tree/master/prow/cmd/status-reconciler
131
158
[ `branch_protection` ] : https://github.com/kubernetes/test-infra/blob/ca6273046b355d38eade4c4bd435bd13fbb55043/config/prow/config.yaml#L131
0 commit comments