fix(config): mark config structs non_exhaustive + center donation section#44
Conversation
The public config structs are loaded from YAML via Deserialize and are not meant to be constructed with struct literals by downstream crates. Marking every config struct (and DescriptorSource) #[non_exhaustive] stops field additions/removals from being breaking changes, so the config can evolve without forcing a major bump each time and without tripping cargo-semver-checks on every new field. BREAKING CHANGE: config structs are now #[non_exhaustive]; downstream crates can no longer build them with struct literals or match them exhaustively. Construct config via ProxyConfig::from_file / Deserialize. Closes #43
Wrap the heading + QR in the centered block and use an HTML img so the donation section renders centered on GitHub / crates.io.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds ChangesMark config types
README Donation Section
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
| Filename | Overview |
|---|---|
| src/config.rs | Adds #[non_exhaustive] to all 20 public structs and the DescriptorSource enum; the private DescriptorSourceYaml helper is correctly left untouched. No functional logic is changed. |
| README.md | Moves the donation heading inside the centering div and switches to an HTML img tag for the QR code; purely cosmetic, renders correctly on GitHub. |
Reviews (1): Last reviewed commit: "docs: center the Support the Project sec..." | Re-trigger Greptile
Summary
Fixes the failing
cargo-semver-checksrun on the release PR. Since v1.1.0, every config field add/remove (and the BFF removal / ext_authz reshape) broke the publicconfigAPI, because the structs are a struct-literal contract. They are loaded from YAML viaDeserialize, not hand-built by downstream.Marking every
configstruct and theDescriptorSourceenum#[non_exhaustive]stops field changes from being breaking, so the config can evolve via minor bumps and semver-checks stops failing on each new field.Breaking change → 2.0.0
Adding
#[non_exhaustive]is itself a breaking change (downstream can no longer use struct literals / exhaustive matches), so this release is a major bump to 2.0.0. The commit carries aBREAKING CHANGE:footer so release-plz cuts 2.0.0 and semver-checks passes (a major bump is allowed to contain breaking changes). After 2.0.0, config fields can be added/removed without a major bump.Within this crate, struct literals still work (
#[non_exhaustive]only restricts other crates), so tests and internal construction are unaffected.Also
<img>for reliable rendering).Testing
cargo nextest run --features redis: 119 passed. clippy (all-features) + fmt clean. Build green.Closes #43