chore: generic union transformer and detect zero using reflection#4189
Merged
mergify[bot] merged 10 commits intoaws:mainlinefrom Nov 18, 2022
Merged
chore: generic union transformer and detect zero using reflection#4189mergify[bot] merged 10 commits intoaws:mainlinefrom
mergify[bot] merged 10 commits intoaws:mainlinefrom
Conversation
|
🍕 Here are the new binary sizes!
|
Codecov Report
@@ Coverage Diff @@
## mainline #4189 +/- ##
============================================
+ Coverage 69.24% 69.29% +0.05%
============================================
Files 250 250
Lines 35927 35986 +59
Branches 264 264
============================================
+ Hits 24876 24936 +60
+ Misses 9856 9853 -3
- Partials 1195 1197 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
efekarakus
reviewed
Nov 17, 2022
Contributor
efekarakus
left a comment
There was a problem hiding this comment.
Thanks Danny! Let me know what you think of the suggestions!
efekarakus
previously approved these changes
Nov 18, 2022
efekarakus
reviewed
Nov 18, 2022
Contributor
efekarakus
left a comment
There was a problem hiding this comment.
looks good to me! Thanks for reverting the changes, I think this looks great.
I just have one suggestion, let me know your thoughts!
iamhopaul123
approved these changes
Nov 18, 2022
efekarakus
approved these changes
Nov 18, 2022
KollaAdithya
pushed a commit
to KollaAdithya/copilot-cli
that referenced
this pull request
Nov 21, 2022
…s#4189) This PR contains three changes: 1. A generic `Union` transformer - Union types no longer have to be added individually to the transformers list, as this transformer will handle all cases. 2. When unmarshalling, `Union` now uses `reflect.IsZero` to determine if a value hasn't been set. This means types used in a Union will need to be pointers if the zero value of a type means its been set (e.g., `key: false` will be considered unset unless the Union type is `*bool`) 3. ~Enables strict unmarshaling of types embedded in `Union`. This solves an issue where invalid yaml for a struct results in a zero value, requiring most struct types to have their own `IsZero` function to handle this case. For example, take this struct and unmarshal the below yaml into `Union[*string, complex]`:~ By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
mergify Bot
pushed a commit
that referenced
this pull request
Nov 22, 2022
Due to changes in #4189, a `*string` is now required to determine if `healthcheck` has been configured using the basic configuration. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
mergify Bot
pushed a commit
that referenced
this pull request
Dec 8, 2022
…ice manifest (#4193) This PR adds `from_environment` under `variables` field. Should probably get merged only after #4189 so that `Union` type can be used in this PR. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
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.
This PR contains three changes:
Uniontransformer - Union types no longer have to be added individually to the transformers list, as this transformer will handle all cases.Unionnow usesreflect.IsZeroto determine if a value hasn't been set. This means types used in a Union will need to be pointers if the zero value of a type means its been set (e.g.,key: falsewill be considered unset unless the Union type is*bool)Enables strict unmarshaling of types embedded inUnion. This solves an issue where invalid yaml for a struct results in a zero value, requiring most struct types to have their ownIsZerofunction to handle this case. For example, take this struct and unmarshal the below yaml intoUnion[*string, complex]:By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.