Skip to content

app/: a stored visualci.yml that no longer validates is never dropped silently - #158

Merged
ndbroadbent merged 1 commit into
mainfrom
app-config-never-silent
Dec 4, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
app-config-never-silent

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

A build's stored visualci.yml that the server can no longer parse is never dropped silently any more. Until now, BuildSettings::new logged a warning and treated it as absent, so the build ran with the project's settings and nobody knew.

Design

BuildSettings::new(project, build) now returns Result<Self, ConfigInvalid>, so every caller has to decide what to do with a stored file that doesn't parse. The compiler enforces it: there's no path left that drops the file quietly. The error says visualci.yml no longer validates: <field>: <problem>; send the build again.

  • Field names. build_settings::parse_config reads the file through serde_path_to_error, so messages name the field (threshold: …, pdf: unknown field colour …, ignore[0]: missing field snapshots). Creation's `validate_config` uses the same parser, so creation and later reads always agree. The only answer this changes is the create_build golden (`visualci.yml: ignore[0]: missing field `snapshots).
  • Processing fails the build (processing::process). It sets state failed, conclusion failed, error_code config_invalid, error = the message and completed_at, then drops queued renders. The error shows up in get_build, on the build page ("Build error") and as the check's title (failure).
  • Uploads and early comparisons refuse with the same message: POST /builds/{id}/snapshots, POST /builds/{id}/compare (compare_now) and MCP upload_snapshots. Failing beats a warning here: the build can't be compared correctly, which is the same reason creation refuses bad input.
  • Views of a build already compared (API/MCP build answers, the build page, get_snapshot/show_snapshot's "against previous", text pages, the check's ci_mode) use BuildSettings::shown. It falls back to the project's settings, but that fallback is never silent: build_settings::warnings_of(build) adds "visualci.yml no longer validates: …" to the front of the build's warnings, in every view (API warnings, get_build warnings, the build page, the check summary). This covers builds compared before a later, stricter version. A build that failed for this reason doesn't repeat it as a warning.
  • Base settings that no longer validate (the anchor's approved build, compared in hides_more_than): the build is compared with the project's settings and gets a warning naming the base build.
  • Check summary now includes a failed build's full error (**Error:**) and the build's warnings (**Warning:**). Before, only the title (the first clause) said why a build failed, and warnings never reached the check.
  • Gallery: a stored file that no longer validates gives no gallery (the public page can't say why). It's logged at error level, and members see it in the build's warnings.
  • Creation: the file was validated just before, so it parses. If it somehow didn't, the message goes into the build's warnings.

Tests

app/tests/processing.rs:

  • a_stored_config_that_no_longer_validates_fails_the_build_and_names_the_field:
    • creation still refuses {"threshold": "not a number"} (400, visualci.yml: threshold: …);
    • a valid file processes as before;
    • a stored {"threshold": "not a number"} (written to the database) gets refused by compare and snapshot uploads, then fails at finalize with error_code config_invalid and the message. get_build shows it, the check state is failure with that title, and the summary has it in full;
    • an unknown key under pdf (deny_unknown_fields) fails, naming pdf and colour;
    • a completed build whose file later stops validating shows the warning in the API, get_build and the check;
    • a build whose base no longer validates gets the base warning.
  • a_stored_fractional_threshold_by_glob_validates_and_applies: fleetlayer's and quietdeck's raw stored {"threshold": {"**": 0.1}} passes BuildSettings::new under the app's build (arbitrary_precision on), applies 0.1 to a snapshot when the project's threshold is 0, and the build completes with no warnings.

VisualCI build

Expect one changed JSON snapshot: the create_build golden for a_builds_visualci_yml_overrides_the_project_settings (the error now names ignore[0]). Screenshots shouldn't change: the frontend is untouched, and the seeded builds have no stored file.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@visualci-com

visualci-com Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #364 · 392 unchanged · no changes

This PR vs base: 27 changed, 51 added since #269, across 5 builds

docspring/visualci · journeys · build #360 · 30 unchanged · no changes

This PR vs base: 13 changed, 14 added since #268, across 5 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent force-pushed the app-config-never-silent branch 3 times, most recently from 9164da5 to 19304e3 Compare December 4, 2026 04:00
… is refused by uploads and early comparisons, and shows as a warning on builds compared before; never dropped silently
@ndbroadbent
ndbroadbent force-pushed the app-config-never-silent branch from 19304e3 to 87b4cb9 Compare December 4, 2026 04:19
@ndbroadbent
ndbroadbent merged commit 001ede8 into main Dec 4, 2026
15 checks passed
@ndbroadbent
ndbroadbent deleted the app-config-never-silent branch December 4, 2026 04:28
Sign up for free to 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.

1 participant