feat: support internal visibility for repositories created by a template#3123
Conversation
|
👋 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 |
|
Please mark this as resolving #925
|
stevehipwell
left a comment
There was a problem hiding this comment.
Thanks for the PR @puneet-arora15. As well as the suggested changes this PR is going to need some docs changes (they're currently handwritten) to explain the updated behaviour.
ac3c6ff to
cd8d866
Compare
Thanks @stevehipwell for detailed updates to the PR, those changes have now been merged. |
stevehipwell
left a comment
There was a problem hiding this comment.
Thanks for the quick response @puneet-arora15. Have you run the new test locally?
|
@puneet-arora15 could you please rebase this PR? |
Head branch was pushed to by a user without write access
5c7129c to
8c3e9fa
Compare
…ate (integrations#3123) * feat: support internal visibility for repositories created by a template * fix: update handling of internal visibility for repositories created from templates * fix: update test to reflect internal repository visibility as private

Resolves #925
Resolves #3134
Before the change?
visibility = "internal", the repository was created as public due to incorrect handling of thePrivateboolean fieldPrivate=truewhenvisibility == "private", causingvisibility = "internal"to default toPrivate=false(public)After the change?
isPrivatelogic to setPrivate=truefor both"private"and"internal"visibility valuesvisibility = "internal"are now correctly created as private initiallyresourceGithubRepositoryUpdate()Pull request checklist
Note on checklist items:
"sets internal visibility for repositories created by a template"that verifies repositories created from templates withvisibility = "internal"are correctly created as internalDoes this introduce a breaking change?
Please see our docs on breaking changes to help!
This is a bug fix that corrects the existing behavior to match the documented and expected functionality. Users who specify
visibility = "internal"for template-based repositories will now get the correct behavior without any changes to their Terraform configurations.Technical Details
Root Cause: The GitHub template creation API (
POST /repos/{template_owner}/{template_repo}/generate) only accepts aprivateboolean parameter and does not support thevisibilityparameter directly.Code Change (line ~660 in
github/resource_github_repository.go):