Skip to content

Commit 1bad72e

Browse files
committed
Improve release issue with code freeze step
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
1 parent d03f446 commit 1bad72e

File tree

4 files changed

+28
-15
lines changed

4 files changed

+28
-15
lines changed

go/cmd/cmd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var (
5252
// is made here, perhaps there is a better way of doing it
5353
state.LoadIssue()
5454

55-
interactive.MainScreen(ctx)
55+
interactive.MainScreen(ctx, state)
5656
},
5757
}
5858
)

go/interactive/main_menu.go

+16-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func blankLineMenu() *ui.MenuItem {
3333
return &ui.MenuItem{}
3434
}
3535

36-
func MainScreen(ctx context.Context) {
36+
func MainScreen(ctx context.Context, state *releaser.State) {
3737
prereqMenu := ui.NewMenu(
3838
ctx,
3939
"Prerequisites",
@@ -44,15 +44,20 @@ func MainScreen(ctx context.Context) {
4444
requestCrossPostBlogPostMenuItem(ctx),
4545
)
4646

47-
preReleaseMenu := ui.NewMenu(
47+
codeFreezeMenu := ui.NewMenu(
4848
ctx,
49-
"Pre Release",
49+
"Code Freeze",
5050
pre_release.CodeFreezeMenuItem(ctx),
5151
pre_release.CopyBranchProtectionMenuItem(ctx),
5252
pre_release.CreateBackportToLabelMenuItem(ctx),
5353
pre_release.UpdateSnapshotOnMainMenuItem(ctx),
54-
pre_release.CreateReleasePRMenuItem(ctx),
5554
pre_release.CreateMilestoneMenuItem(ctx),
55+
)
56+
57+
preReleaseMenu := ui.NewMenu(
58+
ctx,
59+
"Pre Release",
60+
pre_release.CreateReleasePRMenuItem(ctx),
5661
pre_release.VtopCreateBranchMenuItem(ctx),
5762
pre_release.VtopBumpMainVersionMenuItem(ctx),
5863
pre_release.VtopUpdateGolangMenuItem(ctx),
@@ -98,6 +103,13 @@ func MainScreen(ctx context.Context) {
98103
Name: "Prerequisites",
99104
Act: subMenu(prereqMenu),
100105
},
106+
&ui.MenuItem{
107+
IsDone: codeFreezeMenu.Done(),
108+
SubItems: codeFreezeMenu.Items,
109+
Name: "Code Freeze",
110+
Act: subMenu(codeFreezeMenu),
111+
Ignore: state.Issue.RC > 1 || state.Issue.GA,
112+
},
101113
&ui.MenuItem{
102114
IsDone: preReleaseMenu.Done(),
103115
SubItems: preReleaseMenu.Items,

go/interactive/pre_release/create_github_milestones.go

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func CreateMilestoneMenuItem(ctx context.Context) *ui.MenuItem {
4141
Update: createMilestoneUpdate,
4242
Info: state.Issue.NewGitHubMilestone.URL,
4343
IsDone: state.Issue.NewGitHubMilestone.Done,
44+
4445
// If we are releasing RC2 or above, we do not want to create a milestone again
4546
Ignore: state.Issue.RC >= 2,
4647
}

go/releaser/issue.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ const (
179179
{{- if .DoVtOp }}
180180
> The release of vitess-operator **v{{.VtopRelease}}** is also planned.
181181
{{- end }}
182+
> Release team: @vitessio/release
182183
183184
> [!IMPORTANT]
184185
> Please **do not** edit the content of the Issue's body manually.
@@ -210,12 +211,13 @@ const (
210211
- [{{fmtStatus .RequestCrossPostBlogPost}}] Send requests to cross-post the blog post (CNCF, PlanetScale).
211212
{{- end }}
212213
213-
{{- if eq .RC 1}}
214-
### Code Freeze _(1 week before RC-1)_
214+
{{- if not (or (gt .RC 1) (.GA))}}
215+
### Code Freeze {{if eq .RC 1}}_(1 week before)_{{else}}_(~1-3 days before)_{{end}}
215216
- [{{fmtStatus .CodeFreeze.Done}}] Code Freeze.
216217
{{- if .CodeFreeze.URL }}
217218
- {{ .CodeFreeze.URL }}
218219
{{- end }}
220+
{{- if eq .RC 1 }}
219221
- [{{fmtStatus .CopyBranchProtectionRules}}] Copy branch protection rules.
220222
- [{{fmtStatus .CreateBackportToLabel.Done}}] Create the Backport to labels.
221223
{{- if .CreateBackportToLabel.URL }}
@@ -225,6 +227,7 @@ const (
225227
{{- if .UpdateSnapshotOnMain.URL }}
226228
- {{ .UpdateSnapshotOnMain.URL }}
227229
{{- end }}
230+
{{- end }}
228231
- [{{fmtStatus .NewGitHubMilestone.Done}}] Create new GitHub Milestone.
229232
{{- if .NewGitHubMilestone.URL }}
230233
- {{ .NewGitHubMilestone.URL }}
@@ -233,12 +236,6 @@ const (
233236
234237
### Pre-Release _(~1-3 days before)_
235238
236-
{{- if not (or (gt .RC 0) (.GA)) }}
237-
- [{{fmtStatus .CodeFreeze.Done}}] Code Freeze.
238-
{{- if .CodeFreeze.URL }}
239-
- {{ .CodeFreeze.URL }}
240-
{{- end }}
241-
{{- end }}
242239
- [{{fmtStatus .CreateReleasePR.Done}}] Create Release PR.
243240
{{- if .CreateReleasePR.URL }}
244241
- {{ .CreateReleasePR.URL }}
@@ -263,7 +260,7 @@ const (
263260
- [{{fmtStatus .CreateBlogPostPR}}] Open a Pull Request on the website repository for the blog post.
264261
{{- end }}
265262
266-
### Release _(day of)_
263+
### Release _({{fmtShortDate .Date }})_
267264
268265
- [{{fmtStatus .MergeReleasePR.Done}}] Merge the Release PR.
269266
{{- if .MergeReleasePR.URL }}
@@ -315,7 +312,7 @@ const (
315312
{{- end }}
316313
317314
318-
### Post-Release
315+
### Post-Release _({{fmtShortDate .Date }})_
319316
- [{{fmtStatus .SlackPostRelease}}] Notify the community on Slack for the new release.
320317
- [{{fmtStatus .Twitter}}] Twitter announcement.
321318
- [{{fmtStatus .CloseIssue}}] Close this Issue.
@@ -639,6 +636,9 @@ func (i *Issue) toString() string {
639636
"fmtDate": func(d time.Time) string {
640637
return d.Format("Mon _2 Jan 2006")
641638
},
639+
"fmtShortDate": func(d time.Time) string {
640+
return d.Format("Mon _2 Jan")
641+
},
642642
})
643643

644644
parsed, err := tmpl.Parse(releaseIssueTemplate)

0 commit comments

Comments
 (0)