Skip to content
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

Write script / GitHub Action for backporting #9385

Closed
The-Compiler opened this issue Dec 7, 2021 · 8 comments · Fixed by #12475
Closed

Write script / GitHub Action for backporting #9385

The-Compiler opened this issue Dec 7, 2021 · 8 comments · Fixed by #12475
Labels
status: help wanted developers would like help from experts on this topic type: infrastructure improvement to development/releases/CI structure

Comments

@The-Compiler
Copy link
Member

There is a lot of manual work involved when backporting a PR to a release branch. Ideally, that would only be required if there are conflicts to be solved.

Would be cool to have a script to prepare a backport PR. Then, as a next step, that could be integrated into GitHub Actions so that the "needs backport" label automatically causes a bot to backport the PR to the newest maintenance branch (either when a closed PR is labelled, or when a labelled PR is merged).

Maybe something suitable exists already, I can't imagine us being the only project who needs something like that. I know the Qt Company has something very similar (after I suggested it to them, though I didn't implement it). Theirs is based on their own CI and Gerrit, though.

@The-Compiler The-Compiler added the type: infrastructure improvement to development/releases/CI structure label Dec 7, 2021
@nicoddemus
Copy link
Member

Definitely!

Just to comment that there's https://github.com/peter-evans/create-pull-request to create the actual PR.

@nicoddemus
Copy link
Member

We probably can write everything in GitHub actions, without needing an auxiliary script.

For example we can trigger a workflow when a PR is merged:

https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request

closed: If the action is closed and the merged key is false, the pull request was closed with unmerged commits. If the action is closed and the merged key is true, the pull request was merged.

I have seen other projects have specific labels, say backport 7.0.x so the workflow would know to which branch it should be backported to.

@nicoddemus nicoddemus added the status: help wanted developers would like help from experts on this topic label Dec 7, 2021
@The-Compiler
Copy link
Member Author

Agreed we can do it directly via Actions - but we already have scripts for other things we run there (e.g. preparing release PRs), and it also makes it easier to test things if we can run them independently.

As for the label, I suppose we could just use the newest release branch - it's quite rare that we want to backport to an even older release.

FWIW I use the peter-evans/create-pull-request action for qutebrowser though, quite happy with it!

@nicoddemus
Copy link
Member

but we already have scripts for other things we run there (e.g. preparing release PRs), and it also makes it easier to test things if we can run them independently.

No problem. I'm not 100% convinced in this case TBH, feels like the "commands" to execute is just a single git command, and the tricky part is deciding when to trigger it, which seems easy to do directly with GitHub actions rather than implementing in a custom script which needs to call the API.

But I'm not against using a custom script if whoever implements this prefers that way of course. 😁

As for the label, I suppose we could just use the newest release branch - it's quite rare that we want to backport to an even older release.

Indeed, that's simple if we decide to use a custom script.

@bluetech
Copy link
Member

bluetech commented Dec 7, 2021

👍 👍 👍 on this.

FWIW I use the peter-evans/create-pull-request action for qutebrowser though, quite happy with it!

We use it for the periodic plugin list updates, but for some reason it has a problem where the tests don't trigger for the PRs it creates, I don't remember why.

@nicoddemus
Copy link
Member

It needs to be triggered by a Private Access Token or a GitHub bot unfortunately (there's more information on the docs for that action IIRC).

@The-Compiler
Copy link
Member Author

We mostly have done this, but @webknjaz mentioned he has a ready GitHub Action for this that solves some of the problems we have, so that might be worth exploring.

@webknjaz
Copy link
Member

has a ready GitHub Action

I have an app, not an action. But yeah, let's explore that while we're all gathered in the same space :)

@webknjaz webknjaz moved this from Todo to In Progress in pytest sprint 2024 Jun 18, 2024
webknjaz added a commit to webknjaz/pytest that referenced this issue Jun 18, 2024
This patch prepares the project's backporting process to start being
handled by the Patchback GitHub App [[1]].

Ref pytest-dev#9384
Resolves pytest-dev#9385
Resolves pytest-dev#9553
Resolves pytest-dev#9554
Resolves pytest-dev#9555

[1]: https://github.com/apps/patchback
@github-project-automation github-project-automation bot moved this from In Progress to Done in pytest sprint 2024 Jun 19, 2024
patchback bot pushed a commit that referenced this issue Jun 19, 2024
This patch prepares the project's backporting process to start being
handled by the Patchback GitHub App [[1]].

Ref #9384
Resolves #9385
Resolves #9553
Resolves #9554
Resolves #9555

[1]: https://github.com/apps/patchback

(cherry picked from commit d7b4010)
Glyphack pushed a commit to Glyphack/pytest that referenced this issue Jun 20, 2024
This patch prepares the project's backporting process to start being
handled by the Patchback GitHub App [[1]].

Ref pytest-dev#9384
Resolves pytest-dev#9385
Resolves pytest-dev#9553
Resolves pytest-dev#9554
Resolves pytest-dev#9555

[1]: https://github.com/apps/patchback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted developers would like help from experts on this topic type: infrastructure improvement to development/releases/CI structure
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants