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

Merge release 2.34 into trunk #1695

Merged
merged 15 commits into from
Sep 20, 2024
Merged

Merge release 2.34 into trunk #1695

merged 15 commits into from
Sep 20, 2024

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Sep 19, 2024

%%{init: { 'gitGraph': { 'mainBranchName': 'trunk', 'mainBranchOrder': 1000, 'showCommitLabel': false }}}%%
gitGraph
   branch release/2.34
   checkout release/2.34
   commit
   commit
   commit
   branch merge/release-2.34-into-trunk
   checkout merge/release-2.34-into-trunk
   commit
   checkout trunk
   commit
   commit
   merge merge/release-2.34-into-trunk
Loading

cc @Automattic/apps-infrastructure to have a look at the automation changes. Context paaHJt-6Zx-p2

@@ -169,64 +169,6 @@ platform :android do
trigger_release_build(branch_to_build: release_branch_name)
end

desc 'Updates store metadata and runs the release checks'
lane :finalize_release do |skip_confirm: false|
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to release.rb

@dangermattic
Copy link
Collaborator

dangermattic commented Sep 19, 2024

1 Message
📖 This PR has the Releases label: some checks will be skipped.

Generated by 🚫 Danger

environment: { RELEASE_VERSION: release_version }
)
end
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

base: base_branch,
labels: 'Releases'
)
def create_backmerge_pr!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think of what I did here?

  • create_backmerge_pr! does exactly what is says, returns the URL of the PR or crashes if something went wrong. This allows callers to declare they expect a single backmerge PR, like in this repo for a code freeze or a release finalization.
  • create_backmerge_prs! below allows for more backmerge PRs, like when we finalize a hotfix. It also has the ! suffix because if something goes wrong it will call UI.user_error!

Copy link
Contributor

Choose a reason for hiding this comment

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

I wrote a short comment about this in another PR but I guess it got lost amidst all PRs and discussions currently happening.

My main question is whether we can be sure the validation on create_backmerge_pr! is guaranteed to be semantically correct, meaning: I think there may be cases when a previous release might take a bit longer or there is a hotfix in progress, then you "unexpectedly" will have a backmerge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see... 🤔

So, for example if finalize_code_freeze for 1.2 runs when 1.1 hasn't landed yet? Or if we are code freezing 1.2 while 1.1.1 is still in progress?

I'm tempted to say that 1) that should not happen because one should not run a code freeze before having finalized the previous release and 2) the action should only create backmerges in branches that are from later releases (e.g. 1.2.1 or 1.3). That to me suggests that if we have more than one backmerge then something went wrong and we should abort.

Having said that... Maybe it's best to be flexible (and account for me not being able to predict every future possible case in which this action should run) and let release manager deal with multiple backmerge PRs when only one should be there.

In fact, now that I think about it, the release manager would have to deal with them anyway because the failure implemented here is after the PRs have been created.

Here's what I might do:

  • Remove the create_backmerge_pr!
  • Move the logic to print to STDOUT annotate CI into create_backmerge_prs! (I am keen on keeping the plural form to make it clear at call site that more than one might be opened)
  • Add a warn_on_multiple_prs_opened: false parameter that lanes such as finalize_code_freeze can use to change the STDOUT and CI annotation to include a warning if more than one backmerge was create

What do you think @iangmaia ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually @iangmaia sorry I'm going to merge this before you have a chance to reply to this because I had to make a few more changes to the release branch and will need to submit a new build. As such, it's convenient to have this PR on trunk before the publish_release task will open a new integration PR (because of the new changes).

Copy link
Contributor

Choose a reason for hiding this comment

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

So, for example if finalize_code_freeze for 1.2 runs when 1.1 hasn't landed yet? Or if we are code freezing 1.2 while 1.1.1 is still in progress?

Yeah, in that case the PR would be created from 1.1.1 to 1.2 on finalize_hotfix, but I guess it's just a matter of using the plural method in this case.

In fact, now that I think about it, the release manager would have to deal with them anyway because the failure implemented here is after the PRs have been created.

Makes sense to me 👍 I'm still a bit on the fence on what's best to do but annotating a warning sounds like a good compromise.

sorry I'm going to merge this before you have a chance to reply to this because I had to make a few more changes to the release branch and will need to submit a new build

No worries!

Copy link
Contributor Author

@mokagio mokagio Sep 23, 2024

Choose a reason for hiding this comment

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

A minor followup:

Move the logic to print to STDOUT annotate CI into create_backmerge_prs! (I am keen on keeping the plural form to make it clear at call site that more than one might be opened)

I run into the case of using create_backmerge_pr expecting it to return a single URL in this Simplenote iOS build (all my own doing). There result was a buggy UX where the link to the PR in the build annotation didn't work. The reason? The markup had an array in the URL with got rendered as empty:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Following up via #1698

@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in Simplenote Android by scanning the QR code below to install the corresponding build.

App Name Simplenote Android
Build TypeDebug
Commit1030049
Direct Downloadsimplenote-android-prototype-build-pr1695-1030049-0192092f-3647-4718-ab28-2c2d10e96c08.apk

@mokagio mokagio added this to the 2.35 milestone Sep 19, 2024
@mokagio mokagio requested a review from a team September 19, 2024 07:44
source use-bot-for-git wpmobilebot

echo '--- :git: Checkout Release Branch'
.buildkite/commands/checkout-release-branch.sh
Copy link
Contributor Author

@mokagio mokagio Sep 19, 2024

Choose a reason for hiding this comment

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

I plan to followup with a dedicated PR that surfaces RELEASE_VERSION here and remove reading it from the environment in the script.

I think by doing that we might also make the script more portable and possibly move it to the CI plugin. Being such a simple script, I wonder what's the value, but then again, it would make the implementation, the error handling, and the messages it print consistent across project, which I think is desirable for us.

It would also make the implementation consistent with the recent changes accessing RELEASE_VERSION in the pipeline command that we made in some iOS projects.

@mokagio
Copy link
Contributor Author

mokagio commented Sep 20, 2024

Admin merging as discussed above, #1695 (comment)

@mokagio mokagio merged commit f0c98fa into trunk Sep 20, 2024
19 checks passed
@mokagio mokagio deleted the merge/release-2.34-into-trunk branch September 20, 2024 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants