From 067c8d8c6c7dca619ef5a5daafec4796ad706fab Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 31 Oct 2023 14:04:39 +1000 Subject: [PATCH 01/11] Update Release Checklist template --- cli/templates/checklist/checklist.html | 28 +++++--------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/cli/templates/checklist/checklist.html b/cli/templates/checklist/checklist.html index 6046d30..24d2d29 100644 --- a/cli/templates/checklist/checklist.html +++ b/cli/templates/checklist/checklist.html @@ -37,13 +37,12 @@

Before the Release (Tuesday)

Create the Release{{ if .Scheduled }} (Thursday) {{end}}

-{{ Task `Verify that gutenberg-mobile/RNTAztecView.podspec and gutenberg-mobile/gutenberg/packages/react-native-aztec/RNTAztecView.podspec - refer to the same WordPress-Aztec-iOS version and are pointing to a stable, tagged release (e.g. 1.14.1). If they are not, we may need to create a new Aztec release.` }} +{{ Task `Clone the CLI or pull the latest version if you have already cloned it.` }} -{{ Task `Clone the release scripts or pull the latest version if you have already cloned it.` }} +{{ Task `Review the release script instructions. +In your clone of the release scripts cli directory, run the prepare command: go run main.go release prepare all %s. This creates the gutenberg and gutenberg-mobile release PRs.` }} -{{ Task `Review the release script instructions. - In your clone of the release scripts, run the script via: ./release_automation.sh. This creates the gutenberg and gutenberg-mobile release PRs as well as WPAndroid and WPiOS integration PRs.` }} +{{ Task `Once the CI tasks succeed, run the integrate command to create the main apps PRs for WordPress-iOS and WordPress-Android: go run main.go release integrate %s `}} {{ if .Scheduled }} @@ -60,17 +59,6 @@

Create the Release{{ if .Scheduled }} (Thursday) {{end}}

{{ end }} -{{ Task `In both RELEASE-NOTES.txt and gutenberg/packages/react-native-editor/CHANGELOG.md, - replace Unreleased section with the release version and create a new Unreleased section.` }} - -{{ Task `Review and update RELEASE-NOTES.txt file on both WPAndroid and WPiOS PRs so it includes all user-facing changes introduced in the release. - Keep in mind that some changes can be specific to a single platform, so they should only be added to the release notes of the platform that affects - (e.g. a change that only affects Android should only be included in WPAndroid release notes).` }} - -{{ Task `Verify the WPAndroid and WPiOS PR builds succeed. For WPAndroid, if the PR CI tasks include a 403 error related to an inability to resolve the - react-native-bridge dependency, you must wait for the Build Android RN Bridge & Publish to S3 - task to succeed in gutenberg-mobile and then restart the WPAndroid CI tasks. Similarly, for iOS, you must wait for the Build iOS RN XCFramework & Publish to S3 task to succeed.` }} - {{ Task `Once the installable builds are ready, perform a quick smoke test of the editor on both iOS and Android to verify it launches without crashing. We will perform additional testing after the main apps cut their releases.` }} @@ -112,15 +100,9 @@

Manage Incoming Changes (conditional)

{{ Task `Add the new change to the "Extra PRs that Landed After the Release Was Cut" section of the gutenberg-mobile PR description.` }} -

Integrate the Release{{ if .Scheduled }} (Thursday) {{end}}

+

Publish the Release{{ if .Scheduled }} (Thursday) {{end}}

