Skip to content

fix(serve): variant discovery surfaces parse errors + reads wrapped variant files (REQ-260, REQ-262)#709

Merged
avrabe merged 1 commit into
mainfrom
fix/req-260-262-variant-discover
Jul 15, 2026
Merged

fix(serve): variant discovery surfaces parse errors + reads wrapped variant files (REQ-260, REQ-262)#709
avrabe merged 1 commit into
mainfrom
fix/req-260-262-variant-discover

Conversation

@avrabe

@avrabe avrabe commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What (v0.28 slice 1 — variant P1 silent-drops, DD-076)

Two silent-drops in ProjectVariants::discover:

  • REQ-260 — the .ok() sites swallowed parse failures: a broken feature-model.yaml became model: None and resolve() reported the misleading "no feature model configured"; a broken bindings.yaml rendered artifact_count: 0 silently. discover now captures failures into model_error + diagnostics, logs them, and the /variants page shows a red "Feature model failed to load" banner instead of "no variants configured". resolve() distinguishes model-present-but-broken (returns the parse error) from model-absent (friendly hint).
  • REQ-262 — variant files were parsed with raw serde_yaml::from_str (flat only), so an init-scaffolded variant:-wrapped file was silently invisible in serve (the variant: rivet variant init emits a binding format that rivet variant check rejects #514 regression on the serve path). Now uses VariantConfig::from_yaml_str (both shapes); model loading uses load() so a composed feature-model-binding file isn't dropped.

Verification

  • 4 new tests: discover_broken_model_records_diagnostic_and_resolve_reports_parse_error, discover_absent_model_still_reports_absent_message, discover_accepts_wrapped_variant_shape, discover_flat_variant_still_works — all pass (11 serve::variant + 8 variant_scoped_api).
  • Build clean; cargo clippy --all-targets -- -D warnings on Rust 1.97 clean; fresh-binary rivet validate PASS.

Implements: REQ-260, REQ-262 · Refs: DD-076

🤖 Generated with Claude Code

…ariant files (REQ-260, REQ-262, DD-076)

Two P1 silent-drops in ProjectVariants::discover (DD-076):

REQ-260 — the three `.ok()` sites swallowed parse failures: a broken (malformed
/ cyclic / attribute-invalid) feature-model.yaml became model:None and resolve()
reported the misleading "no feature model configured", while a broken
bindings.yaml rendered artifact_count:0 silently. discover now captures failures
into `model_error` + `diagnostics`, logs them, and the /variants page shows a red
"Feature model failed to load" / "configuration files could not be parsed" banner
instead of "no variants configured". resolve() distinguishes model-present-but-
broken (returns the parse error) from model-absent (the friendly hint).

REQ-262 — variant files were parsed with raw `serde_yaml::from_str::<VariantConfig>`
(flat shape only), so an init-scaffolded `variant:`-wrapped file was silently
invisible in serve (the #514 regression on the serve path). Now uses
VariantConfig::from_yaml_str (accepts both shapes); model loading switched
from from_yaml to load() so a composed feature-model-binding file isn't dropped.

Confirmed with 4 new discover tests (broken-model diagnostic, absent-vs-broken,
wrapped-shape, flat regression; 11 serve::variant + 8 variant_scoped_api pass),
build, clippy --all-targets on Rust 1.97 clean, and fresh-binary rivet validate PASS.

Implements: REQ-260, REQ-262
Refs: DD-076, FEAT-001
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

📐 Rivet artifact delta

Change Count
Added 0
Removed 0
Modified 2
Downstream impacted (depth ≤ 5) 0

Graph

graph LR
  REQ_260["REQ-260"]:::modified
  REQ_262["REQ-262"]:::modified
  classDef added fill:#d4edda,stroke:#28a745,color:#155724
  classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
  classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
  classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Loading
Modified
ID Changes
REQ-260
REQ-262

📎 Full HTML dashboard attached as workflow artifact rivet-delta-pr-709download from the workflow run.

Posted by rivet-delta workflow. The graph shows only changed artifacts; open the HTML dashboard (above) for full context.

@avrabe
avrabe merged commit b8da491 into main Jul 15, 2026
30 checks passed
@avrabe
avrabe deleted the fix/req-260-262-variant-discover branch July 15, 2026 23:56
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