MeeseeksDev
MeeseeksDev copied to clipboard
backport-main label does not auto backport
Hello and thanks for this very useful bot. We have a workflow where we forward-port change log from a release branch back to main at release time. Hence, we created a backport-main label (see https://github.com/astropy/astropy/labels) with the auto backport directive. However, the auto backport does not work, though the manual comment does. Example:
- https://github.com/astropy/astropy/pull/16381
cc @astrofrog
Hum, I only have 48 hours of logs, so can't look at it after the fact. Sorry about that, I'll try to experiment on test-repo.
@Carreau it has just happened again today in case you are able to spot it in the logs (for astropy)
He did say the logs only go for 48 hours and your issue is 2 days old, so unlikely.
Hmm yes sorry misremembered, time flies!
Sorry, I was on time-off and did not check github for a few days.
Just a heads-up that I will soon be merging a PR labelled backport-main: https://github.com/astropy/astropy/pull/16911 (in a few hours)
I just merged the PR at 11:58 GMT
Requested a manual backport at 12:52 GMT (this succeeded)
So I think 2 things need addressing for this label to work properly.
backport-mainshould automatically open a PR tomainwhen it detects merge event from a PR that is not opened againstmain.- On a PR with
backport-mainlabel that is opened againstmain(currently possible via the bot via commentbackport to main), it should not try to backport that backport PR tomainagain on merge. Currently it does and then post an error message comment, unless I removebackport-mainlabel before merge.
I wonder if the issue here is that the PR for which we want backport-main to work is not merged into main but into a release branch - perhaps the bot only watches for PRs opened again main?
I wonder if the issue here is that the PR for which we want
backport-mainto work is not merged intomainbut into a release branch - perhaps the bot only watches for PRs opened againmain?
It is quite possible, otherwise as the backported PRs get the same labels applied than the original one, merging a backport would trigger an infinite loop.
There is likely a smarter way to do that, but I did not look into it.
Maybe the logic here (or around here)
https://github.com/scientific-python/MeeseeksDev/blob/8e8161777506d8a8b6692d69fbf8d152d392f694/meeseeksdev/meeseeksbox/core.py#L354-L357
can be generalized to something like
- Grab the base ref branch no matter what.
- Check for target branch in label description.
- If base ref same as target, no-op and quit.
- Otherwise, attempt backport as usual.
but I don't know the code enough to make a PR and it does not look like I can just do a few lines simple change at that location.
OR
You can also say that we're abusing a backport bot to do forwardport and just close this as won't fix. Though would be nice to have this limitation documented at https://meeseeksbox.github.io/ if this is what you choose to do.
Thanks!