-{{ Task `Verify the gutenberg ref within the gutenberg-mobile release branch is pointed to the latest commit in the gutenberg release branch.` }} - -{{ Task `Create and push a rnmobile/%s git tag for the head of gutenberg release branch.` .Version }} - -{{ Task `Ensure that the bundle files are updated to include any changes to the release branch by running npm run bundle in gutenberg-mobile release branch and committing any changes.` }} - {{ Task `Create a new gutenberg-mobile GitHub Release. Include a list of changes in the release description. Ensure the checkmark "Set as the latest release" is checked, and publish the release with the "Publish release" button.` .ReleaseUrl }} {{ Task `Wait until all CI jobs for the published tag finish and succeed.` }} From cc2bdffed92d10cfae02336e30ee237329e13912 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 31 Oct 2023 14:29:25 +1000 Subject: [PATCH 02/11] Fix message flag in checklist.go --- cli/cmd/render/checklist.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/cmd/render/checklist.go b/cli/cmd/render/checklist.go index 322f39c..7fac9ec 100644 --- a/cli/cmd/render/checklist.go +++ b/cli/cmd/render/checklist.go @@ -70,6 +70,7 @@ var ChecklistCmd = &cobra.Command{ Scheduled: scheduled, ReleaseUrl: releaseUrl, Date: releaseDate, + Message: message, HostVersion: hostVersion, IncludeAztec: includeAztec, CheckAztec: checkAztec, From cd6806d34eeb2ad3c2a203be5c3cfa9a901355e8 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 31 Oct 2023 14:29:44 +1000 Subject: [PATCH 03/11] Add Releasing.md for CLI --- cli/Releasing.md | 126 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 cli/Releasing.md diff --git a/cli/Releasing.md b/cli/Releasing.md new file mode 100644 index 0000000..2bb0034 --- /dev/null +++ b/cli/Releasing.md @@ -0,0 +1,126 @@ +# Release Checklist Template + +The Release Checklist Template can be generated with the following command: (replacing `X.XX.X` with the applicable release number): + +``` +go run main.go render checklist -v X.XX.X --message "This hotfix addresses ISSUE_OR_CRASH in ORIGINAL_VERSION. See P2_PR_SLACK_ETC_LINK_OR_LINKS for the rationale behind the decision to make it." +``` + +The `--c` flag will copy the output to your clipboard. To view the output in the command line, simply remove the `--c` flag. + + +If the release is a betafix/hotfix, include a message explaining briefly the reason for releasing the fix. +**Example:** `This hotfix addresses ISSUE_OR_CRASH in ORIGINAL_VERSION. See P2_PR_SLACK_ETC_LINK_OR_LINKS for the rationale behind the decision to make it.` + + +# Different types of releases + +## Best practices + +It's best practice to use the automation script (mentioned in the release template above) for all releases types (alpha, regular, betafix, hotfix). When wrangling a betafix or hotfix, it's important to merge the fix to Gutenberg `trunk` independently of the release process. When the release is cut (by the automation script) the commit(s) that make up the betafix or hotfix should then be cherry-picked onto the Gutenberg release branch. + +## 1. Alpha + +### When + +Whenever a build is needed for testing (usually a few days prior to a Regular release) + +### Branches + +For example, when the next release will be `1.11.0`. + +| Repo | Cut From | Branch Name | +| ---------------- | -------- | ----------------------------------------- | +| gutenberg | trunk | rnmobile/release_1.11.0-alpha1 | +| gutenberg-mobile | trunk | release/1.11.0-alpha1 | +| WPAndroid | trunk | gutenberg/integrate_release_1.11.0-alpha1 | +| WPiOS | trunk | gutenberg/integrate_release_1.11.0-alpha1 | + +### Automation script differences + +Compared to a Regular release, the differences here are: + +- When the script asks for the new version number, don't forget to add the `-alpha` suffix (e.g. `1.11.0-alpha1`). +- All PRs created by the release script should be edited to clarify that they are temporary and will be deleted when testing is finished. + +### Release checklist template differences + +The release checklist is not used for alpha releases. When testing is finished, please close all PRs and delete all branches created by the script. + +## 2. Regular + +### When + +On Thursdays, the week before the main apps (WPiOS & WPAndroid) have cut their releases, every 2 weeks. + +### Branches + +For example when releasing gutenberg-mobile `1.11.0`. + +| Repo | Cut From | Branch Name | Merging To | +| ---------------- | -------- | ---------------------------------- | --------------- | +| gutenberg | trunk | rnmobile/release_1.11.0 | trunk | +| gutenberg-mobile | trunk | release/1.11.0 | trunk | +| WPAndroid | trunk | gutenberg/integrate_release_1.11.0 | trunk | +| WPiOS | trunk | gutenberg/integrate_release_1.11.0 | trunk | + +## 3. Betafix + +### When + +A fix is targeting a main app version that is not yet released (meaning the release branch is cut but it's still in beta) and a new gutenberg-mobile release is needed. + +### Branches + +For example when releasing gutenberg-mobile `1.11.1` while main apps version `22.2.0` is in beta which currently has gutenberg-mobile `1.11.0` in it. +At the same time there could also be a regular release going on for example for gutenberg-mobile version `1.12.0`. + +| Repo | Cut From | Branch Name | Merging To | +| ---------------- | ----------------------- | ---------------------------------- | ---------------------------------------------------------------- | +| gutenberg | rnmobile/release_1.11.0 (tag) | rnmobile/release_1.11.1 | trunk & (maybe also) rnmobile/release_1.12.0 | +| gutenberg-mobile | v1.11.0 (tag) | release/1.11.1 | trunk & (maybe also) release/1.12.0 | +| WPAndroid | release/22.2.0 | gutenberg/integrate_release_1.11.1 | release/22.2.0 & (maybe also) gutenberg/integrate_release_1.12.0 | +| WPiOS | release/22.2.0 | gutenberg/integrate_release_1.11.1 | release/22.2.0 & (maybe also) gutenberg/integrate_release_1.12.0 | + +### Automation script differences + +1. Before running the script switch to the relevant branch to cut from in gutenberg-mobile repo. +1. Run the CLI tool as normal +1. When asked by the script enter the relevant branch names to cut from (to target) in other repos. +1. If a commit that is fixing the issue is already merged to gutenberg, when asked by the script enter the commit hash to be cherry-picked. + +### Release checklist template differences + +1. Include `Betafix` in the heading. +1. `after_X.XX.X` branches can be ignored. + +## 4. Hotfix + +### When + +A fix is targeting a main app version that is already released and a new gutenberg-mobile release is needed. + +### Branches + +For example when releasing gutenberg-mobile `1.11.1` while main apps version `22.2.0` is released which currently has gutenberg-mobile `1.11.0` in it. +At the same time there could also be a regular release, a betafix or even another hotfix going on for example for gutenberg-mobile version `1.12.1`. + +| Repo | Cut From | Branch Name | Merging To | +| ---------------- | ----------------------- | ---------------------------------- | ---------------------------------------------------------------- | +| gutenberg | rnmobile/release_1.11.0 (tag) | rnmobile/release_1.11.1 | trunk & (maybe also) rnmobile/release_1.12.1 | +| gutenberg-mobile | v1.11.0 (tag) | release/1.11.1 | trunk & (maybe also) release/1.12.1 | +| WPAndroid | release/22.2.0 | gutenberg/integrate_release_1.11.1 | release/22.2.1 & (maybe also) gutenberg/integrate_release_1.12.1 | +| WPiOS | release/22.2.0 | gutenberg/integrate_release_1.11.1 | release/22.2.1 & (maybe also) gutenberg/integrate_release_1.12.1 | + +### Automation script differences + +1. If necessary create new patch version branches `release/X.Y.1` in WPiOS and WPAndroid. + +Rest should be same the as Betafix + +### Release checklist template differences + +1. Include `Hotfix` in the heading +1. After the fix is merged and if there is an ongoing regular release, betafix or hotfix then the changes should be brought back to those branches as well. + +The rest should be same the as Betafix. \ No newline at end of file From 059090dc862727beda7ee79f0c6e571f7ba27768 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Tue, 31 Oct 2023 14:33:30 +1000 Subject: [PATCH 04/11] Fix Releasing.md formatting --- cli/Releasing.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cli/Releasing.md b/cli/Releasing.md index 2bb0034..295db83 100644 --- a/cli/Releasing.md +++ b/cli/Releasing.md @@ -3,15 +3,18 @@ The Release Checklist Template can be generated with the following command: (replacing `X.XX.X` with the applicable release number): ``` -go run main.go render checklist -v X.XX.X --message "This hotfix addresses ISSUE_OR_CRASH in ORIGINAL_VERSION. See P2_PR_SLACK_ETC_LINK_OR_LINKS for the rationale behind the decision to make it." +go run main.go render checklist -v X.XX.X ``` The `--c` flag will copy the output to your clipboard. To view the output in the command line, simply remove the `--c` flag. If the release is a betafix/hotfix, include a message explaining briefly the reason for releasing the fix. -**Example:** `This hotfix addresses ISSUE_OR_CRASH in ORIGINAL_VERSION. See P2_PR_SLACK_ETC_LINK_OR_LINKS for the rationale behind the decision to make it.` +**Example:** +``` +go run main.go render checklist -v X.XX.X --message "This hotfix addresses ISSUE_OR_CRASH in ORIGINAL_VERSION. See P2_PR_SLACK_ETC_LINK_OR_LINKS for the rationale behind the decision to make it." +``` # Different types of releases @@ -23,7 +26,7 @@ It's best practice to use the automation script (mentioned in the release templa ### When -Whenever a build is needed for testing (usually a few days prior to a Regular release) +Whenever a build is needed for testing (usually a few days prior to a Regular release). ### Branches @@ -116,7 +119,7 @@ At the same time there could also be a regular release, a betafix or even anothe 1. If necessary create new patch version branches `release/X.Y.1` in WPiOS and WPAndroid. -Rest should be same the as Betafix +The rest should be same the as Betafix. ### Release checklist template differences From 5cabb1ed3a1938dfca2b44dacb649790a67f2939 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 2 Nov 2023 10:03:49 +1000 Subject: [PATCH 05/11] Update Releasing.md --- cli/Releasing.md | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/Releasing.md b/cli/Releasing.md index 295db83..9116b39 100644 --- a/cli/Releasing.md +++ b/cli/Releasing.md @@ -87,7 +87,6 @@ At the same time there could also be a regular release going on for example for ### Automation script differences -1. Before running the script switch to the relevant branch to cut from in gutenberg-mobile repo. 1. Run the CLI tool as normal 1. When asked by the script enter the relevant branch names to cut from (to target) in other repos. 1. If a commit that is fixing the issue is already merged to gutenberg, when asked by the script enter the commit hash to be cherry-picked. From 63d80408bd17324472049938c689ff890b12e4b1 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 2 Nov 2023 10:05:13 +1000 Subject: [PATCH 06/11] Update Release Checklist clone step --- cli/templates/checklist/checklist.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/templates/checklist/checklist.html b/cli/templates/checklist/checklist.html index 24d2d29..341ec1d 100644 --- a/cli/templates/checklist/checklist.html +++ b/cli/templates/checklist/checklist.html @@ -37,7 +37,7 @@

Before the Release (Tuesday)

Create the Release{{ if .Scheduled }} (Thursday) {{end}}

-{{ Task `Clone the CLI or pull the latest version if you have already cloned it.` }} +{{ Task `Pull the latest version of the CLI.` }} {{ Task `Review the release script instructions. In your clone of the release scripts cli directory, run the prepare command: go run main.go release prepare all %s. This creates the gutenberg and gutenberg-mobile release PRs.` }} From fe23343e7bea7aed763ab332e27aa14dcc5e0136 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Thu, 2 Nov 2023 10:11:18 +1000 Subject: [PATCH 07/11] Update Release Checklist prepare step --- cli/templates/checklist/checklist.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/templates/checklist/checklist.html b/cli/templates/checklist/checklist.html index 341ec1d..10da18c 100644 --- a/cli/templates/checklist/checklist.html +++ b/cli/templates/checklist/checklist.html @@ -39,8 +39,7 @@

Create the Release{{ if .Scheduled }} (Thursday) {{end}}

{{ Task `Pull the latest version of the CLI.` }} -{{ Task `Review the release script instructions. -In your clone of the release scripts cli directory, run the prepare command: go run main.go release prepare all %s. This creates the gutenberg and gutenberg-mobile release PRs.` }} +{{ Task `In your clone of the cli directory, run the prepare command: go run main.go release prepare all %s to create the gutenberg and gutenberg-mobile release PRs.` }} {{ Task `Once the CI tasks succeed, run the integrate command to create the main apps PRs for WordPress-iOS and WordPress-Android: go run main.go release integrate %s `}} From 409850fcf19e19833a35bf3805e840c7ffa15b33 Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Fri, 3 Nov 2023 16:05:19 +1000 Subject: [PATCH 08/11] Update README --- cli/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cli/README.md b/cli/README.md index 0445933..14abcd0 100644 --- a/cli/README.md +++ b/cli/README.md @@ -1,14 +1,20 @@ # GBM CLI ## Overview -The GBM cli tool helps developmental tasks for managing Gutenberg Mobile releases. +The GBM CLI tool helps developmental tasks for managing Gutenberg Mobile releases. The current features include: - Command to generate the release checklist - Commands to wrangle Gutenberg Mobile releases -## Prerequisites -Download and install the [Go package](https://go.dev/doc/install). +## Development Environment +1. Download and install the [Go package](https://go.dev/doc/install). +2. While not required, it is higly recommended to develop with [VSCode](https://code.visualstudio.com/) and install the [Go VSCode](https://marketplace.visualstudio.com/items?itemName=golang.go) extension. + +## Releasing +For detailed instructions on running a release, visit [Releasing.md](https://github.com/wordpress-mobile/release-toolkit-gutenberg-mobile/blob/cli/update-checklist/cli/Releasing.md). + +## Testing ## Structure From db250fbb48a8b563f710b2b43b5bc5d357bacfac Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Fri, 3 Nov 2023 16:05:27 +1000 Subject: [PATCH 09/11] Add Testing.md --- cli/Testing.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 cli/Testing.md diff --git a/cli/Testing.md b/cli/Testing.md new file mode 100644 index 0000000..f0e16c7 --- /dev/null +++ b/cli/Testing.md @@ -0,0 +1,29 @@ +# Testing + +If developing with VSCode, tests can be run inline within the test files themselves, and is the recommended method for running and debugging tests. Tests can also be run from the command line with the `go test` command. + +## Testing Environment for Development +The CLI tool can be run against forked repos for testing. To configure your forked repos: + + 1. Fork the following repos to your github user repo: + a) Gutenberg-Mobile: https://github.com/wordpress-mobile/gutenberg-mobile + * .gitmodules on CURRENT_BRANCH should reference your gutenberg fork, replace 'WordPress' with GITHUB_USERNAME + * (https://github.com/wordpress-mobile/gutenberg-mobile/blob/trunk/.gitmodules) + b) Gutenberg: https://github.com/WordPress/gutenberg + c) WordPress-Android: https://github.com/wordpress-mobile/WordPress-Android + d) WordPress-iOS: https://github.com/wordpress-mobile/WordPress-iOS + +2. Ensure that your forked repos contains the PR labels specified below: + a) Gutenberg Mobile: "release-process" + b) Gutenberg: "Mobile App - i.e. Android or iOS" + +3. Ensure that each of your repos contains the target branch `trunk` + +To run commands against the forked repos, set `GBM_WORDPRESS_ORG` and `GBM_WPMOBILE_ORG` as environment variables to user GitHub username. By default, these values with be WordPress and WordPress-Mobile, respectively. + +Example command: + +``` +GBM_WPMOBILE_ORG=yourusername GBM_WORDPRESS_ORG=yourusername go run main.go release prepare gb 1.109.0 +``` + From e877a8090d84b02b3ceff49310f552767277557f Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Fri, 3 Nov 2023 16:10:14 +1000 Subject: [PATCH 10/11] Update Testing.md --- cli/Testing.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/cli/Testing.md b/cli/Testing.md index f0e16c7..d06d330 100644 --- a/cli/Testing.md +++ b/cli/Testing.md @@ -6,18 +6,19 @@ If developing with VSCode, tests can be run inline within the test files themsel The CLI tool can be run against forked repos for testing. To configure your forked repos: 1. Fork the following repos to your github user repo: - a) Gutenberg-Mobile: https://github.com/wordpress-mobile/gutenberg-mobile - * .gitmodules on CURRENT_BRANCH should reference your gutenberg fork, replace 'WordPress' with GITHUB_USERNAME - * (https://github.com/wordpress-mobile/gutenberg-mobile/blob/trunk/.gitmodules) - b) Gutenberg: https://github.com/WordPress/gutenberg - c) WordPress-Android: https://github.com/wordpress-mobile/WordPress-Android - d) WordPress-iOS: https://github.com/wordpress-mobile/WordPress-iOS - -2. Ensure that your forked repos contains the PR labels specified below: + - [Gutenberg-Mobile](https://github.com/wordpress-mobile/gutenberg-mobile) + - [Gutenberg](https://github.com/WordPress/gutenberg) + - [WordPress-Android](https://github.com/wordpress-mobile/WordPress-Android) + - [WordPress-iOS](https://github.com/wordpress-mobile/WordPress-iOS) + +3. Ensure that your forked repos contains the PR labels specified below: a) Gutenberg Mobile: "release-process" b) Gutenberg: "Mobile App - i.e. Android or iOS" -3. Ensure that each of your repos contains the target branch `trunk` +4. Ensure that each of your repos contains the target branch `trunk`. + +5. Ensure that [.gitmodules](https://github.com/wordpress-mobile/gutenberg-mobile/blob/trunk/.gitmodules) references your Gutenberg fork. + To run commands against the forked repos, set `GBM_WORDPRESS_ORG` and `GBM_WPMOBILE_ORG` as environment variables to user GitHub username. By default, these values with be WordPress and WordPress-Mobile, respectively. From 118f26446601f2b0cf0e4fb7d6f8a498ab8d10ed Mon Sep 17 00:00:00 2001 From: Derek Blank Date: Fri, 3 Nov 2023 16:11:23 +1000 Subject: [PATCH 11/11] Update README.md --- cli/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/README.md b/cli/README.md index 14abcd0..d8d28f1 100644 --- a/cli/README.md +++ b/cli/README.md @@ -15,6 +15,8 @@ The current features include: For detailed instructions on running a release, visit [Releasing.md](https://github.com/wordpress-mobile/release-toolkit-gutenberg-mobile/blob/cli/update-checklist/cli/Releasing.md). ## Testing +For detailed instructions on testing and configuring your development environment, visit [Testing.md](https://github.com/wordpress-mobile/release-toolkit-gutenberg-mobile/blob/cli/update-checklist/cli/Testing.md). + ## Structure