-
Notifications
You must be signed in to change notification settings - Fork 894
chore: color value_source
for deployment values
#9922
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ac997a9
chore: Return populated options vs a blank
Emyrk 3748430
Strip secret values
Emyrk 07588ec
Merge remote-tracking branch 'origin/main' into stevenmasley/deploymeβ¦
Emyrk e1a8997
Color the value source for a deployment value
Emyrk a6cc10e
Use theme colors
Emyrk be1aec3
try going with a blue
Emyrk dc67bb7
Fix json marshal of secrets
Emyrk 53b147b
Fix unmarshal json for optionsets
Emyrk b1058a6
Add comment
Emyrk 6ce3af7
Add diff color to config option when it is source
BrunoQuaresma 5049884
rename optionset receiver
Emyrk 9e68d53
fixup! rename optionset receiver
Emyrk 27cc9f3
Ignore unused arg
Emyrk a5029d1
Add json marshal/unmarshal test
Emyrk ab2ecd9
Fixups
Emyrk 1afa4fe
Use nil for secret types
Emyrk 03a7883
Add unit test for missing opts case
Emyrk 93aa426
Linting
Emyrk 42fb5d0
Fix unit test
Emyrk cbb69bc
Formatting
Emyrk b5a9164
Increment the error context counter
Emyrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix json marshal of secrets
- Loading branch information
commit dc67bb7f4ff3f66458fc9410630f4991d0adec64
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh this is where I broke the
json.Unmarshal()
. @johnstcn @mafredriSo
json.Unmarshal
does unmarshal in place for arrays, so all the types were working correctly. When I was zeroing the secrets, I figured a string is fine, but it is not. I should have used a nil.So this made a
clibase.String
try to unmarshal into whatever the secret was, which did not work. If I instead just use anil
, then it all works π€¦ββοΈ.So I can delete all the json unmarshal stuff I wrote, but my json unmarshal handles all the edge cases that would usually just fail (see https://goplay.tools/snippet/GPxfjtnfvys).
So I can delete my unmarshal code, and if your client and version have different option sets, the call will fail. π€
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather have a custom UnmarshalJSON method than a potential regression between versions :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this complicated unmarshal logic. It is more complicated, but with testing, it is safe and only affects the
codersdk.Client
. If we do not have this code, then we can unintentionally just break the client, and there is nothing the client can do to resolve this since the JSON from the server is the issue at hand.