Repository navigation
fix: add Computed to members_can_create_internal_repositories in github_organization_settings to prevent phantom diffs - #3386
Conversation
Add Computed: true to members_can_create_internal_repositories schema so Terraform accepts API values when users omit the field, preventing phantom diffs that trigger 422 errors under enterprise policy. Replace shouldInclude with d.GetOkExists for this field since GetOk cannot distinguish "set to false" from "not set" on Computed+Optional bools. Follows allow_forking pattern in resource_github_repository.go. Add unit tests for buildOrganizationSettings and acceptance test proving no phantom diff after apply. Resolves integrations#3385 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
👋 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 |
|
Thanks for putting this PR together and taking the time to contribute! We're temporarily moving to an issue-first model (see CONTRIBUTING.md) where only collaborators can open PRs while we work through the backlog. Because of that, I'm going to close this PR for now. I've linked it on #3385 so we don't lose your work or context when we pick that issue up. Feel free to add a 👍 or any extra notes there to help us prioritize it. |
Summary
github_organization_settings, whenmembers_can_create_internal_repositoriesis omitted from config and the enterprise controls the setting externally, every plan shows a phantom diff that triggers a 422 on apply.Computed: trueto the schema and switch tod.GetOkExistsin the build function, following the same pattern asallow_forkinginresource_github_repository.go.buildOrganizationSettingsand an acceptance test verifying no phantom diff after apply.Resolves #3385
Test plan
go test ./github/ -run TestBuildOrganizationSettings -vgo test ./github/ -run TestOrganizationSettingsSchema -v