-
Notifications
You must be signed in to change notification settings - Fork 768
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
[BUG] Unable to add github_repository_collaborators. #1658
Comments
Can you please provide an example of HCL that can be used to reproduce this issue? |
I am also seeing this. I can replicate with something as simple as:
I am using
|
Ahh, thank you! Okay so I think what's going on here is that this code is pulling the owner from the set When a repo is given with an owner present in the string, it's not used as the owner in the actual call. My vote would be to either clarify that the repo must include its owner in the string and then parse the owner out for the API call, or else add a separate owner parameter to the schema. Do you have thoughts on what the more elegant solution might be? |
A-ha! Those both sound reasonable to me. I have a slight preference for requiring owner in the I had an initial thought that it could be more flexible, supporting both |
Sounds good! I'd be happy to go the route of requiring a name with owner in the repo string and defaulting to the token owner otherwise. In a perfect world, we'd throw an error if a slash isn't present, but that would make this a breaking change. This item is up for grabs if anybody has the inclination to submit such a PR! |
@kfcampbell What do you think about something like below:
If that looks good, I am happy to create a PR with some unit tests and some documentation updates :) |
@ppatel1604 Sorry for the late reaction here; I've been on vacation recently. That sounds reasonable to me! |
Great. Can you please assign it to me. I will raise the PR soon :) |
@kfcampbell Apologies if you have spammed with the invite emails. I am working on some tests for this bug. I have copied the lunch.json from https://github.com/integrations/terraform-provider-github/blob/main/CONTRIBUTING.md#example-vscodelaunchjson-file which has your username as the Test username. I didn't realise that until now. Do we have a test user that I can used for the testing or I have to create my own? |
@ppatel1604 no worries! I did get several emails for what it's worth. You should create your own test user as we don't have a good way of sharing credentials across all contributors to this repo. |
I have tried this approach but came across some issues. With this approach, the repository name in the state file is stored without the org/owner name, but the TF file contains the repository name with the owner name. Having two different strings creates a DIFF between TF state and TF files and a forces the re-creation of the resource. Therefore, we used a different approach where we kept the attributes the same as supplied via TF file but split the values from repository strings during the api call. |
Hello,
We are trying to add github_repository_collaborators to a github_repository when we run the plan we see the outcome of what we expect/want. A team is added to a repository with the permission set maintain, but when running the terraform apply, it comes back with an API not found error.
Plan output;
Error response in the terminal;
We have updated to the latest version of Terraform Github Provider.
terraform -v
Terraform v1.4.2
The text was updated successfully, but these errors were encountered: