Commit c80fb49
fix(shared-context): edition 2024 for let-chains + Option/Result coercion in registry_guard (unblocks fleet bots local build) (#244)
## Summary
The 2026-05-25 migration commit introduced **let-chains** syntax (Rust
2024 only) into
`shared-context/src/{exclusion_registry,registry_guard,storage}.rs`
while `shared-context/Cargo.toml` still declared `edition = "2021"`.
Local builds of every fleet bot (echidnabot, panicbot, seambot,
cipherbot, rhodibot, finishingbot, ...) failed with:
```
error: let chains are only allowed in Rust 2024 or later
```
There was also an `Option`/`Result` type mismatch in
`shared-context/src/registry_guard.rs:127` (and a duplicate copy in
`robot-repo-automaton/src/registry_guard.rs:131`):
```rust
.and_then(|r| r.url().map(|s| s.to_string())); // r.url() -> Result<&str, Error>, not Option<&str>
```
## Changes
- **`shared-context/Cargo.toml`**: `edition = "2021"` -> `edition =
"2024"` (Option 1, preferred). rustc 1.85+ supports it; CI workflows use
`dtolnay/rust-toolchain@stable`.
- **`shared-context/src/registry_guard.rs:126`**: insert `.ok()` between
`r.url()` and `.map(|s| s.to_string())` to coerce `Result` -> `Option`.
- **`robot-repo-automaton/src/registry_guard.rs:131`**: identical
`.ok()` fix (same duplicated buggy line).
## Verification (cargo check, all green)
- `shared-context` (lib + tests + benches)
- `robot-repo-automaton`
- `dashboard`
- `shared-context/fleet-cli`
- `bots/{accessibilitybot, cipherbot, echidnabot, finishingbot, glambot,
gsbot, panicbot, rhodibot, seambot, the-hotchocolabot}`
## Out of scope (pre-existing, not introduced/fixed here)
- `bots/sustainabot` has a path dep on `bots/panic-attacker/` which does
not exist in-tree (likely a Cargo.toml rename casualty). This break
pre-dates the let-chains regression -- verified by stashing the fix and
re-running `cargo check`.
## Test plan
- [x] `cargo check --all-targets -p gitbot-shared-context` -> green
- [x] `cargo check` in 10 bot crates -> all green
- [x] `cargo check` in `robot-repo-automaton`, `dashboard`, `fleet-cli`
-> all green
- [ ] CI: rust-ci / db-checks / e2e / dogfood / boj-build / cargo-audit
(expected to flip green per blocker chain)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 18f87f3 commit c80fb49
3 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
0 commit comments