Add option to include fields present in the type but not in the value#1211
Merged
Add option to include fields present in the type but not in the value#1211
Conversation
This feature supports variable lookups in a `dyn.Value` that are present in the
type but haven't been initialized with a value.
For example: `${bundle.git.origin_url}` is present in the `dyn.Value` only if
it was assigned a value. If it wasn't assigned a value it should resolve to the
empty string. This normalization option, when set, ensures that all fields that
are represented in the specified type are present in the return value.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1211 +/- ##
==========================================
+ Coverage 51.88% 51.94% +0.05%
==========================================
Files 299 301 +2
Lines 16611 16804 +193
==========================================
+ Hits 8619 8729 +110
- Misses 7361 7436 +75
- Partials 631 639 +8 ☔ View full report in Codecov by Sentry. |
andrewnester
approved these changes
Feb 15, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 16, 2024
## Changes This is a follow-up to #1211 prompted by the addition of a recursive type in the Go SDK v0.31.0 (`jobs.ForEachTask`). When populating missing fields with their zero values we must not inadvertently recurse into a recursive type. ## Tests New unit test fails with a stack overflow if the fix if the check is disabled.
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.
Changes
This feature supports variable lookups in a
dyn.Valuethat are present in the type but haven't been initialized with a value.For example:
${bundle.git.origin_url}is present in thedyn.Valueonly if it was assigned a value. If it wasn't assigned a value it should resolve to the empty string. This normalization option, when set, ensures that all fields that are represented in the specified type are present in the return value.This change is in support of #1098.
Tests
Added unit test.