Skip to content

dyn: fix zero values conversion / IsZero() method - #3649

Merged
denik merged 4 commits into
mainfrom
denik/dyn-is-zero
Sep 24, 2025
Merged

dyn: fix zero values conversion / IsZero() method#3649
denik merged 4 commits into
mainfrom
denik/dyn-is-zero

Conversation

@denik

@denikdenik commented Sep 23, 2025

Copy link
Copy Markdown
Contributor

Changes

  • Fix IsZero() method for types like int64. This fixes ToConvert for NumWorkers field in ClusterSpec.
  • Do not panic in dyn.V() if other int types are encountered.
  • If panic does happen, include type name.

Why

ToConvert() depends on it and is broken. This unblocks #3650#3646

Tests

New unit tests.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 23, 2025

Copy link
Copy Markdown
Collaborator

Run: 17972675020

Env✅​pass🔄​flaky🙈​skip
✅​aws linux311529
🔄​aws windows3102528
✅​aws-ucws linux423427
✅​aws-ucws windows424426
✅​azure linux311528
✅​azure windows312527
✅​azure-ucws linux423426
🔄​azure-ucws windows4231425
✅​gcp linux310530
✅​gcp windows311529
Test Nameaws windowsazure-ucws windows
TestAccept🔄​flaky✅​pass
TestAccept/bundle/deployment/bind/model-serving-endpoint🔄​flaky✅​pass
TestSyncIncrementalSyncPythonNotebookToFile✅​pass🔄​flaky

Base automatically changed from denik/structpath-flexible to mainSeptember 24, 2025 09:22
@denik
denik enabled auto-merge September 24, 2025 09:37
@denik
denik added this pull request to the merge queueSep 24, 2025
Merged via the queue into main with commit 165bd50Sep 24, 2025
13 checks passed
@denik
denik deleted the denik/dyn-is-zero branch September 24, 2025 10:25
github-merge-queueBot pushed a commit that referenced this pull request Sep 26, 2025
…N roundtrip (#3646)
## Why
For direct, we fetch configs as struct instances via GetResourceConfig,
which is using json roundtrip between dyn value and struct. That,
however, does not work well when there references in the config, see
#3645 for details.
This switches to converting dyn.Value with dyn/convert ToTyped function.
The function was not used previously because it did not handle
ForceSendFields correctly for embedded structs which caused JSON
marshaller in Go SDK to return error. This was fixed in
#3650 and
#3649
## Tests
Existing tests.
denik added a commit that referenced this pull request May 20, 2026
## Changes
- Fix IsZero() method for types like int64. This fixes ToConvert for
NumWorkers field in ClusterSpec.
- Do not panic in dyn.V() if other int types are encountered.
- If panic does happen, include type name.
## Why
ToConvert() depends on it and is broken. This unblocks
#3650#3646
## Tests
New unit tests.
denik added a commit that referenced this pull request May 20, 2026
…N roundtrip (#3646)
## Why
For direct, we fetch configs as struct instances via GetResourceConfig,
which is using json roundtrip between dyn value and struct. That,
however, does not work well when there references in the config, see
#3645 for details.
This switches to converting dyn.Value with dyn/convert ToTyped function.
The function was not used previously because it did not handle
ForceSendFields correctly for embedded structs which caused JSON
marshaller in Go SDK to return error. This was fixed in
#3650 and
#3649
## Tests
Existing tests.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@denik@eng-dev-ecosystem-bot@pietern@andrewnester