Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLI]Update Integrate patch release #237

Merged
merged 3 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gbm-cli/cmd/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ go run main.go release integrate v1.107.0
**Flags**
- `-a`, `--android`: Only integrate Android
- `-i`, `--ios`: Only integrate iOS
- `-V` : Host app version (required for patch releases)
- `-h`, `--help`: Command line help for `integrate` command

### status
Expand All @@ -59,5 +60,5 @@ Command used to check the status of any given release:
**Usage**

```
go run main.go release status 1.07.0
go run main.go release status 1.07.0
Copy link
Member

@dcalhoun dcalhoun Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me awhile to review this after failing miserably to succeed performing the testing instructions. Turns out, 1.07.0 is not a valid semver value! 😄

A leading zero is invalid. This caused the semver parsing to strip the preceding zero, which resulted in the CLI not locating the PR containing the preceding zero.

Suggested change
go run main.go release status 1.07.0
go run main.go release status 1.7.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh geez, sorry about that. TIL 1.0X.X is invalid

```
9 changes: 9 additions & 0 deletions gbm-cli/cmd/release/integrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

var android, ios, both bool
var hostVersion string

var IntegrateCmd = &cobra.Command{
Use: "integrate",
Expand All @@ -39,6 +40,13 @@ var IntegrateCmd = &cobra.Command{
GbmPr: gbmPr,
}

if semver.IsPatchRelease() {
if hostVersion == "" {
exitIfError(errors.New("host version is required for patch releases"), 1)
}
ri.BaseBranch = fmt.Sprintf("release/%s", hostVersion)
}

results := []gh.PullRequest{}

createAndroidPr := func() {
Expand Down Expand Up @@ -113,4 +121,5 @@ func init() {
tempDir = workspace.Dir()
IntegrateCmd.Flags().BoolVarP(&android, "android", "a", false, "Only integrate Android")
IntegrateCmd.Flags().BoolVarP(&ios, "ios", "i", false, "Only integrate iOS")
IntegrateCmd.Flags().StringVarP(&hostVersion, "host-version", "V", "", "host app version")
}
5 changes: 5 additions & 0 deletions gbm-cli/templates/checklist/checklist.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ <h3>Create the Release{{ if .Scheduled }} (Thursday) {{end}}</h3>
{{ Task `Create the Gutenberg and Gutenberg Mobile release PR by running:
<pre>$ gbm-cli release prepare all %s</pre>` .Version }}

{{ if .Scheduled}}
{{ Task `After the CI tasks succeed, create the WordPress-iOS and WordPress-Android integration PRs by running:
<pre>$ gbm-cli release integrate %s</pre>` .Version }}
{{ else }}
{{ Task `After the CI tasks succeed, create the WordPress-iOS and WordPress-Android integration PRs by running:
<pre>$ gbm-cli release integrate %s -V </pre>` .Version .HostVersion}}
{{ end }}

{{ if .Scheduled }}
<!-- wp:group -->
Expand Down
Loading