You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[DOCS]: Behaviour change in 6.12.1 vs 6.11.1 #3434
THere's a side effect related to #3233 or maybe its related ones such that if you have github_repository_collaborators configured, for a personal, public repository
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀
@stevehipwell I haven't looked at the code, but I just realized that we don't seem to have any collaborator tests for the individual user account use-case 😬
This might have been missed by accident. And TBH the behaviour doesn't look like what we'd want
@deiga testing collaborators is painful as the GitHub TOS doesn't allow someone to have multiple accounts. We still should have tests written and automated where possible, but they're likely to only be possible to run locally with some coordination between users.
RE this issue, the logic for user collaborators still doesn't look right. I think we need to add an extra plan modifier step to resolve this as the only drift should be on the computed invitations and this should just be on refresh.
@quotidian-ennui is your user being assigned to the repo indirectly?
@stevehipwell
The repo belongs to my user... i.e. the repo in question is quotidian-ennui/gh-my (for the purposes of the example).
It feels like what you've done with the change isn't wrong but is a side-effect of how collaborators actually work behind the scenes. The repository owner is implicitly treated as a collaborator by github internals, just with admin privileges and the way you've refactored exposes that.
(which is why I thought it might be a documentation issue, rather than an issue issue).
@quotidian-ennui it's very much a bug that the plan is showing the users being removed only to have them recreated in the apply. Could you please add yourself to the resource with the correct admin permissions to see if it still churns?
@deiga I suspect that this wasn't tested on a non-org repo where the owner wasn't included, I reckon we could tighten the code up to get rid of the diff. We probably need some logic to check if an unmapped user is the repo owner and treat them the same way we do for ignore teams.
The behavioural change isn't a problem, but it needs to be made clearer.
@quotidian-ennui we ought to be able to fix this is code. At least the non-owner user shouldn't be lost as this is likely to happen in other scenarios.
I wouldn't consider myself a collaborator on my own repository
In GitHub terminology you are, and like teams there is no metadata to figure out how the binding was granted.
The documentation itself states for personal repositories, you only have the write permission to grant.
c.f.
For personal repositories, collaborators can only be granted write (implicitly includes read) permission.
This sounds correct, although it looks like the API docs have lost this information. Did you experience something different?
Ok, so where I was coming from is around what I had to do to "resolve" the churn. Which is essentially to add myself, the owner of the repo, as an public collaborator, in addition to all the other collaborators that I have on the project.
you wouldn't think that you needed to add yourself as a collaborator.
you wouldn't think that admin was a suitable permission to give any one on a non-org-scoped-repository because the documentation explicitly says "you can only give 'write'"
From the point of view of the underlying github API, I understand why it is how it is, and I'm not bothered by that. If you can fix it in code in 6.13.0 then great; if you can't then it's worth just noting "there's a special case, add the repo owner with permission: admin otherwise you'll get churn. But only do that if the target repository is not organisation owned".
After all, it's quite the edge case; who would use terraform to manage their own repositories! (apart from people like me). There will be higher priority things in 6.13.0 that need tackling I'm sure.
Activity
github-actions commentedon May 16, 2026
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with
Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀deiga commentedon May 17, 2026
@stevehipwell I haven't looked at the code, but I just realized that we don't seem to have any collaborator tests for the individual user account use-case 😬
This might have been missed by accident. And TBH the behaviour doesn't look like what we'd want
stevehipwell commentedon May 18, 2026
@deiga testing collaborators is painful as the GitHub TOS doesn't allow someone to have multiple accounts. We still should have tests written and automated where possible, but they're likely to only be possible to run locally with some coordination between users.
RE this issue, the logic for user collaborators still doesn't look right. I think we need to add an extra plan modifier step to resolve this as the only drift should be on the computed invitations and this should just be on refresh.
@quotidian-ennui is your user being assigned to the repo indirectly?
quotidian-ennui commentedon May 18, 2026
@stevehipwell
The repo belongs to my user... i.e. the repo in question is quotidian-ennui/gh-my (for the purposes of the example).
It feels like what you've done with the change isn't wrong but is a side-effect of how collaborators actually work behind the scenes. The repository owner is implicitly treated as a collaborator by github internals, just with admin privileges and the way you've refactored exposes that.
(which is why I thought it might be a documentation issue, rather than an issue issue).
stevehipwell commentedon May 18, 2026
@quotidian-ennui it's very much a bug that the plan is showing the users being removed only to have them recreated in the apply.
Could you please add yourself to the resource with the correct admin permissions to see if it still churns?@deiga I suspect that this wasn't tested on a non-org repo where the owner wasn't included, I reckon we could tighten the code up to get rid of the diff. We probably need some logic to check if an unmapped user is the repo owner and treat them the same way we do for ignore teams.
stevehipwell commentedon May 18, 2026
@quotidian-ennui we ought to be able to fix this is code. At least the non-owner user shouldn't be lost as this is likely to happen in other scenarios.
In GitHub terminology you are, and like teams there is no metadata to figure out how the binding was granted.
This sounds correct, although it looks like the API docs have lost this information. Did you experience something different?
quotidian-ennui commentedon May 18, 2026
Ok, so where I was coming from is around what I had to do to "resolve" the churn. Which is essentially to add myself, the owner of the repo, as an public collaborator, in addition to all the other collaborators that I have on the project.
If you were just reading the provider docs then
adminwas a suitable permission to give any one on a non-org-scoped-repository because the documentation explicitly says "you can only give 'write'"From the point of view of the underlying github API, I understand why it is how it is, and I'm not bothered by that. If you can fix it in code in 6.13.0 then great; if you can't then it's worth just noting "there's a special case, add the repo owner with
permission: adminotherwise you'll get churn. But only do that if the target repository is not organisation owned".After all, it's quite the edge case; who would use terraform to manage their own repositories! (apart from people like me). There will be higher priority things in 6.13.0 that need tackling I'm sure.
stevehipwell commentedon May 18, 2026
#3437 aligns the docs to the current behaviour.