feat(github): add client-side pull request merge option#8204
Conversation
49e6d51 to
0512748
Compare
|
Rebased on upstream |
|
Awesome thanks for the pullrequest.
I am wondering if we couldn't expose a parameter to keep a pull request open for a specific amount of days so Updatecli wouldn't try to merge a pull request right after creating it. But it's already great that it won't try to merge a pullrequest with failing requirements |
|
Don't worry to maintain this pull request up to date for now, I would like to test it manually |
|
Thanks for the thoughtful feedback, @olblak! The idea of a In the meantime, take your time testing — happy to address any findings! |
0512748 to
5c70ed0
Compare
|
Rebased on upstream |
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Pull Request action option to merge PRs directly via the GitHub GraphQL API (“client-side merge”), intended to bypass GitHub’s server-side auto-merge limitations (paid plan / public repo constraints).
Changes:
- Introduces
clientsidemergein the GitHub PR action spec (ActionSpec) to trigger an immediate merge after PR creation/update. - Adds a
mergePullRequestGraphQL mutation wrapper and aPullRequest.MergePullRequestmethod. - Updates
CreateActionto callMergePullRequestwhenclientsidemerge: true.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Please note that I am making a suggestion to use nested merge parameter, not mandatory but I am wondering if it looks better. So it would mean deprecating To deprecate automerge if we could simplify change this line to a pointer of string. Then if nil then we set |
5c70ed0 to
11568ed
Compare
|
Thanks for the detailed feedback, @olblak! I've addressed all three points in the latest commit (11568ed):
Take your time testing — happy to address any further findings! |
Add a new 'clientsidemerge' option to the GitHub action spec that allows
updatecli to merge a pull request directly via the GitHub GraphQL API
(mergePullRequest mutation), bypassing the need for server-side auto-merge
which requires a paid plan or a public repository.
When 'clientsidemerge: true' is set, updatecli will attempt to merge
the pull request immediately after it is created or updated. The merge
will fail if the PR is not in a mergeable state (e.g. has conflicts or
failing required checks).
The merge method is controlled by the existing 'mergemethod' field and
defaults to GitHub's default ('MERGE') if not specified. The
'usetitleforautomerge' flag is also respected to set a custom commit
headline for squash and rebase merges.
Fixes updatecli#2312
- Replace ClientSideMerge bool with nested Merge.Strategy/After fields - Deprecate AutoMerge bool -> *bool with migration warning to merge.strategy: auto - Add merge.after support to delay client-side merge by a configured duration - Minimize mutationMergePullRequest response struct (Copilot suggestion) - Guard nil rateLimit before calling Pause() in MergePullRequest - Add CreatedAt field to PullRequestApi
11568ed to
105465d
Compare
|
Rebased on upstream |
|
Rebased on upstream |
…i#8155) * feat: add PyPI resource and pyproject autodiscovery plugins Add Python ecosystem support to updatecli with two new plugins: - pypi resource: queries PyPI JSON API for package versions, with PEP 440 to semver normalization (a/b/rc pre-releases), private registry support (Bearer token), and yanked version filtering. - pyproject autodiscovery: discovers pyproject.toml + uv.lock pairs, parses PEP 508 dependencies, generates manifests using pypi source and uv add shell target. Named pyproject (alias python/uv) for multi-PM extensibility following the npm pattern. Signed-off-by: Loïs Postula <lois@postu.la> * fix: cursor comments --------- Signed-off-by: Loïs Postula <lois@postu.la>
* use constants for merge client strategy * add closing pullrequest in cleanAction * set default value to 24h for auto merge client * correctly fallback from automerge setting to either manual or auto Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
…tecli into feat/github-client-side-merge
|
Thanks for the pullrequest, I run some tests and it worked almost as expected. My last commits added the missing parts
|
|
Especially the default waiting time to 24h, I know it's an arbitrary value, but I think it's better to have some waiting by default |
|
Thansk @LeC-D for the pr |
Fix #2312
Add a new
clientsidemergeoption to the GitHub action spec that allows updatecli to merge a pull request directly via the GitHub GraphQL API (mergePullRequestmutation), bypassing the need for server-side auto-merge which requires a paid plan or a public repository.Changes
ClientSideMerge boolfield toActionSpecinpkg/plugins/scms/github/pullrequest.gomutationMergePullRequestGraphQL mutation structMergePullRequest(retry int) errormethod onPullRequestCreateActionnow callsMergePullRequestwhenclientsidemerge: trueUsage
The merge method is controlled by the existing
mergemethodfield. Theusetitleforautomergeflag is also respected for custom commit headlines on squash/rebase merges.Unlike
automerge(server-side), this performs the merge immediately — it will fail if the PR is not in a mergeable state (conflicts, pending required checks, etc.).Test
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
This approach merges immediately without waiting for CI checks to pass. Users should be aware that enabling
clientsidemergewithout required branch protection rules could merge a PR with failing tests.Potential improvement
A future improvement could add a polling mechanism to wait until all required checks pass before attempting the merge (similar to what
gh pr merge --autodoes).