refactor!: move the Discord integration out of the workspace - #2417
Closed
gold-silver-copper wants to merge 4 commits into
Closed
refactor!: move the Discord integration out of the workspace#2417gold-silver-copper wants to merge 4 commits into
gold-silver-copper wants to merge 4 commits into
Conversation
…rkspace Mechanical ownership fixes: drop the per-hook-iteration RequestPatch clone, per-row String clones used only to index JSON maps (lancedb), a loop-invariant table-name clone (surrealdb), a per-tool schema clone (gemini-grpc), clone-to-format allocations (agent tool), borrowed-Value deserialization where no serde-policy wall applies (message.rs, candle), and eager default/error construction (unwrap_or/ok_or -> *_else).
Both public items have zero implementors, constructors, or consumers anywhere in the workspace, tests, or examples. Documented in the CHANGELOG Unreleased 'Removed' section with migration recipes.
`serenity` 0.12.5 is the newest published release and pins `rustls` 0.22, whose `rustls-webpki` 0.102.8 carries four unpatched advisories: a reachable CRL-parsing panic and three name-constraint/CRL-authority weaknesses. There is no version to bump to, and the only in-tree reason that graph exists is the optional `discord-bot` feature — a ~230-line wrapper over the public `Agent` API behind a demo. Remove `rig`'s and rig-agent's `discord-bot` features along with `rig_agent::integrations::discord_bot`, and move the code verbatim into `examples/discord_bot`, which now depends on `serenity` directly, is excluded from the workspace, and carries its own (gitignored) lockfile. `serenity`, `tokio-tungstenite` 0.21, `rustls` 0.22 and `rustls-webpki` 0.102.8 are gone from the workspace `Cargo.lock`; the remaining `rustls-webpki` is the patched 0.103.x on the default reqwest path. Two incidental trims came with the move: `into_discord_bot_from_env` and the `DiscordBotError::MissingToken` variant it fed, both unused by the example. The example is built on demand (`cargo run --manifest-path examples/discord_bot/Cargo.toml`) and is no longer covered by CI's workspace build.
Contributor
Author
|
Recreated off latest main as a single commit — the branch was cut before #2416 landed, so this PR carried its already-merged commits. |
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.
Why
The four open
rustls-webpki0.102.8 advisories — a reachable CRL-parsing panic plus three name-constraint/CRL-authority weaknesses — are reached only through rig-agent's optionaldiscord-botfeature:serenity0.12.5 is the newest published release and hard-pinstokio-tungstenite = "0.21.0", so no version bump reaches a patched rustls. The alternatives were switching serenity to its native-TLS backend (drops the advisories, but drags openssl into every--all-featuresbuild and keeps us married to a stale crate) or deleting the integration outright. This does neither: it keeps the demo and gets the graph out of the published crates.What changed
rig'sdiscord-botfeature, rig-agent'sdiscord-botfeature, andrig_agent::integrations::discord_bot(DiscordExt,DiscordBotError), plus the workspaceserenitydependency and the fixture entry intests/fixtures/tool_facade.examples/discord_bot/src/discord_bot.rs. That crate now depends onserenitydirectly, declares its own[workspace], and is in the rootexcludelist, so its lockfile is separate (and gitignored — no point tracking a lock full of unpatchable pins).DiscordExt::into_discord_bot_from_envdefault method and theDiscordBotError::MissingTokenvariant it fed.MIGRATING.md(0.41 → next) documents the break and the copy-this-file path for anyone who was usingDiscordExt;examples/README.mdnotes the different run command.serenity,tokio-tungstenite0.21,rustls0.22 andrustls-webpki0.102.8 are gone from the workspaceCargo.lock— the only remainingrustls-webpkiis the patched 0.103.x on the default reqwest path.Breaking
Per rig's no-backcompat policy there is no shim.
rig = { features = ["discord-bot"] }no longer resolves, andrig::integrations::discord_botis gone. The integration is ~230 lines over the publicAgentAPI — copyexamples/discord_bot/src/discord_bot.rsand depend onserenitydirectly.Tradeoff worth flagging
The example leaves CI's workspace build, so it is no longer compile-checked there. Run it with
cargo run --manifest-path examples/discord_bot/Cargo.toml.Verification
cargo check --workspace --all-features --all-targets— cleancargo clippy --workspace --all-features --all-targets— no warningscargo test --features facade-build-tests --test tool_facade_features— passescargo clippy --manifest-path examples/discord_bot/Cargo.toml --all-targets— cleancargo fmt --all --check— clean