Skip to content

Commit 5184bec

Browse files
authored
Merge pull request #94 from vitessio/improve-release-issue
Divide the pre-release and code freeze section in two
2 parents c20c649 + f744b1a commit 5184bec

16 files changed

+119
-104
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/pre_release/code_freeze.go go/interactive/code_freeze/code_freeze.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package pre_release
17+
package code_freeze
1818

1919
import (
2020
"context"
2121

2222
tea "github.com/charmbracelet/bubbletea"
2323
"vitess.io/vitess-releaser/go/interactive/ui"
2424
"vitess.io/vitess-releaser/go/releaser"
25+
"vitess.io/vitess-releaser/go/releaser/code_freeze"
2526
"vitess.io/vitess-releaser/go/releaser/steps"
26-
27-
"vitess.io/vitess-releaser/go/releaser/pre_release"
2827
)
2928

3029
func CodeFreezeMenuItem(ctx context.Context) *ui.MenuItem {
@@ -61,7 +60,7 @@ func codeFreezeUpdate(mi *ui.MenuItem, msg tea.Msg) (*ui.MenuItem, tea.Cmd) {
6160
}
6261

6362
func codeFreezeAct(mi *ui.MenuItem) (*ui.MenuItem, tea.Cmd) {
64-
pl, freeze := pre_release.CodeFreeze(mi.State)
63+
pl, freeze := code_freeze.CodeFreeze(mi.State)
6564
return mi, tea.Batch(func() tea.Msg {
6665
return codeFreezeUrl(freeze())
6766
}, ui.PushDialog(ui.NewProgressDialog("Code freeze", pl)))

go/interactive/pre_release/copy_branch_protection.go go/interactive/code_freeze/copy_branch_protection.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package pre_release
17+
package code_freeze
1818

1919
import (
2020
"context"
2121

2222
tea "github.com/charmbracelet/bubbletea"
2323
"vitess.io/vitess-releaser/go/interactive/ui"
2424
"vitess.io/vitess-releaser/go/releaser"
25+
"vitess.io/vitess-releaser/go/releaser/code_freeze"
2526
"vitess.io/vitess-releaser/go/releaser/steps"
26-
27-
"vitess.io/vitess-releaser/go/releaser/pre_release"
2827
)
2928

3029
func CopyBranchProtectionMenuItem(ctx context.Context) *ui.MenuItem {
@@ -58,7 +57,7 @@ func copyBranchProtectionUpdate(mi *ui.MenuItem, msg tea.Msg) (*ui.MenuItem, tea
5857
}
5958

6059
func copyBranchProtectionAct(mi *ui.MenuItem) (*ui.MenuItem, tea.Cmd) {
61-
pl, copyRules := pre_release.CopyBranchProtectionRules(mi.State)
60+
pl, copyRules := code_freeze.CopyBranchProtectionRules(mi.State)
6261
return mi, tea.Batch(func() tea.Msg {
6362
return copyBranchProtectionUrl(copyRules())
6463
}, ui.PushDialog(ui.NewProgressDialog("Copy Branch Protection Rule", pl)))

go/interactive/pre_release/create_backport_to_label.go go/interactive/code_freeze/create_backport_to_label.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package pre_release
17+
package code_freeze
1818

1919
import (
2020
"context"
2121

2222
tea "github.com/charmbracelet/bubbletea"
2323
"vitess.io/vitess-releaser/go/interactive/ui"
2424
"vitess.io/vitess-releaser/go/releaser"
25+
"vitess.io/vitess-releaser/go/releaser/code_freeze"
2526
"vitess.io/vitess-releaser/go/releaser/steps"
26-
27-
"vitess.io/vitess-releaser/go/releaser/pre_release"
2827
)
2928

3029
func CreateBackportToLabelMenuItem(ctx context.Context) *ui.MenuItem {
@@ -60,7 +59,7 @@ func createBackportToLabelUpdate(mi *ui.MenuItem, msg tea.Msg) (*ui.MenuItem, te
6059
}
6160

6261
func createBackportToLabelAct(mi *ui.MenuItem) (*ui.MenuItem, tea.Cmd) {
63-
pl, create := pre_release.CreateBackportToLabel(mi.State)
62+
pl, create := code_freeze.CreateBackportToLabel(mi.State)
6463
return mi, tea.Batch(func() tea.Msg {
6564
return createBackportToLabelUrl(create())
6665
}, ui.PushDialog(ui.NewProgressDialog("Create Backport To label", pl)))

go/interactive/pre_release/create_github_milestones.go go/interactive/code_freeze/create_github_milestones.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package pre_release
17+
package code_freeze
1818

1919
import (
2020
"context"
2121

2222
tea "github.com/charmbracelet/bubbletea"
2323
"vitess.io/vitess-releaser/go/interactive/ui"
2424
"vitess.io/vitess-releaser/go/releaser"
25-
"vitess.io/vitess-releaser/go/releaser/pre_release"
25+
"vitess.io/vitess-releaser/go/releaser/code_freeze"
2626
"vitess.io/vitess-releaser/go/releaser/steps"
2727
)
2828

@@ -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
}
@@ -59,7 +60,7 @@ func createMilestoneUpdate(mi *ui.MenuItem, msg tea.Msg) (*ui.MenuItem, tea.Cmd)
5960
}
6061

6162
func createMilestoneAct(mi *ui.MenuItem) (*ui.MenuItem, tea.Cmd) {
62-
pl, create := pre_release.NewMilestone(mi.State)
63+
pl, create := code_freeze.NewMilestone(mi.State)
6364
return mi, tea.Batch(func() tea.Msg {
6465
return createMilestone(create())
6566
}, ui.PushDialog(ui.NewProgressDialog("Creating new GitHub Milestone", pl)))

go/interactive/pre_release/update_snapshot.go go/interactive/code_freeze/update_snapshot.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package pre_release
17+
package code_freeze
1818

1919
import (
2020
"context"
2121

2222
tea "github.com/charmbracelet/bubbletea"
2323
"vitess.io/vitess-releaser/go/interactive/ui"
2424
"vitess.io/vitess-releaser/go/releaser"
25+
"vitess.io/vitess-releaser/go/releaser/code_freeze"
2526
"vitess.io/vitess-releaser/go/releaser/steps"
26-
27-
"vitess.io/vitess-releaser/go/releaser/pre_release"
2827
)
2928

3029
func UpdateSnapshotOnMainMenuItem(ctx context.Context) *ui.MenuItem {
@@ -61,7 +60,7 @@ func updateSnapshotOnMainUpdate(mi *ui.MenuItem, msg tea.Msg) (*ui.MenuItem, tea
6160
}
6261

6362
func updateSnapshotOnMainAct(mi *ui.MenuItem) (*ui.MenuItem, tea.Cmd) {
64-
pl, update := pre_release.UpdateSnapshotOnMain(mi.State)
63+
pl, update := code_freeze.UpdateSnapshotOnMain(mi.State)
6564
return mi, tea.Batch(func() tea.Msg {
6665
return updateSnapshotOnMainUrl(update())
6766
}, ui.PushDialog(ui.NewProgressDialog("Update SNAPSHOT on main", pl)))

go/interactive/main_menu.go

+19-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"os"
2323

2424
tea "github.com/charmbracelet/bubbletea"
25+
"vitess.io/vitess-releaser/go/interactive/code_freeze"
2526
"vitess.io/vitess-releaser/go/interactive/post_release"
2627
"vitess.io/vitess-releaser/go/interactive/pre_release"
2728
"vitess.io/vitess-releaser/go/interactive/release"
@@ -33,7 +34,7 @@ func blankLineMenu() *ui.MenuItem {
3334
return &ui.MenuItem{}
3435
}
3536

36-
func MainScreen(ctx context.Context) {
37+
func MainScreen(ctx context.Context, state *releaser.State) {
3738
prereqMenu := ui.NewMenu(
3839
ctx,
3940
"Prerequisites",
@@ -44,15 +45,20 @@ func MainScreen(ctx context.Context) {
4445
requestCrossPostBlogPostMenuItem(ctx),
4546
)
4647

48+
codeFreezeMenu := ui.NewMenu(
49+
ctx,
50+
"Code Freeze",
51+
code_freeze.CodeFreezeMenuItem(ctx),
52+
code_freeze.CopyBranchProtectionMenuItem(ctx),
53+
code_freeze.CreateBackportToLabelMenuItem(ctx),
54+
code_freeze.UpdateSnapshotOnMainMenuItem(ctx),
55+
code_freeze.CreateMilestoneMenuItem(ctx),
56+
)
57+
4758
preReleaseMenu := ui.NewMenu(
4859
ctx,
4960
"Pre Release",
50-
pre_release.CodeFreezeMenuItem(ctx),
51-
pre_release.CopyBranchProtectionMenuItem(ctx),
52-
pre_release.CreateBackportToLabelMenuItem(ctx),
53-
pre_release.UpdateSnapshotOnMainMenuItem(ctx),
5461
pre_release.CreateReleasePRMenuItem(ctx),
55-
pre_release.CreateMilestoneMenuItem(ctx),
5662
pre_release.VtopCreateBranchMenuItem(ctx),
5763
pre_release.VtopBumpMainVersionMenuItem(ctx),
5864
pre_release.VtopUpdateGolangMenuItem(ctx),
@@ -98,6 +104,13 @@ func MainScreen(ctx context.Context) {
98104
Name: "Prerequisites",
99105
Act: subMenu(prereqMenu),
100106
},
107+
&ui.MenuItem{
108+
IsDone: codeFreezeMenu.Done(),
109+
SubItems: codeFreezeMenu.Items,
110+
Name: "Code Freeze",
111+
Act: subMenu(codeFreezeMenu),
112+
Ignore: state.Issue.RC > 1 || state.Issue.GA,
113+
},
101114
&ui.MenuItem{
102115
IsDone: preReleaseMenu.Done(),
103116
SubItems: preReleaseMenu.Items,

go/releaser/pre_release/code_freeze.go go/releaser/code_freeze/code_freeze.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package pre_release
17+
package code_freeze
1818

1919
import (
2020
"fmt"
@@ -168,7 +168,7 @@ func activateCodeFreeze() {
168168
changeCodeFreezeWorkflow(codeFreezeActivated)
169169
}
170170

171-
func deactivateCodeFreeze() {
171+
func DeactivateCodeFreeze() {
172172
changeCodeFreezeWorkflow(codeFreezeDeactivated)
173173
}
174174

go/releaser/pre_release/copy_branch_protection_rules.go go/releaser/code_freeze/copy_branch_protection_rules.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package pre_release
17+
package code_freeze
1818

1919
import (
2020
"vitess.io/vitess-releaser/go/releaser"

go/releaser/pre_release/create_backport_to_label.go go/releaser/code_freeze/create_backport_to_label.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package pre_release
17+
package code_freeze
1818

1919
import (
2020
"fmt"

go/releaser/pre_release/milestone.go go/releaser/code_freeze/milestone.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package pre_release
17+
package code_freeze
1818

1919
import (
2020
"fmt"

go/releaser/pre_release/update_snapshot.go go/releaser/code_freeze/update_snapshot.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package pre_release
17+
package code_freeze
1818

1919
import (
2020
"fmt"
@@ -66,10 +66,10 @@ func UpdateSnapshotOnMain(state *releaser.State) (*logging.ProgressLogging, func
6666
newBranchName := git.FindNewGeneratedBranch(state.VitessRelease.Remote, "main", "snapshot-update")
6767

6868
pl.NewStepf("Update version.go")
69-
UpdateVersionGoFile(snapshotRelease)
69+
releaser.UpdateVersionGoFile(snapshotRelease)
7070

7171
pl.NewStepf("Update the Java directory")
72-
UpdateJavaDir(snapshotRelease)
72+
releaser.UpdateJavaDir(snapshotRelease)
7373

7474
pl.NewStepf("Commit and push to branch %s", newBranchName)
7575
if git.CommitAll(fmt.Sprintf("Snapshot update: %s", snapshotUpdatePRName)) {

go/releaser/issue.go

+16-13
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,14 @@ 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.
185186
> The **vitess-releaser** tool is managing and handling this issue.
186187
> You can however click on the check boxes to mark them as done/not done, and write comments.
187188
188-
### Prerequisites
189+
### Prerequisites _(~2 weeks before)_
189190
190191
- [{{fmtStatus .General.Done}}] General prerequisites.
191192
{{- range $item := .General.Items }}
@@ -206,15 +207,12 @@ const (
206207
- [{{fmtStatus .RequestCrossPostBlogPost}}] Send requests to cross-post the blog post (CNCF, PlanetScale).
207208
{{- end }}
208209
209-
210-
### Pre-Release
211-
212-
{{- if not (or (gt .RC 1) (.GA)) }}
210+
{{- if not (or (gt .RC 1) (.GA))}}
211+
### Code Freeze {{if eq .RC 1}}_(1 week before)_{{else}}_(~1-3 days before)_{{end}}
213212
- [{{fmtStatus .CodeFreeze.Done}}] Code Freeze.
214213
{{- if .CodeFreeze.URL }}
215214
- {{ .CodeFreeze.URL }}
216215
{{- end }}
217-
{{- end }}
218216
{{- if eq .RC 1 }}
219217
- [{{fmtStatus .CopyBranchProtectionRules}}] Copy branch protection rules.
220218
- [{{fmtStatus .CreateBackportToLabel.Done}}] Create the Backport to labels.
@@ -226,16 +224,18 @@ const (
226224
- {{ .UpdateSnapshotOnMain.URL }}
227225
{{- end }}
228226
{{- end }}
229-
- [{{fmtStatus .CreateReleasePR.Done}}] Create Release PR.
230-
{{- if .CreateReleasePR.URL }}
231-
- {{ .CreateReleasePR.URL }}
232-
{{- end }}
233-
{{- if lt .RC 2 }}
234227
- [{{fmtStatus .NewGitHubMilestone.Done}}] Create new GitHub Milestone.
235228
{{- if .NewGitHubMilestone.URL }}
236229
- {{ .NewGitHubMilestone.URL }}
237230
{{- end }}
238231
{{- end }}
232+
233+
### Pre-Release _(~1-3 days before)_
234+
235+
- [{{fmtStatus .CreateReleasePR.Done}}] Create Release PR.
236+
{{- if .CreateReleasePR.URL }}
237+
- {{ .CreateReleasePR.URL }}
238+
{{- end }}
239239
{{- if .DoVtOp }}
240240
{{- if eq .RC 1 }}
241241
- [{{fmtStatus .VtopCreateBranch}}] Create vitess-operator release branch.
@@ -256,7 +256,7 @@ const (
256256
- [{{fmtStatus .CreateBlogPostPR}}] Open a Pull Request on the website repository for the blog post.
257257
{{- end }}
258258
259-
### Release
259+
### Release _({{fmtShortDate .Date }})_
260260
261261
- [{{fmtStatus .MergeReleasePR.Done}}] Merge the Release PR.
262262
{{- if .MergeReleasePR.URL }}
@@ -308,7 +308,7 @@ const (
308308
{{- end }}
309309
310310
311-
### Post-Release
311+
### Post-Release _({{fmtShortDate .Date }})_
312312
- [{{fmtStatus .SlackPostRelease}}] Notify the community on Slack for the new release.
313313
- [{{fmtStatus .Twitter}}] Twitter announcement.
314314
- [{{fmtStatus .CloseIssue}}] Close this Issue.
@@ -638,6 +638,9 @@ func (i *Issue) toString() string {
638638
"fmtDate": func(d time.Time) string {
639639
return d.Format("Mon _2 Jan 2006")
640640
},
641+
"fmtShortDate": func(d time.Time) string {
642+
return d.Format("Mon _2 Jan")
643+
},
641644
})
642645

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

0 commit comments

Comments
 (0)