Repository navigation
app/: uploads with --threshold work again (floats under arbitrary_precision); CLI 0.2.24 - #156
Merged
Merged
Conversation
…ct are read through serde_json::Value (arbitrary_precision broke untagged and flattened floats); CLI 0.2.24
ndbroadbent
force-pushed
the
app-lenient-floats
branch
from
December 3, 2026 23:46
e0d51cf to
2b862d0
Compare
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.
Every upload with
--thresholdhas been refused since the cutover. Talira's screens job runsvisualci upload --threshold 0.1 …(docspring/talira builds 18 to 31), andPOST /api/v1/builds/{id}/snapshotsanswered 422: "invalid body: data did not match any variant of untagged enum NumberOrString".Cause: app/'s dependencies turn on serde_json's
arbitrary_precision. With it, a float that serde buffers (in an untagged enum or a#[serde(flatten)]struct) arrives as a private map, so it can't become anf64. Integers aren't affected, which is why uploads without a threshold worked. Three places had this:domain::lenient(the REST API's "number or numeric string" fields: a snapshot'sthreshold, plussize,pr_number,shard_totalandshard) used an untaggedNumberOrString. It now reads the field asserde_json::Value, which understandsarbitrary_precision, and parses the number's exact text or the string into the target type. A non-number is still an error naming what arrived.Threshold(threshold:in visualci.yml, a number or a glob map) was untagged too, so on the server a storedthreshold: 0.1stopped validating, andBuildSettingstreated the whole config as absent. It now has aserde_json::Value-basedDeserialize; Serialize and the JSON schema are unchanged. This changes visualci-core, so the CLI goes to 0.2.24.update_project's args flattenedSettingsChange, sothreshold,dpiand mask sizes there were refused too. They're now read throughserde_json::Value(projecttaken out, the rest intoSettingsChange); the tool's schema is unchanged.Tests, each failing before the fix (the first one reproduced the production error exactly):
lenient::tests::reads_bare_floats_and_integers:0.1,1,2.5e-1, a float where an integer belongs, and a boolean;lenient::arbitrary_precision::a_config_threshold_reads_floats:0.1and a glob map, throughConfig::from_json;lenient::arbitrary_precision::update_project_args_read_numbers:threshold,dpiand a mask'sregion.bottom;api_builds::snapshots_take_a_float_threshold: a real upload over HTTP with the threshold as a number, a string and an integer, checking the stored value.Checks (build pool):
cargo fmt --all --check, clippy with-D warningson the workspace, the lenient and api_builds tests, visualci-core's and visualci-cli's tests, and app/'s full suite all pass.After it deploys, Talira's screens job (run 47218196143) can be rerun.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.