Skip to content
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

Visibility #441

Merged
merged 2 commits into from
May 8, 2020
Merged

Visibility #441

merged 2 commits into from
May 8, 2020

Conversation

patrickmarabeas
Copy link
Contributor

Adds the additional visibility parameter allowing for enterprise
accounts to set the repository to be only internally visible.

NOTE: This is dependant on #424 and should be rebased on master once this has been merged.

@ghost ghost added the size/XXL label May 1, 2020
@ghost ghost added size/XS and removed size/XXL labels May 1, 2020
@anGie44 anGie44 linked an issue May 1, 2020 that may be closed by this pull request
@anGie44 anGie44 added this to the v2.8.0 milestone May 1, 2020
@ghost ghost added the Type: Documentation Improvements or additions to documentation label May 2, 2020
@anGie44
Copy link
Contributor

anGie44 commented May 5, 2020

@patrickmarabeas this looks great! when you get a chance you can also now rebase to use the updated go-github lib

@patrickmarabeas
Copy link
Contributor Author

Comments resolved, and commits rebased @anGie44.

@anGie44
Copy link
Contributor

anGie44 commented May 6, 2020

awesome, thanks for pushing up changes @patrickmarabeas! do you mind adding test coverage for the attribute as well? forgot to mention it when I made my initial comments..otherwise changes LGTM 👍

@ghost ghost added size/S and removed size/XS labels May 6, 2020
@patrickmarabeas
Copy link
Contributor Author

@anGie44 I've included mention of the property in the tests, but not sure how much more can be done since testing is only done within public orgs... This looks to have the same degree of "testing" as the private property now. Any additional suggestions?

anGie44
anGie44 previously approved these changes May 8, 2020
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrickmarabeas thank you! running the tests locally tho, I realized you'll have to also add the Visibility attribute in the Check functions like:

testAccCheckGithubRepositoryAttributes(&repo, &testAccGithubRepositoryExpectedAttributes{
      Visibility: "public",
      ...
}

re: more test coverage, the only edge case i considered "testing" would be to set conflicting params (e.g. visibility=public and private=true) to ensure the visibility param overrides but i don't think it'd add much value as I don't see it being a typical practitioner's user error.

Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrickmarabeas thank you! running the tests locally tho, I realized you'll have to also add the Visibility attribute in the Check functions like:

testAccCheckGithubRepositoryAttributes(&repo, &testAccGithubRepositoryExpectedAttributes{
      Visibility: "public",
      ...
}

re: more test coverage, the only edge case i considered "testing" would be to set conflicting params (e.g. visibility=public and private=true) to ensure the visibility param overrides but i don't think it'd add much value as I don't see it being a typical practitioner's user error.

github/data_source_github_repository.go Outdated Show resolved Hide resolved
@anGie44 anGie44 self-requested a review May 8, 2020 01:04
@anGie44 anGie44 dismissed their stale review May 8, 2020 01:13

review needed

Adds the additional visibility parameter allowing for enterprise
accounts to set the repository to be only internally visible.

Resolves integrations#304
Adds the additional visibility parameter allowing for enterprise
accounts to have set the repository to be only internally visible.

Resolves integrations#304
@patrickmarabeas
Copy link
Contributor Author

@anGie44

Added visibility to the Check functions.

I don't think testing that edge case should be necessary, as that's just testing the API, not the provider.

Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks so much @patrickmarabeas! changes and test results look good 🚀

Output of (GithubRepository) acceptance tests:

--- PASS: TestAccGithubRepository_hasProjects (6.15s)
--- PASS: TestAccGithubRepository_templates (6.90s)
--- PASS: TestAccGithubRepository_basic (12.63s)
--- PASS: TestAccGithubRepository_defaultBranch (12.70s)
--- PASS: TestAccGithubRepository_archive (12.79s)
--- PASS: TestAccGithubRepository_archiveUpdate (14.82s)
--- PASS: TestAccGithubRepository_createFromTemplate (17.30s)
--- PASS: TestAccGithubRepository_autoInitForceNew (30.04s)
--- PASS: TestAccGithubRepository_topics (33.02s)

@anGie44 anGie44 merged commit ca94d0e into integrations:master May 8, 2020
anGie44 added a commit that referenced this pull request May 8, 2020
@anGie44 anGie44 mentioned this pull request May 10, 2020
@anGie44
Copy link
Contributor

anGie44 commented May 10, 2020

Note: rolling this back as the param will override the private attribute by default (even if omitted from config per https://github.com/terraform-providers/terraform-provider-github/issues/451); we should probably consider overriding only if a user provides a value for visibility @patrickmarabeas -- similar to how the API treats this param; apologies if you might have to submit a new PR after I reverted?

@patrickmarabeas
Copy link
Contributor Author

Ah true. Would removing the default be enough? That should result in a nil setting.

@patrickmarabeas
Copy link
Contributor Author

@anGie44 see #454

@anGie44 anGie44 added the Type: Feature New feature or request label May 12, 2020
anGie44 added a commit that referenced this pull request May 15, 2020
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
add visibility argument to github_repository data_source and resource
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Type: Documentation Improvements or additions to documentation Type: Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support "internal" repository types
2 participants