-
Notifications
You must be signed in to change notification settings - Fork 226
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] Introduce publish_release lane #3382
Open
AliSoftware
wants to merge
4
commits into
release/7.79
Choose a base branch
from
tooling/publish_release
base: release/7.79
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+119
−79
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
See @iangmaia 's comment on the original PR about this.
release/N->main
at that stage so creation of such a PR would be expected to be skipped by thecreate_release_backmerge_pull_request
action… but given PCAndroid uses "Squash Merge", the action will detect that some commits fromrelease/N
are not present inmain
and thus still create such arelease/N->main
backmerge PR anyway.release/N
branch after thefinalize_release
happened earlier in the scenario, in practice it should be OK 99% of the time to skip the creation of thisrelease/N->main
backmerge PR. There's still a risk that a late commit that didn't warrant a resubmission (e.g. last-minute tooling fix landed afterfinalize_release
but not requiring a new run offinalize_release
after it landed because it only changed tooling, not the binary being submitted) would be lost though, but that might be an acceptable balance too?release/N->release/N+1
backmerge PR being created to make sure we include all the latest fixes of version N in version N+1 for those late fixes that might have landed after the code freeze of versionN+1
(and the creation ofrelease/N+1
branch) already happened.As a result, we might want to adjust this call to only backmerge to the next
release/N+1
branch (if it already exists at that time, which should be the case given the scenario timing)… but not tomain
?Ideally we should probably find a way to improve our
create_release_backmerge_pull_request
action inrelease-toolkit
so it can support the case of repos that are using squash-merges, so that its implementation logic to detect if such a PR is necessary would not be based on "if there are commits in therelease/*
branch not present in the merge-base ofrelease/*
andmain
", but instead based on the diff being empty or not (worth pondering if we should then do such a comparison on the two-dots vs three-dots diff and consider any potential edge cases though)In the meantime, since the current Release Scenario never mentioned creating a backmerge PR amongst the tasks of the "Release" milestone, maybe it'd be just as simple to remove that call from
publish_release
, to keep the current status quo? 🤔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 agree. I vaguely remember one of my first implementations was using the actual diff, but iinm using only the diff had its own problems. Perhaps we could combine the current implementation with that approach as well 🤔
Also to ponder, GitHub itself doesn't seem to use such approach and just creates the PR 🤷
Yep, I've decided together with the team to follow this approach for WPAndroid / WPiOS for now. Additionally, they also argued that creating a PR from this step can be somewhat unexpected for the release manager, but I guess that could be solved with either a separate step or better communication.
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 can see how it can be confuising to have a backmerge PR
release/N->trunk
be created at that stage if no new commit has landed inrelease/N
since the submission, but yet the action creates a PR nonetheless because of the repo using squash-merge and the action thus detecting commits fromrelease/N
missing fromtrunk
.But if we solve this to support the use case of repos using squash-merge (maybe just checking for the diff being non-empty in those cases indeed?), then at that point I think we should still keep the
publish_release
lane being the one doing the backmerge PRs, including because it's also the lane that ensures that therelease/N
branch is deleted once the tag has been created by the GitHub Release.We can't delete the
release/*
branch until we've made sure we created a git tag (by way of publishing the GitHub release) first, and we can't delete therelease/*
branch until we ensured that everything that was in thatrelease/*
branch has been propagated to other branches (trunk
andrelease/N+1
) first (either by a merge-commit or by a squash-merge), otherwise for the very rare cases where we might have added a commit post-finalize_release
(e.g. tooling fix or similar) we risk losing that fix forever instead of it being propagated to next versions. So making this backmerge PR be done in a separateTask
in the release scenario might not be practically possible as therelease/*
branch would have already been deleted by the previous task callingpublish_release
at that point.But as long as we manage to make the
create_release_backmerge_pull_request
action properly detect when a PR is not necessary on repos using squash-merge like it does for repos using merge-commits, in 95% of cases there won't be a PR created atpublish_release
stage anymore so that won't create some unexpected surprise for the release manager, all while ensuring that in the rare cases where it would be necessary to create the PR to ensure not to lose post-submission (tooling?) fixes, it is still done.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 think that's the main point: making the action work properly for repos with a squash merge policy.
The PR(s) creation during release publishing (or eventual breakdown into different Rv2 tasks, or a better task description to the release manager, etc) can be a separate discussion.