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

Feature/get repos from a organization #750

Merged
merged 7 commits into from
Apr 17, 2021
Merged

Feature/get repos from a organization #750

merged 7 commits into from
Apr 17, 2021

Conversation

kilwa0
Copy link
Contributor

@kilwa0 kilwa0 commented Apr 3, 2021

Hi,

Added the repository list from a organization into the data_source_github_organization.go, useful to automate changes into repositories organization

Regards

Copy link
Contributor

@jcudit jcudit left a comment

Choose a reason for hiding this comment

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

Added some suggestions around naming of the repo field to stay consistent with other resources in the project. I'm having difficulties getting tests to pass locally but plan to revisit this by end of week. Here is the error I am currently stuck on when running :

$ TF_LOG=DEBUG TF_ACC=1  go test -v   ./... -run ^TestAccGithubOrganizationDataSource
...
testing.go:654: Step 0 error: Check failed: Check 2/5 error: data.github_organization.test: Attribute 'name' expected to be set

github/data_source_github_organization.go Outdated Show resolved Hide resolved
github/data_source_github_organization.go Outdated Show resolved Hide resolved
github/data_source_github_organization_test.go Outdated Show resolved Hide resolved
website/docs/d/organization.html.markdown Outdated Show resolved Hide resolved
@jcudit jcudit modified the milestones: v4.7.0, v4.8.0 Apr 6, 2021
kilwa0 and others added 4 commits April 7, 2021 07:58
Co-authored-by: Jeremy Udit <jcudit@github.com>
Co-authored-by: Jeremy Udit <jcudit@github.com>
Co-authored-by: Jeremy Udit <jcudit@github.com>
Co-authored-by: Jeremy Udit <jcudit@github.com>
@kilwa0
Copy link
Contributor Author

kilwa0 commented Apr 7, 2021

Added some suggestions around naming of the repo field to stay consistent with other resources in the project. I'm having difficulties getting tests to pass locally but plan to revisit this by end of week. Here is the error I am currently stuck on when running :

$ TF_LOG=DEBUG TF_ACC=1  go test -v   ./... -run ^TestAccGithubOrganizationDataSource
...
testing.go:654: Step 0 error: Check failed: Check 2/5 error: data.github_organization.test: Attribute 'name' expected to be set

Hi!

Thank you for your time and your patience

To pass the test you just need to name the organization you are using for testing purposes in the organization settings page or remove the test, I've just kept the old check there

Regards

@kfcampbell
Copy link
Member

I've spent a little bit of time investigating this and I can confirm @kilwa0's assertion. I was able to get the tests to pass after providing an "Organization display name" and "Description" in previously-blank fields of my testing organization. Here's a screenshot of my organization settings page now:

image

That being said, the solution to this error isn't very discoverable. Perhaps we could flesh out this section of CONTRIBUTING.md in order to start a list of prerequisites for organization setup. Or maybe we could provide a script that automates a test organization setup (it could even use this project itself).

@jcudit I think this is something of a product decision...taking this makes our tests a bit more brittle, which we could potentially mitigate with additional documentation or automation. What do you think?

@jcudit
Copy link
Contributor

jcudit commented Apr 17, 2021

Lets add this to our docs. I'd ❤️ a script that automates a test organization setup one day, but feel we can get by with just updating CONTRIBUTING.md for now. I'll follow up with that separate to this PR as tests are now passing locally for me thanks to everyone's guidance 🙇🏾 .

@jcudit jcudit merged commit 87f0f58 into integrations:master Apr 17, 2021
@kilwa0 kilwa0 deleted the Feature/Get-repos-from-a-organization branch April 17, 2021 21:38
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
* Get repos from a given org

* revert changes to default in accetance tests

* Update github/data_source_github_organization.go

Co-authored-by: Jeremy Udit <jcudit@github.com>

* Update github/data_source_github_organization.go

Co-authored-by: Jeremy Udit <jcudit@github.com>

* Update github/data_source_github_organization_test.go

Co-authored-by: Jeremy Udit <jcudit@github.com>

* Update website/docs/d/organization.html.markdown

Co-authored-by: Jeremy Udit <jcudit@github.com>

Co-authored-by: Jeremy Udit <jcudit@github.com>
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