Comments (15)
Logs:
2023-10-08T03:13:30.426 app[148ed433fe9d08] ams [info] Synced PR #27503
2023-10-08T03:13:35.518 app[148ed433fe9d08] ams [info] Set commit status in "Fix mermaid flowchart margin issue" (#27503)
2023-10-08T03:20:16.010 app[148ed433fe9d08] ams [info] Parsing #27503
2023-10-08T03:20:16.125 app[148ed433fe9d08] ams [info] Locked issue #25798
2023-10-08T03:20:16.389 app[148ed433fe9d08] ams [info] Set milestone 1.22 for PR #27503
2023-10-08T03:20:16.575 app[148ed433fe9d08] ams [info] Cherry-picking #27503
2023-10-08T03:20:17.338 app[148ed433fe9d08] ams [info] Added comment to #27503
2023-10-08T03:20:18.328 app[148ed433fe9d08] ams [info] Parsing #27503
2023-10-08T03:20:18.760 app[148ed433fe9d08] ams [info] Cherry-picking #27503
2023-10-08T03:20:19.645 app[148ed433fe9d08] ams [info] Added comment to #27503
2023-10-08T03:20:28.105 app[148ed433fe9d08] ams [info] Removed reviewed/wait-merge from "Fix mermaid flowchart margin issue" (#27503)
from gitea-backporter.
Is it using ./contrib/backport
? When I try that, it fails:
$ 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"
}
from gitea-backporter.
go-gitea/gitea#27501 was also clean cherry-pick which I backported with this bash script now.
from gitea-backporter.
Contributed the script in go-gitea/gitea#27519.
from gitea-backporter.
How it backports
Lines 44 to 92 in aab91a4
from gitea-backporter.
Why does the log not show any error?
from gitea-backporter.
Maybe this if
branch should log or throw the error?
Lines 78 to 84 in aab91a4
I would make it throw an error on any command failure, much better than returning false
and not knowing why it failed.
from gitea-backporter.
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.
from gitea-backporter.
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.
from gitea-backporter.
go-gitea/gitea#27752 likely another case of a 1-line change not being backported.
from gitea-backporter.
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 <details>
block in the bot comment to show what it did and where it failed to get to the root of this problem.
from gitea-backporter.
Sure, send a PR, I will review it
from gitea-backporter.
I think the bot currently can not successfully do any backport onto release/v1.21
. I assume once we cut release/v1.22
it will be able to again for unknown reason. I think I've seen this pattern already in the last two releases. At some point in the target branch history, it just can't do it anymore.
from gitea-backporter.
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 ./contrib/backport
as no one is really using it and it has several shortcomings.
from gitea-backporter.
Sure, send a PR, I will review it
from gitea-backporter.
Related Issues (20)
- Bug: wrong merge conflicts detection HOT 1
- Bug: Strange behaviours of Giteabot when request a review of user HOT 12
- A new label to close an issue if there are 1 month no response after the label marked. HOT 4
- Do a frontport PR when a merged PR has labeled `frontend/main` HOT 4
- Detected merge conflict wrong. HOT 2
- Incorrect milestone HOT 1
- Issues with need_feedback label is not closed even if there is no activity for over a month HOT 1
- Autoclose PRs with `pr/last-call` that have had this label for at least a week HOT 2
- No conflicts but can not send backports HOT 2
- `lgtm/blocked` not being removed on review re-request HOT 4
- Race condition while adding labels HOT 2
- Done tracking with multiple branches HOT 3
- Better comment in case of backport failure HOT 6
- Idea: Run a command on a PR branch HOT 6
- Direct users who add non-english translation changes to crowdin HOT 3
- Idea: Auto-Set labels based on modified path HOT 6
- Bug: wrong manual backport message (not always) HOT 5
- Bug: duplicated backports HOT 1
- Lock issues closed for 3 months and pull requests merged/closed for 3 months automatically HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitea-backporter.