-
Notifications
You must be signed in to change notification settings - Fork 763
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
github_team_membership reports change in team ID, then fails to recreate #323
Comments
I just ran into this as well. |
Just ran into this. |
@brendanjerwin @razorsedge @samrees Any of you have found a workaround? Perhaps specifying an older version of the provider? |
I tested a few versions back but same issue 😭 afaict There hasn't been any updates to 2.2.1 for quite some time. 🤔 I wonder if there was an update somewhere else (GH maybe) and this provider just needs to catch up to that. |
@brandoncamenisch That's also my hunch, I also took a look at the code history and didn't see changes for a while that would explain this happening now. |
This makes no sense to me. This started happening this morning, yet the code mentioned hasn't changed in 4 years. changing this does seem to fix it?
https://developer.github.com/v3/teams/members/#get-team-membership shows "teams" plural. |
I came to the same conclusion that @samrees came too and came here to post about it. I suspect that github pushed an update to their API today. Possibly thinking they were "fixing" an issue and of course broke our tool relying on this specific url pattern. I would propose that instead of changing that line from |
The pr I made removes the function that string parses the URL entirely as relying on that URL for anything other than a self referential URL is incorrect . Githubs love of hypermedia APIs is admirable but causes this kind of confusion. Most devs I've seen don't want to write a crawler to interact with an API, in which case the right answer is to throw away all the URLs returned by the v3 api. https://developer.github.com/v3/#hypermedia |
@jcudit Could you take a look at this issue? It seems like GitHub changed their API and this provider is affected. As a result |
I’ve looked and found the likely change that caused this from the GitHub side. My next steps are to get passing acceptance tests for the proposed fix. I can post an update next week if it is yet to be released by then. |
@radeksimko do you think we could get the 'quickfix' in #326 merged and released as a stop gap solution? Building a fork of the plugin isnt easily going to get into my CD pipeline... |
I've thrown this patch at the test suite. It seems incomplete as a fix:
I've got time blocked off today to continue investigating. I suspect the upstream library will need updates in response to the API change. I'll post updates here. |
Was the /teams to /team change part of the api v3 update? or did GitHub change their API string mid version? Does provider-github specify it's API version it's looking for or is it just pulling current? |
Having exactly the same problem :( This is critically effecting our organisation right now :( |
As pointed out over here, the error I pasted above is likely due to my inputs to the test case. Apologies for that misdirection. I will continue to work towards passing acceptance tests for the proposed fix. |
This is affecting us as well. I will be monitoring this issue for updates. Is there an ETA on a fix? |
Just hit by this today trying to provision a new-hire to our GH org 😢 |
This is impacting me too. Interested to see a fix. |
I'm not sure you anybody else noticed this, so I'm share my experience. I've found that because of the order of operations by the provider, that generally what I want to happen is still happening. Since the apply fails to delete after any new memberships have been created, this hans't blocked me from being able to add new members to teams, since terraform doesn't roll back. |
@radeksimko you closed this. Is it a fixed/non-issue? |
@tibbon The fix was released today as v2.3.0: |
@tibbon The new version they released fix it for me: https://github.com/terraform-providers/terraform-provider-github/releases I had to add |
Thank you! That just unblocked some stuff on my end, and it's super appreciated. Thanks for the work! |
Terraform Version
0.12.16
provider "github" (hashicorp/github) 2.2.1...
Affected Resource(s)
Behavior
We saw:
Followed by
I tested the API:
https://api.github.com/teams/123456/memberships/foobar
and got:Note the
url
attribute.The code appears to parse the team ID out of the URL returned by this call: https://github.com/terraform-providers/terraform-provider-github/blob/2c03b951bb0aadc56d5f3e9a254f464d5ee018b8/github/resource_github_team_membership.go#L116
I put together this test: https://play.golang.org/p/3GPY1x3E7N3 The team doesn't parse from the URL, just the username.
Suggestion: It would appear that the Team ID is already known: https://github.com/terraform-providers/terraform-provider-github/blob/2c03b951bb0aadc56d5f3e9a254f464d5ee018b8/github/resource_github_team_membership.go#L89 There should be no reason to parse it from the returned URL.
The text was updated successfully, but these errors were encountered: