-
Notifications
You must be signed in to change notification settings - Fork 135
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
[Tooling] Add Release Publishing automation #12450
Conversation
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the rename suggestion, LGTM.
Important
🎗️ We obviously need to wait for wordpress-mobile/release-toolkit#585 to land first and update this PR's Gemfile
to the new version before we can land this PR
fastlane/Fastfile
Outdated
# @example Running the lane | ||
# bundle exec fastlane publish_release_and_cleanup skip_confirm:true | ||
# | ||
lane :publish_release_and_cleanup do |skip_confirm: false| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 I'm on the fence with the naming here.
On one hand I like the extra explicitness.
On the other hand, I like consistency, and our other apps (e.g. Tumblr iOS/Android and others) just call those lanes publish_release
instead. And other lanes are not as descriptive in their names either (code_freeze
, not code_freeze_then_trigger_new_beta
😅 )
So I'd say just call it publish_release
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I started with publish_release
, but realized this would clash with release-toolkit
's publish_release
.
Another option is to rename the action on release-toolkit
-- perhaps something like publish_gh_release
(but then we'd lose some consistency points with the action create_release
🤷 )?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see. Interesting.
Given some apps already use the name publish_release
for their lanes, I'd have for us having to rename the lanes (and thus potentially update the ReleaseV2 scenarios accordingly for some of those?) when we adopt the new release-toolkit
just because of the name clash.
So despite the inconsistency it'd introduce with create_release
, I think I'd prefer for us to go with the action being renamed publish_gh_release
in release-toolkit
.
And actually, we could then take the occasion to rename create_release
to create_gh_release
(and potentially making create_release
a deprecated alias for it, similar to how we did it when we renamed setbranchprotection
to set_branch_protection
in 9.4.0
before removing those backwards-compatibility-aliases in 10.0
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And actually, we could then take the occasion to rename create_release to create_gh_release (and potentially making create_release a deprecated alias for it)
Great idea! Implemented on eb321aab9ef2a7e5c2116d5a1d4355fb625938ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! Implemented on eb321aab9ef2a7e5c2116d5a1d4355fb625938ad
Glad to see this eventually became _github_
over _gh_
. Clarity++ 👨🍳 💋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AliSoftware @mokagio I've updated the PR after the release of release-toolkit 12.0.0.
8e9d219
to
64ba023
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Only nitpicks. Approving to unblock.
- If the release branch for the next version `#{next_release_branch}` already exists, backmerge `#{current_branch}` into it | ||
- If needed, backmerge `#{current_branch}` back into `#{DEFAULT_BRANCH}` | ||
- Delete the `#{current_branch}` branch | ||
PROMPT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like PROMPT
as the heredoc demarkation here 😄
fastlane/Fastfile
Outdated
|
||
create_backmerge_pr | ||
|
||
# Now that an eventual backmerge PR has created an intermediate branch, we can delete the `release/*` branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the "eventual" adjective here. It makes me think that the backmerge PR may or may not have been opened depending some factors, but looking at the code it seems that we'll always attempt it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the comment is referring to a hotfix/new version backmerge (which indeed might not happen if those don't exist), but indeed maybe it's better to clarify it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our create_release_backmerge_pull_request
action skips creating a backmerge PR if the diff is empty (or more precisely if the HEAD and BASE are pointing to the same commit). So in theory it could happen that there's no backmerge PR created when you call create_release_backmerge_pull_request
In practice, we mostly call this action after having at least bumped the version file, which means there will always be a diff in those cases and thus a PR being created.
The only case I could think where this is not necessarily true is when we call create_release_backmerge_pull_request
during publish_release
(after the build has been approved by Google and we start rollout)
- In most cases, at the time we
publish_release
on Mondays, there's nothing to backmerge again. Therelease/N
branch has already been backmerged intotrunk
duringfinalize_release
on Friday (after having done the final version bump and triggered the final build that was submitted for review) before the code freeze creatingrelease/N+1
. So at the time ofpublish_release
, there's nothing new to backmerge and no PR to create - But in the rare case when we made new commits to
release/N
after code-freeze happened—e.g. the build was rejected by Google and we needed to do a fix inrelease/N
on Monday and submit a new build for version N to address it—then we need to make sure that last-minute fix fromrelease/N
is propagated torelease/N+1
, and in such case the backmerge PR won't be empty and callingcreate_release_backmerge_pull_request
at that state will create a PR.
So, yes, in 95% of cases create_release_backmerge_pull_request
will create a backmerge PR. But in cases when we call it during publish_release
on Monday while there hasn't been any new commit on release/N
since finalize_release
the Friday before, it should be smart enough to detect that the PR would be empty (as backmerge from Friday was already done and merged) and not create one at all in that case.
To be completely honest I'm not 100% sure our logic with point_to_same_commit?
works as expected for the use case I mentioned above (because the commit from release/N
would not be the same as the head commit from the target branch as the merge commit from previous backmerge PR would have happened in-between and that one would have a different SHA…?). But at least that was the initial intent (and even if it doesn't detect those cases as initially intended, if we manage to make create_release_backmerge_pull_request
smarter in the future, it might avoid those unnecessary backmerge PRs when one has already happened and no new commit has landed in the source branch since)
…lease` action call
Co-authored-by: Gio Lodi <[email protected]>
b05b0ba
to
1a148b2
Compare
Note: I've added the commit dd12a80 using the new action name for creating a release, |
For the record, I toggled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a nitpick on the wording of the header doc
2c35992
to
8b9c160
Compare
Co-authored-by: Gio Lodi <[email protected]>
This PR automates the release publishing, which means to:
This PR will be followed by updates to the Releases V2 tool.