Fix JSON protection unmarshal error#2606
Merged
gmlewis merged 1 commit intogoogle:masterfrom Dec 26, 2022
Merged
Conversation
Currently when trying to load in protection an error is thrown due to a data structure mismatch resulting in errors: json: cannot unmarshal object into Go struct field Protection.lock_branch of type bool json: cannot unmarshal object into Go struct field Protection.allow_fork_syncing of type bool This is due to them using an enabled field which the current structure does not understand. This change introduces the relevant structure and has been tested locally. Signed-off-by: Jason Field <jason@avon-lea.co.uk>
Codecov Report
@@ Coverage Diff @@
## master #2606 +/- ##
=======================================
Coverage 97.99% 97.99%
=======================================
Files 126 126
Lines 10913 10913
=======================================
Hits 10694 10694
Misses 150 150
Partials 69 69
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Collaborator
|
Thank you, @valbeat ! |
Contributor
Author
|
Thanks @gmlewis, can we get a release cut in the next week or two so I don't have to continue to use my fork? |
Collaborator
Contributor
Author
|
Sure I'll try to take a look in the morning @gmlewis |
5 tasks
5 tasks
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.
Description of change
Currently when trying to load in protection an error is thrown due to a data structure mismatch resulting in errors:
This is due to them using an enabled field which the current structure does not understand. This change introduces the relevant structure and has been tested locally.
API Payload:
{ "url": "https://api.github.com/repos/sous-chefs/sc_vscode/branches/main/protection", ... "required_conversation_resolution": { "enabled": false }, "lock_branch": { "enabled": false }, "allow_fork_syncing": { "enabled": false } }As can be seen on the payload above they are under the
enabledkey and are not bool fields directly in their own right.Signed-off-by: Jason Field jason@avon-lea.co.uk