Fixes parent team removal, fixes the teams data source tests, adds tests for the parent team fix #1979
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1668
Resolves #1975
I have closed #1976 (which I initially setup) as this also resolves #1975 but is no longer needed as this PR will now fix it.
Before the change?
#1668
Parent teams were created in terraform. However if a team was removed from the parent team then the statefile was updated, but the team still remained under a parent team in GitHub.
Also, if a team was removed from under a parent team in GitHub but still was defined in terraform, then terraform would not show a diff.
Overall, nested teams were not correctly managed by Terraform.
#1975
Before the change there was a failure reported in a test in the
data_source_github_team_test.go
file. The reason is the terraform data resource in thequeries an existing team with connected repositories
test block is only waiting on thegithub_team
resource, and the data resource actually needs to wait on thegithub_team_repository
resource.Running this test:
TF_LOG=WARN TF_ACC=1 go test -v ./... -run ^TestAccGithubTeamDataSource
would result in a failure:
However, if using
TF_LOG=DEBUG
it would finish successfully - I believe this is just a timing issue.TF_LOG=DEBUG
takes longer to run each resource, so by the time the data resource is actioned, the previous resources have all (just by chance) also completed.It appears that the test for
TestAccGithubTeamDataSource
was defined incorrectly. I have refactored to bring the test in-line with how other tests are defined and this appears to have resolved the issue.Formatting
The
.tf
files are now formatted correctly.After the change?
Parent teams are correctly managed by Terraform. Tests have been defined and pass.
The data source tests for teams work.
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!