Repository navigation
Fix(cuex): keep numbers in an external provider's reply as written - #164
Merged
Merged
Conversation
A reply was decoded with encoding/json into map[string]any, so every number became a float64. CUE then held an HTTP status of 200 as a float, which interpolates as "2E+2" and does not unify with int, and an integer above 2^53 lost its last digits. The reply is now read by CUE's own JSON decoder, which keeps an integer an int and every digit it was sent. A reply that is not a JSON object is still an error. Signed-off-by: Brian Kane <briankane1@gmail.com>
briankane
requested review from
FogDong,
Somefive,
anoop2811,
jerrinfrancis,
jguionnet and
roguepikachu
as code owners
November 26, 2026 16:48
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #164 +/- ##
==========================================
- Coverage 92.54% 92.52% -0.02%
==========================================
Files 115 115
Lines 6944 6946 +2
==========================================
+ Hits 6426 6427 +1
- Misses 518 519 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jerrinfrancis
approved these changes
Nov 26, 2026
briankane
added a commit
to briankane/workflow
that referenced
this pull request
Nov 26, 2026
Picks up kubevela/pkg#164 for v0.8.0-alpha.3. Signed-off-by: Brian Kane <briankane1@gmail.com>
briankane
added a commit
to kubevela/workflow
that referenced
this pull request
Nov 26, 2026
* Fix: inject the multicluster client into the workflow context (#251) [紧急] fix: inject multicluster client into workflow context (cherry picked from commit 2df730a) Signed-off-by: Brian Kane <briankane1@gmail.com> * Fix: set the WorkflowRun identity labels in ApplyInParallel (#330) Signed-off-by: Arpit Jain <arpitjain099@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> (cherry picked from commit c6a8d92) Signed-off-by: Brian Kane <briankane1@gmail.com> * Chore: bump kubevela/pkg to 6b8007f3ec60 Picks up kubevela/pkg#164 for v0.8.0-alpha.3. Signed-off-by: Brian Kane <briankane1@gmail.com> --------- Signed-off-by: Brian Kane <briankane1@gmail.com> Signed-off-by: Arpit Jain <arpitjain099@gmail.com> Co-authored-by: Cris <92035086+cuixiaojun001@users.noreply.github.com> Co-authored-by: Arpit Jain <3242828+arpitjain099@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
3 of 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 your changes
An external provider's reply was decoded with
encoding/jsonintomap[string]any, so every number came back as afloat64. CUE then held an HTTP status of 200 as a float: it interpolates as2E+2and doesn't unify withint, and an integer above 2^53 lost its last digits.The reply is now read by CUE's own JSON decoder, which keeps an integer an int and every digit it was sent. A reply that isn't a JSON object is still an error.
How has this code been tested?
TestExternalProviderFnKeepsNumbersAsWrittenserves a reply with an int status, a float and an integer above 2^53, and checks bothCallandCallForResultkeep each as written and the status unifies withint.go test ./cue/cuex/runtime/passes.Summary by cubic
Keeps numbers in external provider replies as written. Replies were decoded with
encoding/jsonintomap[string]any, turning every number into afloat64, so an HTTP status of 200 became2E+2and integers above 2^53 lost digits. The reply is now read by CUE's own JSON decoder, which preserves integer kind and full precision. Replies that aren't JSON objects still return an error.Written for commit db08c72. Summary will update on new commits.