Closed jhnstn closed 9 months ago
Looks good! I was able to run through all of the patch scenarios successfully. I think I encountered a regression with the
prepare all
command, however:➜ yes | GBM_WPMOBILE_ORG=derekblank GBM_WORDPRESS_ORG=derekblank go run main.go release prepare all 1.110.0 [INFO] Preparing Gutenberg for release 1.110.0 [INFO] Cloning Gutenberg to /var/folders/xk/xmtl5xjx33v_bp94749wm0j00000gn/T/gbm-2609010841/gb Cloning into '.'... warning: Could not find remote branch to clone. fatal: Remote branch not found in upstream origin [ERROR] error cloning the Gutenberg repository: exit status 128
This happens on both the main repos and my forked repos. I think this might be coming from
build.Base.Ref
. Isprepare all
still a command, or should we run them individually asgb
andgbm
? If we're running them individually, we should removeall
and update the docs.
Ah thanks for checking that @derekblank ! I forgot to update the all command. I can push a fix.
@derekblank I fixed the regression in https://github.com/wordpress-mobile/release-toolkit-gutenberg-mobile/pull/212/commits/696857cbc0f2f1859b26ebb875da6acdde82abad
Fixes #153
This updates the
prepare gb
command to accept patch versions (e.g. 1.1071) and aprs
flag to pass a comma separated list of PRs on gutenbergIf the command recognizes a patch release it will branch of the prior release and then attempt cherry pick the merge commits from the passed in PRs.
If there is a merge commit the script will prompt to resolve the merge commit in the users default
$EDITOR
. ifEDITOR
is not set, the script will prompt for a command to open the conflicting files (e.g.vim
orcode
)Once the branch is prepared the script will prompt to edit the changelog since the changelog might not accurately reflect the changes in the patch.
Testing
This is difficult to completely verify with out getting noisy on the Gutenberg repo. Also this is difficult to set up on forked repos. I suggest using the
WordPress/gutenberg
to test but just make sure to exit the script when prompted to create the pr i.e. a this prompt "Ready to create the PR on WordPress/gutenberg? [y/n]"I also found it is easier to verify the scripts correctness by trying to recreate existing patch releases.
Testing with merge conflicts
GBM_WORDPRESS_ORG=WordPress go run main.go release prepare gb 1.103.2 --no-tag --prs=54281
to recreate the1.103.2
release (use the --no-tag just in case the PR does get created)Testing with multiple PRs
GBM_WORDPRESS_ORG=WordPress go run main.go release prepare gb 1.103.2 --no-tag --prs=54281,54096
Verifying the branching (also test with out merge conflicts)
GBM_WORDPRESS_ORG=WordPress go run main.go release prepare gb 1.107.1 --prs=55613 --no-tag --keep
cd
into the temporary directorygit reflog
rnmobile/1.107.0
It should look something like :Testing the editor prompt
EDITOR= GBM_WORDPRESS_ORG=WordPress go run main.go release prepare gb 1.107.1 --prs=55613 --no-tag
to nil out$EDITOR
vim
,code
ornano
Regression
Note : There is no verification that a merge conflict was correctly resolved. I suspect most conflicts will be in the change notes so the last verification step should surface any issues with that file.
Note: The editor prompts have only been tested with
vim
,code
andnano
but in theory any command that takes a list of files should work.