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
[MAINT]: actor_id for OrganizationAdmin seems to have changed from 1 to 0 #2536
It seems the actor_id used internally in Github for OrganizationAdmin changed from 1 to 0.
Changing my configurations from 1 to 0 again leads to "no changes" detected as expected.
Applying with the 1 still present did not lead to any errors, so I would assume this is not a breaking change related to creating/updating this kind of resources.
I guess for this project the main impact would be that the documentation would need to be updated to refer to 0 instead of 1.
SDK Version
No response
API Version
No response
Relevant log output
No response
Code of Conduct
I agree to follow this project's Code of Conduct
Reacted by a-ortuno, Daniel Sečík, ZdenekPesek, Frank van Boven, Adrian Kuepker, Austen Constable, Laco, Julian Mehnle, Albin Rönnkvist, Lucas Zamboulis and 1 more
Yes, I've noticed that in some places the null values are represented as 0 in the models for simplicity. But if not handled correctly on the api calls, it can lead to bugs like #2317
Null and 0 can have different semantics on the github api leading to validation errors when sending the wrong data.
@Danielku15 in this context if null is being treated as anything other than 0 then it's a bug as the GH Go SDK treats it as an int which can't be represented as null.
@stevehipwell True, in this context things should be fine. It appears also for me #2317 disappeared on our GHES after upgrade to 3.15. In my previous tests and troubleshooting it appeared that a 0 value on integration_id somehow sneaked through some checks and was ultimately sent to the API.
GH Go SDK uses *int64 to differenciate between null and 0 values, hence setting 0 without a check when mapping from Terraform structures to API structures can lead to problems.
GH Go SDK uses *int64 to differenciate between null and 0 values, hence setting 0 without a check when mapping from Terraform structures to API structures can lead to problems.
@Danielku15 you're right, I've been working in both the SDK and TF provider so my memory was slightly off. I'm planning on re-implementing the ruleset code once google/go-github#3430 has been merged & released. One of the things I'm planning on doing is supporting not requiring the actor ID for well known actors.
This makes noisy output in terraform plans that confuses end users. Any chance this will be fixed in the near future? google/go-github#3430 has been merged. Has it been released yet?
@deiga the simplest pattern would be to never swap 1 & 0 in state (e.g. if the current value is <= 1, either from user input or API response, then only update it if the new value is > 1). A custom diff suppression could be used but would be more complex and may have unintended consequences in the future.
The upstream API has changed actor_id to null for OrganizationAdmin which AFAIK has resolved this.
At least I've stopped seeing drift from this id after we removed it from our config
Activity
stevehipwell commentedon Jan 14, 2025
I added a comment to github/rest-api-description#4406 as this could be a regression as the GitHub API docs still explicitly say to use
1.Danielku15 commentedon Jan 14, 2025
We're on GHES 3.15.1 within my work place. After creating a ruleset manually with
OrganizationAdminadded it has"actor_id": 1.I just did the same on github.com in one of my repos, and there it has
"actor_id": null.stevehipwell commentedon Jan 14, 2025
FYI @Danielku15
nullwill be represented as0in a Goint.Danielku15 commentedon Jan 14, 2025
Yes, I've noticed that in some places the null values are represented as 0 in the models for simplicity. But if not handled correctly on the api calls, it can lead to bugs like #2317
Null and 0 can have different semantics on the github api leading to validation errors when sending the wrong data.
stevehipwell commentedon Jan 14, 2025
@Danielku15 in this context if
nullis being treated as anything other than0then it's a bug as the GH Go SDK treats it as anintwhich can't be represented asnull.Danielku15 commentedon Jan 15, 2025
@stevehipwell True, in this context things should be fine. It appears also for me #2317 disappeared on our GHES after upgrade to 3.15. In my previous tests and troubleshooting it appeared that a
0value onintegration_idsomehow sneaked through some checks and was ultimately sent to the API.GH Go SDK uses
*int64to differenciate betweennulland0values, hence setting 0 without a check when mapping from Terraform structures to API structures can lead to problems.stevehipwell commentedon Jan 15, 2025
@Danielku15 you're right, I've been working in both the SDK and TF provider so my memory was slightly off. I'm planning on re-implementing the ruleset code once google/go-github#3430 has been merged & released. One of the things I'm planning on doing is supporting not requiring the actor ID for well known actors.
fatbasstard commentedon Jan 30, 2025
Seeing the same here:
It's even a bit more annoying since we also set the
RepositoryRoletoAdmin(source) which seems to flip over the configuration even worse.sthompson0 commentedon Oct 1, 2025
This makes noisy output in terraform plans that confuses end users. Any chance this will be fixed in the near future?
google/go-github#3430 has been merged. Has it been released yet?
sthompson0 commentedon Oct 10, 2025
@stevehipwell Is setting the actor_id to 0 an appropriate local fix, or will this end up causing a bug later if this is ever addressed?
stevehipwell commentedon Oct 13, 2025
@sthompson0 this is what we've been doing since January, AFAIK there isn't another solution to this.
deiga commentedon Dec 7, 2025
My current suggestion is to "swallow" the 0 value inside the provider and just keep acting like it's
1. See: 9d22505stevehipwell commentedon Dec 8, 2025
@deiga we'd need to make this support both
0&1as I'd expect most people to have switched over to using0(we have).deiga commentedon Dec 8, 2025
@stevehipwell That's a good point! I'll check how to do that reasonably
stevehipwell commentedon Dec 8, 2025
@deiga the simplest pattern would be to never swap
1&0in state (e.g. if the current value is<= 1, either from user input or API response, then only update it if the new value is> 1). A custom diff suppression could be used but would be more complex and may have unintended consequences in the future.matheuss commentedon Mar 22, 2026
FWIW adding some evidence: on github.com/vercel, we see
nullas the actor ID:That causes every Terraform plan to try and change it to 1 indeed, as folks previously reported here 😮💨
deiga commentedon Mar 22, 2026
The upstream API has changed
actor_idto null for OrganizationAdmin which AFAIK has resolved this.At least I've stopped seeing drift from this id after we removed it from our config
fix(github): stop the perpetual OrganizationAdmin bypass diff
fix(github): stop the perpetual OrganizationAdmin bypass diff (#78)