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 lifecycle fixes #746

Merged
merged 12 commits into from
Apr 9, 2021

Conversation

kfcampbell
Copy link
Member

@kfcampbell kfcampbell commented Mar 30, 2021

This PR unifies the work done in jurgenweber's PR#680 as well as this test branch that some folks were working on.

jurgenweber and others added 7 commits January 29, 2021 14:33
- removes testing of `internal` repositories
  - we encountered 500s from the API with the following error message:
  > Only organizations associated with an enterprise can set visibility to internal
  - a compatible testing environment is needed for automated testing
  - manual testing may be successful when running a local github instance

- removes conflicting use of `private` and `visibility`
  - added `calculateVisibility` to account for the different combinations of visibility-related configuration that the provider expects
  - testing revealed different behaviour from the API documentation:
  > The visibility parameter overrides the private parameter when you use both parameters with the nebula-preview preview header.
@kfcampbell kfcampbell changed the title Visibility fixes playgroun Visibility fixes playground Mar 30, 2021
Jeremy Udit and others added 3 commits April 3, 2021 07:51
- removes testing of `internal` repositories
  - we encountered 500s from the API with the following error message:
  > Only organizations associated with an enterprise can set visibility to internal
  - a compatible testing environment is needed for automated testing
  - manual testing may be successful when running a local github instance

- removes conflicting use of `private` and `visibility`
  - added `calculateVisibility` to account for the different combinations of visibility-related configuration that the provider expects
  - testing revealed different behaviour from the API documentation:
  > The visibility parameter overrides the private parameter when you use both parameters with the nebula-preview preview header.
@kfcampbell kfcampbell changed the title Visibility fixes playground Visibility lifecycle fixes Apr 3, 2021
@kfcampbell
Copy link
Member Author

@jcudit I think this satisfies all of the conditions we talked about earlier this week. What else would you like to see on this PR? I'd be happy to update it with any additional test cases or behavior that you'd like.

@kfcampbell kfcampbell marked this pull request as ready for review April 3, 2021 15:22
@jcudit jcudit added this to the v4.7.0 milestone Apr 6, 2021
Comment on lines 1 to 9
provider_installation {
filesystem_mirror {
path = "/Users/jurgen.weber/checkouts/terraform/terraform-provider-github/examples/repo_org_internal/terraform.d/plugins"
include = ["*/*/*"]
}
direct {
exclude = ["*/*/*"]
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
provider_installation {
filesystem_mirror {
path = "/Users/jurgen.weber/checkouts/terraform/terraform-provider-github/examples/repo_org_internal/terraform.d/plugins"
include = ["*/*/*"]
}
direct {
exclude = ["*/*/*"]
}
}
See Building The Provider instructions in CONTRIBUTING.md

Can we make this more general by pointing to docs in the repo?

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely! Would you prefer that we keep this cli.cfg file the pointer to the repo docs, or maybe should we add a link to the README in that directory? It feels a little weird to me to keep the .cfg extension for a text or markdown file...what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

add a link to the README in that directory

Good catch! My vote goes to adding a link. https://github.com/integrations/terraform-provider-github/blob/master/CONTRIBUTING.md#building-the-provider addresses this indirectly, so maybe we could link to there.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! I've removed the config and provided the link here, and I've also renamed the example directory and created repo name to match the existing pattern in this commit.

How does that look?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking great 🚀

@jcudit jcudit merged commit 1fe84bd into integrations:master Apr 9, 2021
jcudit pushed a commit that referenced this pull request Apr 16, 2021
kfcampbell added a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
* visibility is required on create and can not be updated

* add an example

* update logic for testing if there is an adequate change

* add visibility tests

* add testing for creation of private-visibility repos

- removes testing of `internal` repositories
  - we encountered 500s from the API with the following error message:
  > Only organizations associated with an enterprise can set visibility to internal
  - a compatible testing environment is needed for automated testing
  - manual testing may be successful when running a local github instance

- removes conflicting use of `private` and `visibility`
  - added `calculateVisibility` to account for the different combinations of visibility-related configuration that the provider expects
  - testing revealed different behaviour from the API documentation:
  > The visibility parameter overrides the private parameter when you use both parameters with the nebula-preview preview header.

* add testing for creation of private-visibility repos

- removes testing of `internal` repositories
  - we encountered 500s from the API with the following error message:
  > Only organizations associated with an enterprise can set visibility to internal
  - a compatible testing environment is needed for automated testing
  - manual testing may be successful when running a local github instance

- removes conflicting use of `private` and `visibility`
  - added `calculateVisibility` to account for the different combinations of visibility-related configuration that the provider expects
  - testing revealed different behaviour from the API documentation:
  > The visibility parameter overrides the private parameter when you use both parameters with the nebula-preview preview header.

* Uncomment tests

* Remove specific configuration and instead link to Building the Provider documentation

* Renamed example directory to match existing pattern

Co-authored-by: Jurgen Weber <jurgen@space-marine.org>
Co-authored-by: Jeremy Udit <jcudit@github.com>
@kfcampbell kfcampbell deleted the visibility-playground branch June 28, 2023 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants