-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix(hack): various fixes & improvements to cherry-pick script #12714
Merged
terrytangyuan
merged 11 commits into
argoproj:main
from
agilgur5:fix-cherry-pick-script
Feb 29, 2024
Merged
fix(hack): various fixes & improvements to cherry-pick script #12714
terrytangyuan
merged 11 commits into
argoproj:main
from
agilgur5:fix-cherry-pick-script
Feb 29, 2024
Conversation
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
- the commits were being cherry-picked as most recent first, then least recent, when it should be the other way around - use `tac` (reverse `cat`) to flip this Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
- the line `commit=$(grep -q "$(echo "$m" | prNo)" /tmp/prs && echo "${m:0:9}")` could error out when `grep` had an error, which would fail the script since `set -e` is set - it was also duplicated in the `if` branch - instead, skip / `continue` when that has an error and simplify the rest of the logic Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
- make the function names more explicit and as one might name them in a full programming language, using `get*` prefixes - correct relative location of the docs - reduce nesting by removing the `else` Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
- the flag is specifically made for backporting Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
- unfortunately, cherry-picking onto a different branch is not currently possible, per the in-line comment Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
agilgur5
added
the
area/contributing
Contributing docs, ownership, etc issues & PRs
label
Feb 29, 2024
terrytangyuan
approved these changes
Feb 29, 2024
For reference, since this script is not on the cp hack/cherry-pick.sh /tmp/cherry-pick.sh
git checkout release-3.5
. /tmp/cherry-pick.sh |
agilgur5
added a commit
that referenced
this pull request
Apr 10, 2024
(cherry picked from commit 7ba20fe)
Due to the above, I backported this to |
isubasinghe
pushed a commit
to isubasinghe/argo-workflows
that referenced
this pull request
May 6, 2024
isubasinghe
pushed a commit
to isubasinghe/argo-workflows
that referenced
this pull request
May 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/build
Build or GithubAction/CI issues
area/contributing
Contributing docs, ownership, etc issues & PRs
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.
Motivation
As Isitha and I now have Approver permissions and were working on the release rotation per #12592, we both used the script and both found some issues, one of which was mentioned in #11997 (comment)
Fix a few bugs in the script and make it more ergonomic
Modifications
bugfixes
tac
(reversecat
) to achieve thismisc improvements
enable dry-run by default, for safety and simplicity (the arg is now optional)
add flags to
git cherry-pick
-Xpatience
to run the slowerpatience
diff strategy for hopefully less merge conflicts-x
to add "(cherry picked from commit ...)"other improvements:
set -eu
-- this only needs to be set once in the scriptget*
functionselse
Verification
Run
./hack/cherry-pick.sh release-3.5 fix
in a few variations