Repository navigation
Adding skeleton for github_team_settings resource - #1356
Merged
nickfloyd merged 16 commits intoNov 16, 2022
Merged
Conversation
Added tests for the code reviewer delegation settings to validate that the settings get updated correctly, the schema is validated correctly, and the team can be specified via slug or ID Adding the resource to the provider configuration
GitHub Team settings through GraphQL is a preview capability Needed to add the ability to inject arbitrary custom headers into the GitHub HTTP client to allow the github_team_settings resource to access the preview fields of the Team object
Slug is used during GraphQL queries and UID is used during mutations Will need to resolve slug/numeric ID to UID during create stage Added struct for Team GraphQL query
Accidentally retained a github_team_repository reference from copy/paste
Added logic to resolve Team node ID (used by GraphQL) from either numeric ID (used by REST API) or slug (used by Web interface) on creation of the settings resource Need to continue to store the slug and node_id since they are used by later queries and mutations through the GraphQL API Added json struct tags to the UpdateTeamReviewAssignmentInput since it is serialized as JSON when passed to the GraphQL API as the variable Renamed UpdateTeamReviewAssignment input struct to match what is present as a named input in the GitHub GraphQL documentation as the graphQL API validates the input schema when a named input type is specified Retriving the slug and ID from the Terraform state since they are added on creation Ensuring that the update method will apply changes if the resource is new or if there are changes to the data since create simply resolves the necessary data (node ID and slug) and then delegates the actual changes to the update method
Deleting the resource will reset all of the values to their defaults
There was a test case to check that an apply would fail if delegation=false but other values were set (since nothing happens if delegation=false however there is not elegant way to validate that other fields are non-default if delegation=false
…the test to force migration in the main implementation
…e github_team_settings schema If review_request_delegation is nil then delegation is disabled. If present (i.e. list of 1 element) then settings will be applied Created a default team settings function for updating via GraphQL
…hen reading from the remote GitHub state
elliottpope
marked this pull request as ready for review
November 13, 2022 18:37
Contributor
Author
|
Resolves #1249 |
|
Thank you for working on this @elliottpope!!! Much needed feature. |
nickfloyd
approved these changes
Nov 16, 2022
nickfloyd
left a comment
Contributor
There was a problem hiding this comment.
This is a fantastic add to the provider! Thank you for doing it! ❤️
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added tests for the code reviewer delegation settings to validate that the settings get updated correctly, the schema is validated correctly, and the team can be specified via slug or ID Adding the resource to the provider configuration