-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fails to backport clean cherry-picks #110
Comments
Logs:
|
Is it using $ go run ./contrib/backport --version v1.21 --no-push 27503
* Backporting 27503 to origin/release/v1.21 as backport-27503-v1.21
* `git fetch origin main`
* `git fetch origin release/v1.21`
* Current branch is main
* Branch backport-27503-v1.21 already exists. Checking it out...
* Attempting git cherry-pick 08efeb5cdc22d21b5ef12cc540727594a22062d1
git cherry-pick 08efeb5cdc22d21b5ef12cc540727594a22062d1 failed:
On branch backport-27503-v1.21
Your branch and 'origin/release/v1.21' have diverged,
and have 137 and 73 different commits each, respectively.
You are currently cherry-picking commit 08efeb5cdc.
(all conflicts fixed: run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
nothing to commit (use -u to show untracked files)
Unable to backport: git cherry-pick 08efeb5cdc22d21b5ef12cc540727594a22062d1 failed: exit status 1 I've now made a simple bash script that works, but it also does not amend either: backport() {
if [ $# -eq 0 ]; then; echo "backport PR VER"; return 1; fi
PR="$1"
VER="$2"
git checkout "release/v$VER"
git reset --hard "origin/release/v$VER"
git branch -D "backport-$PR-$VER"
git checkout -b "backport-$PR-$VER"
HASH="$(curl -sH "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/go-gitea/gitea/pulls/$PR" | jq -r .merge_commit_sha)"
git cherry-pick "$HASH"
} |
go-gitea/gitea#27501 was also clean cherry-pick which I backported with this bash script now. |
Contributed the script in go-gitea/gitea#27519. |
How it backports Lines 44 to 92 in aab91a4
|
Why does the log not show any error? |
Maybe this Lines 78 to 84 in aab91a4
I would make it throw an error on any command failure, much better than returning |
Overall I think the bot should make use of https://github.com/go-gitea/gitea/tree/main/contrib/backport, so that the backporting mechanism can be tested locally in the repo as well. Likely that script needs a few adjustments as mention in the PR. Edit: go-gitea/gitea#27520 will make that script much less error-prone. |
After go-gitea/gitea#27520, we could make the backporter use this script to cherry-pick. Imho, is is much better to having something that can be ran and debugged locally and we will only have one way to apply backports instead of two. |
go-gitea/gitea#27752 likely another case of a 1-line change not being backported. |
Another case: go-gitea/gitea#29106 (comment) This is what I did locally and it worked fine: git checkout release/v1.21
git reset --hard origin/release/v1.21
git checkout -b backport-29106-29111
git cherry-pick 9c39f85
git cherry-pick c7a21cb
git push silverwind backport-29106-29111 Maybe we could add some debug info in a |
Sure, send a PR, I will review it |
I think the bot currently can not successfully do any backport onto |
So I think I will write a new backport script in bash, commit it to repo and we let the bot use it. Much easier to debug than running the commands individually through deno and we show the exact output from the script as well in the bot message when it fails. Likely also remove |
Sure, send a PR, I will review it |
go-gitea/gitea#27503 is a clean cherry-pick against both 1.21 and 1.20, but the bot failed for unknown reasons. Here's how I do it, maybe the bot tries it differently?
The text was updated successfully, but these errors were encountered: