Skip to content

Commit c80fb49

Browse files
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

File tree

robot-repo-automaton/src/registry_guard.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn repo_identity(repo_path: &Path) -> (Option<String>, Option<String>) {
128128
let origin_url = repo
129129
.find_remote("origin")
130130
.ok()
131-
.and_then(|r| r.url().map(|s| s.to_string()));
131+
.and_then(|r| r.url().ok().map(|s| s.to_string()));
132132
let full_name = origin_url.as_deref().and_then(parse_full_name);
133133
(full_name, origin_url)
134134
}

shared-context/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[package]
33
name = "gitbot-shared-context"
44
version = "0.1.0"
5-
edition = "2021"
5+
edition = "2024"
66
authors = ["Hyperpolymath <dev@hyperpolymath.org>"]
77
description = "Shared context layer for gitbot-fleet coordination"
88
license = "MPL-2.0"

shared-context/src/registry_guard.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ fn repo_identity(repo_path: &Path) -> (Option<String>, Option<String>) {
123123
let origin_url = repo
124124
.find_remote("origin")
125125
.ok()
126-
.and_then(|r| r.url().map(|s| s.to_string()));
126+
.and_then(|r| r.url().ok().map(|s| s.to_string()));
127127
let full_name = origin_url.as_deref().and_then(parse_full_name);
128128
(full_name, origin_url)
129129
}

0 commit comments

Comments
 (0)