feat: models-only build behind a default-on validation feature - #751
Draft
gronke wants to merge 3 commits into
Draft
feat: models-only build behind a default-on validation feature#751gronke wants to merge 3 commits into
gronke wants to merge 3 commits into
Conversation
gronke
force-pushed
the
feat/validation-feature
branch
from
July 27, 2026 13:56
540b594 to
74f1bca
Compare
Without the feature the crate builds the generated schema types and the JSON plumbing, with serde, serde_json, regress, and uuid as the only dependencies; the other ten move behind `validation`, which stays in the default set so nothing changes for existing users. Every gate sits on a module declaration in lib.rs and macros/mod.rs — no function-level cfg. `converter` implies `validation` (it builds on the trait layer), the bench declares `required-features`, and csaf-ffi pins `features = ["validation"]` since its isolated `-p` builds (wasm/go bindings) see no feature unification from the other workspace members.
The workspace-level --no-default-features step never disables csaf-rs defaults: the other members request them on their dependency edges and resolver 2 unifies the features back on. Only a `-p csaf-rs` invocation isolates the crate, so the new step is the one that actually compiles and tests models-only.
gronke
force-pushed
the
feat/validation-feature
branch
from
July 28, 2026 09:03
74f1bca to
3526bbd
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.
The demonstration PR for #733:
validationis a default-on feature; disabling it builds the generated schema types plus the JSON plumbing withserde,serde_json,regress, anduuidas the only dependencies.Design, matching the module graph:
#[cfg(feature = "validation")]- 12 inlib.rs, 3 inmacros/mod.rs; zero function-level cfg. Theconvertergate atlib.rs:1was the precedent.csafumbrella (traits, rich types,RawDocument, loaders) gates with validation, as the issue sketched; models-only consumers deserialize viaserde_jsonor the ungatedJsonSource. KeepingRawDocument/detect_versionmodels-side is possible later by moving two impl blocks out ofraw.rs- left out to keep this diff minimal.converter = ["validation"](it builds on the trait layer). The bench declaresrequired-features = ["validation"].macros/mod.rsrather than on the module declaration, so the string-newtype macro from feat: AsRef<str> and PartialEq<str> for generated string newtypes #717 lands ungated beside it without conflict.Two discoveries the issue text did not know:
default-features = falseand importscsaf::validation; it compiled only becausevalidationwas unconditional. Its isolated-p csaf-ffibuilds (the wasm/go binding scripts and the CI wasm job) see no feature unification, so the manifest now pinsfeatures = ["validation"].--no-default-featuresCI step never disables csaf-rs defaults - the other members re-enable them through resolver-2 unification. The second commit adds the-p csaf-rs --no-default-featurestest step that actually exercises models-only.Numbers (local, directional): resolved dependency graph:
152 → 25 crates; cold debug build 32.7 s → 17.7 s wall, 193 s → 79 s CPU.