build!: ship the binary in the structured-proxy package - #113
Conversation
The binary was a second package, structured-proxy-cli, which release-plz
treated as a second release: a changelog of the whole project history,
links to tags that never exist, and a second crate on crates.io. The
project has one package and one release.
- The `structured-proxy` binary is back in the structured-proxy package,
behind a `cli` feature that is off by default; clap and
tracing-subscriber are optional dependencies of that feature. A crate
that adds the library compiles neither.
- `cargo install structured-proxy --features cli` installs the binary;
without the feature cargo names it.
- The cli/ package and the workspace are gone; release-plz lists the one
package with its v{version} tag and the root CHANGELOG.md.
- CI builds and tests the binary on the default and injected-verifier
legs (all-features includes it), checks that the default build links
no CLI-only crate, and dry-runs the publish of the one package. The
release workflow builds the binary with `--features cli,redis`; the
artefacts, deb and rpm packaging are unchanged.
BREAKING CHANGE: `cargo install structured-proxy` installs the binary only with `--features cli`.
Closes #112
|
Warning Review limit reachedNext included review available in 31 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (11)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae416436e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
This comment has been minimized.
This comment has been minimized.
The former CLI package enabled `redis` by default and the release packages build with it, but `cli` pulled only the command-line dependencies. A binary installed with `--features cli` therefore ran `shield.sync` with a warning and per-instance limits only. - `cli` now carries `redis`, so `cargo install structured-proxy --features cli` builds what the release packages ship; CI and the release workflow build with `--features cli` alone. - A CLI test runs the binary with `shield.sync` and fails on the "not compiled in" fallback warning. - The default-build check also rejects `redis`.
The binary requires the `cli` feature, so a dry-run with default features compiled only the library of the packaged crate. With `--features cli` it builds the binary from the package as `cargo install` would.
The runtime worker-thread settings landed in the cli/ package, which this branch removes: the runtime module moves to src/runtime.rs as a module of the binary, its CLI tests join tests/cli.rs, and the dependencies it added to cli/Cargo.toml are already dependencies of the package.
Summary
One package, one release. The
structured-proxybinary moves back into thestructured-proxypackage, behind aclifeature that is off by default:cargo add structured-proxyadds the library alone;clap,tracing-subscriberandredisare pulled in only bycli.cargo install structured-proxy --features cliinstalls the binary the release packages ship:clicarriesredis, soshield.synckeeps its shared rate-limit store as it did with the former CLI package (without the feature, cargo names it).cli/package and the workspace are removed, so release-plz no longer produces a second release (a whole-history changelog, links to tags that never exist, a second crate on crates.io). It lists the one package with itsv{version}tag and the rootCHANGELOG.md.Changes
Cargo.toml:clifeature (optionalclap/tracing-subscriber, plusredis), the binary and its test targets withrequired-features = ["cli"].src/main.rs: moved fromcli/unchanged.tests/cli.rs: moved fromcli/, plus a test that the installed binary runsshield.syncwithout the "redisfeature is not compiled in" fallback.--features cli(all-features includes it); a check that the default build links none ofclap,tracing-subscriber,redis;cargo publish --dry-run --features clifor the one package, so the packaged binary compiles too.--features cli; artefact names, deb and rpm packaging are unchanged.cargo install structured-proxy --features cli.Testing
fmt, clippy with
-D warningson every backend leg, the test suite with and without the built-in verifier (including the CLI tests against the built binary), doc tests, rustdoc andcargo publish --dry-runpass;cargo install --path . --features cliinstalls a workingstructured-proxy.Closes #112
BREAKING CHANGE:
cargo install structured-proxyinstalls the binary only with--features cli.