Repository navigation
Fixing team repository permissions - #1384
Merged
nickfloyd merged 4 commits intoNov 28, 2022
Merged
Conversation
Accept header was getting overwritten by the previewHeaderInjectorTransport previewHeaderInjectorTransport is a workaround since go-github/githubv4 dependencies do not allow specifying arbitrary headers to be added to requests and the preview Accept schema needed to be added for the github_team_settings resource New implementation reads the existing header value and appends the value as a comma separated list This will work at least for the Accept header (other headers may not work this way so this API will need to be used with caution - but it is package private so only changes to the provider could cause this issue)
…ture is GA in the GraphQL API
Contributor
Author
|
Verified that without this change the Command to isolate the TF_ACC=1 GITHUB_TOKEN=<your GitHub PAT> GITHUB_OWNER=<your account> GITHUB_ORGANIZATION=
<your org> TF_LOG=debug go test -v ./github -run 'TestAccGithubTeamRepository' |
elliottpope
marked this pull request as ready for review
November 23, 2022 20:49
1 of 5 tasks
If header is empty string then we do not want '' + ',' + header = ,header so checking for empty string before concatenating
|
@elliottpope Thanks for adding this feature set and getting the bug patched! |
scruplelesswizard
approved these changes
Nov 23, 2022
Contributor
Author
|
My bad, it was a dumb mistake to override the header 🤦♂️ |
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.
Resolves #1373
Behavior
Before the change?
previewHeaderInjectorTransportwhich caused errors ingithub_team_repositorywhich needs thevnd.github.v3.repository+jsonvalue to be present in theAcceptheader.After the change?
previewHeaderInjectorTransportappends the preview schema to the existingAcceptheader (Go implementation will return default""- empty string - when header not set so logic will work even ifAcceptheader not already set) as a comma-separated listOther information
No other info
Additional info
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
Type: Breaking changelabel)If
Yes, what's the impact:Pull request type
Please add the corresponding label for change this PR introduces:
Type: Bug