-
Notifications
You must be signed in to change notification settings - Fork 762
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
Graphql / Uplift branch_protection resource #337
Graphql / Uplift branch_protection resource #337
Conversation
Unfortunately it seems as though v3 has continued to provide some newer features - see #305. I'll do some testing to see whether conditionally updating branch protection with the v3 API if the branch exists is a feasible solution. |
3d00be0
to
db941c0
Compare
Looks like this one kind of died, any chance we could revive it? Could really use the ability to specify patterns for branch protections! Willing to help if needed. |
@twexler Still alive. There's currently discussion on how to roll v4 resources into this provider. If you are wanting something now - have a look at https://github.com/patrickmarabeas/terraform-provider-github-v4 I'm using this as a test bed for v4 resources. Documentation is certainly lacking, but happy to add to it if questions are raised. |
Not super urgent, just a nice thing to have! I saw the discussion in #83 after I wrote that message. I'd be happy to help with docs or anything else that is needed on the v4 transition! |
I'm hoping to cut a new release with the incremental GraphQL changes accumulated so far. What are thoughts around deferring this uplift to another release? I am unclear on the confidence of what is outlined in this PR, but happy to resolve conflicts and merge if this approach is still favoured. |
Yes, further work is required on this PR. |
db941c0
to
d0f95ec
Compare
👍 this PR is extremely useful to fill in the gaps of missing v3 API stuff |
Apologies, haven't had the time recently to focus on getting this squared away. |
8430e4b
to
2e39980
Compare
Uplifting the tests at the moment, but it would be good to have a review on the changes to the parameters and what not. There is no available v3 API endpoints to add the missing functionality ( |
2e39980
to
5ccc094
Compare
5ccc094
to
237d79f
Compare
I've pulled the uplifted resource into its own files to avoid merge hell, and commented out the legacy files. This can be corrected when it's ready to be merged. |
* Uplift branch_protection resource to use v4 API * Add state migration for branch_protection v0 to v1 * Update test for branch_protection resource * Update README for branch_protection resource
8146cda
to
2d1e571
Compare
🥇 for patience on seeing this one through. I'll merge this shortly and plan to follow on with a few commits to:
|
Awesome, great to have this in! Just an FYI for the future, you can squash |
Why is this change not in the release notes as breaking change or updated in the docs? |
@patrickmarabeas in v3, you could specify |
Yeah, this being listed as an enhancement for 3.1.0 instead of a breaking change seems like a mistake? |
pushActors = append(pushActors, a.Actor.Team.ID.(string)) | ||
} | ||
if a.Actor.User != (Actor{}) { | ||
pushActors = append(pushActors, a.Actor.Team.ID.(string)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a bug? Should it instead be:
pushActors = append(pushActors, a.Actor.Team.ID.(string)) | |
pushActors = append(pushActors, a.Actor.User.ID.(string)) |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be rectified in #819
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just seen your comment—there's a more complete fix (since the copy-paste error propagated) in #824.
This resolves issue caused by moving to use the v4 API for this resouce, as part of provider version: 3.1.0 Issue: integrations/terraform-provider-github#908 Provider bump: integrations/terraform-provider-github#337 Signed-off-by: Stefan Wessels Beljaars <[email protected]>
Uplifts the branch_protection resource to use v4 API.
API surface has changed slightly.
Migration function only worries about:
id
from repository name to the current branch protection's global object IDnotes: