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

[FEAT]: Add support for Merge queue on github. #1481

Open
1 task done
bhargavms opened this issue Jan 12, 2023 · 22 comments
Open
1 task done

[FEAT]: Add support for Merge queue on github. #1481

bhargavms opened this issue Jan 12, 2023 · 22 comments
Labels
Status: Blocked Some technical or requirement is blocking the issue Type: Feature New feature or request

Comments

@bhargavms
Copy link

Describe the need

Github has come up with this new feature called merge queues I don't see any configuration support for this from the terraform provider. Please add this into the terraform provider for github.

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bhargavms bhargavms added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Jan 12, 2023
@nickfloyd nickfloyd added the Status: Up for grabs Issues that are ready to be worked on by anyone label Jan 12, 2023
@kfcampbell
Copy link
Member

@bhargavms is there an associated API you could link?

@zepeng811
Copy link

merge queue is now in public beta, it would be great if our provider can support this feature.

@morremeyer
Copy link
Contributor

The API documentation does not contain any information about merge queues yet: https://docs.github.com/en/rest/branches/branch-protection?apiVersion=2022-11-28#update-branch-protection
However, the go module seems to have some form of support? https://github.com/google/go-github/blob/ab8b241add175a45ea24db294e035f2580e55853/github/repos.go#L881

@dzmitry-lahoda
Copy link

I do not see parameters in Go code to fine tune queue, only to enable kind of. If that works, I am fully happy with default parameters it sets to queue. It is already works little better than Mergify and we switched. Will donate equivalent of 42 USD in crypto for feature which enable/disable queue.

@nikwotton
Copy link
Contributor

Merge queue is now officially released, though I don't see an update to the API documentation yet unfortunately.

@kfcampbell kfcampbell added Priority: Normal Status: Blocked Some technical or requirement is blocking the issue and removed Status: Up for grabs Issues that are ready to be worked on by anyone Status: Triage This is being looked at and prioritized labels Jul 13, 2023
@StephenWithPH
Copy link

I think this is the API doc to watch for the non v3 / non REST Terraform resource: https://docs.github.com/en/graphql/reference/objects#branchprotectionrule , assuming that merge queue is indeed a feature of branch protection per https://github.blog/2023-07-12-github-merge-queue-is-generally-available/ .

github/roadmap#370 does not have any commentary about GraphQL changes.

https://docs.github.com/en/graphql/overview/changelog shows that there were some API changes regarding merge queues, but nothing on the branch protection resource.

@StephenWithPH
Copy link

@kfcampbell ... do you have internal visibility regarding upcoming GraphQL changes that would enable terraforming this?

@reedloden
Copy link
Contributor

https://docs.github.com/en/graphql/reference/objects#mergequeueconfiguration seems like it would be where such configuration would go, but I'm not seeing it listed under https://docs.github.com/en/graphql/reference/objects#branchprotectionrule yet. However, this is still probably enough to get a rough draft of the code written.

@kfcampbell
Copy link
Member

do you have internal visibility regarding upcoming GraphQL changes that would enable terraforming this?

I don't, sorry. A good way to request changes is by starting a discussion here.

@morremeyer
Copy link
Contributor

This is already tracked in https://github.com/orgs/community/discussions/50893.

I've also contacted our account rep since we're a GitHub customer. I'll keep you all updated if I get to know anything.

@kfcampbell
Copy link
Member

@morremeyer thank you for doing that!

@jstuart-ut
Copy link

jstuart-ut commented Aug 4, 2023

@morremeyer any word on the outlook for this config update ?

We're looking to make some selective use of 'merge queue' as well, would love to see it surfaced (and captured) as a top-level configuration option for repos, if possible 😁

@morremeyer
Copy link
Contributor

Nothing yet, I'll update here as soon as I know more.

@mering
Copy link

mering commented Aug 7, 2023

GitHub has GraphQL support planned (but no REST support). I guess this would be sufficient as other parts are already using the GraphQL API via https://github.com/shurcooL/githubv4?

@fitz-res
Copy link

fitz-res commented Aug 8, 2023

@mering what roadmap issue are you referring to?

@mering
Copy link

mering commented Aug 8, 2023

@fitz-res our GitHub account rep told me. Unfortunately nothing public to follow and no ETA yet.

@scruplelesswizard
Copy link

scruplelesswizard commented Aug 24, 2023

Looks like Github has exposed the relevant resources on the GraphQL API now:
MergeQueue
MergeQueueConfiguration
MergeQueueEntry
MergeQueueEntryConnection
MergeQueueEntryEdge
AddedToMergeQueuEvent
RemovedFromMergeQueueEvent

@kfcampbell
Copy link
Member

That's awesome news! Pull requests are very welcome for this feature.

@zhpeng811
Copy link

I'm trying to implement this feature for the provider since above comment mentioned the merge queue resources was added to the GraphQL API, but came to a realization that the CreateBranchProtectionRuleInput and UpdateBranchProtectionRuleInput input objects currently does not support merge queue configurations.

Raised a product feedback to the community at: https://github.com/orgs/community/discussions/77614
Would appreciate some upvotes to increase the awareness

@siddharthab
Copy link

@zhpeng811 At least Repository Rulesets now support merge queues (through, e.g. UpdateRepositoryRulesetInput -> RepositoryRuleInput -> RepositoryRuleType).

It seems like rulesets are being encouraged over branch protection in general. Might it make sense to only target rulesets for supporting merge queues?

Also, note the following bugs (possibly related) currently crash Terraform if we enable merge queues outside of Terraform and then continue to use Terraform.

google/go-github#3098
#2192

@zhpeng811
Copy link

zhpeng811 commented Mar 12, 2024

@siddharthab thanks for the reply (and finding the go-github bug)!

Indeed it seems like RepositoryRuleType supports merge queue as a type, but seems like RuleParametersInput don't have merge queue supported as an input. So we might be able to simply enable/disable merge queue with that but unable to change any configurations (I did not test it out so don't take my word for it), but still only for the ruleset.

Ruleset is a fairly new concept in GitHub, on GitHub's documentation page it mentioned Rulesets work alongside any branch protection rules and tag protection rules in a repository. so I think it's worth a try (pending the issue mentioned above is resolved) while we are still waiting for GitHub to generally support merge queue in both their REST and GraphQL APIs

@zepeng811
Copy link

attaching a GitHub blog for configuring merge queue with ruleset (in public beta): https://github.blog/changelog/2024-02-27-repository-rules-configure-merge-queue-rule-public-beta/

they stated this limitation:

The merge queue rule cannot be configured via an API. This feature will be available in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Some technical or requirement is blocking the issue Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests