fix(serve): variant discovery surfaces parse errors + reads wrapped variant files (REQ-260, REQ-262)#709
Merged
Merged
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📐 Rivet artifact delta
Graphgraph 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
Modified
Posted by |
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.
What (v0.28 slice 1 — variant P1 silent-drops, DD-076)
Two silent-drops in
ProjectVariants::discover:.ok()sites swallowed parse failures: a broken feature-model.yaml becamemodel: Noneandresolve()reported the misleading"no feature model configured"; a broken bindings.yaml renderedartifact_count: 0silently.discovernow captures failures intomodel_error+diagnostics, logs them, and the/variantspage 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).serde_yaml::from_str(flat only), so aninit-scaffoldedvariant:-wrapped file was silently invisible in serve (the variant:rivet variant initemits a binding format thatrivet variant checkrejects #514 regression on the serve path). Now usesVariantConfig::from_yaml_str(both shapes); model loading usesload()so a composedfeature-model-bindingfile isn't dropped.Verification
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).cargo clippy --all-targets -- -D warningson Rust 1.97 clean; fresh-binaryrivet validatePASS.Implements: REQ-260, REQ-262 · Refs: DD-076
🤖 Generated with Claude Code