-
Notifications
You must be signed in to change notification settings - Fork 751
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
Comments
@bhargavms is there an associated API you could link? |
merge queue is now in public beta, it would be great if our provider can support this feature. |
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 |
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. |
Merge queue is now officially released, though I don't see an update to the API documentation yet unfortunately. |
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. |
@kfcampbell ... do you have internal visibility regarding upcoming GraphQL changes that would enable terraforming this? |
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. |
I don't, sorry. A good way to request changes is by starting a discussion here. |
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. |
@morremeyer thank you for doing that! |
@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 😁 |
Nothing yet, I'll update here as soon as I know more. |
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? |
@mering what roadmap issue are you referring to? |
@fitz-res our GitHub account rep told me. Unfortunately nothing public to follow and no ETA yet. |
Looks like Github has exposed the relevant resources on the GraphQL API now: |
That's awesome news! Pull requests are very welcome for this feature. |
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 |
@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. |
@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 |
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:
|
Does not work for merge queue settings due to missing GitHub API support, see integrations/terraform-provider-github#1481
some updates as I've been following closely on GitHub's API updates: repository rulesets - graphQL API have provided support for enabling/disabling merge queue: https://docs.github.com/en/graphql/reference/enums#repositoryruletype (search repository rulesets - REST API currently still have no support for merge queue: https://docs.github.com/en/rest/repos/rules?apiVersion=2022-11-28#create-a-repository-ruleset (REST API is currently what we use for this provider: https://github.com/integrations/terraform-provider-github/blob/main/github/resource_github_repository_ruleset.go) |
as of Aug 5, looks like merge queue support have been added to REST API with full parameter support. |
@zhpeng811 will somebody start working on this now? |
@icep87 I will look into the implementation soon, but this issue still considered blocked until google/go-github releases the next major version ( |
@zepeng811 I already pulled go-github@master to get this working early for our own use, opened a PR here that I'll rebase once the SDK gets released. LMK if any other changes would be needed in addition to the rebase. |
thanks @MXfive for getting this started, I added some early comments to your PR based from what I currently have locally. Happy to discuss this further. |
Addressed your comments @zepeng811, should be good to mark for review once the SDK is released now hopefully. |
https://github.com/google/go-github/releases/tag/v65.0.0 was released today, coordinating with the assignee of the existing upgrade for v63 -> v64 in #2358 for the upgrade. |
Already rebased mine with v65 to check, all looks good. Will do again once #2358 merges. |
@zepeng811 & @MXfive #2358 has been merge now. Can you continue with rebase and maybe this can get merge soon. |
still pending review from the maintainers on #2380 to close this issue |
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
The text was updated successfully, but these errors were encountered: