Skip to content

Commit a3ad3a4

Browse files
hyperpolymathclaude
andcommitted
fix(shared-context): edition 2024 for let-chains + Option/Result coercion in registry_guard
The 2026-05-25 migration introduced let-chains syntax into shared-context (exclusion_registry.rs, registry_guard.rs, storage.rs) but left shared-context/Cargo.toml at edition = "2021", so local builds of every fleet bot fail with "let chains are only allowed in Rust 2024 or later". Additionally, registry_guard.rs:127 was calling .and_then(|r| r.url().map(|s| s.to_string())) on git2::Remote::url() which returns Result<&str, Error> (not Option<&str>), producing an Option/Result type mismatch. The same buggy line was duplicated in robot-repo-automaton/src/registry_guard.rs:131. Changes: - shared-context/Cargo.toml: edition 2021 -> 2024 (rustc 1.85+; CI uses dtolnay/rust-toolchain@stable which already supports it) - shared-context/src/registry_guard.rs:126: insert .ok() between r.url() and the .map(|s| s.to_string()) to coerce Result to Option - robot-repo-automaton/src/registry_guard.rs:131: same .ok() fix Verified locally with cargo check on: shared-context, robot-repo-automaton, dashboard, shared-context/fleet-cli, bots/{accessibilitybot,cipherbot,echidnabot,finishingbot,glambot,gsbot, panicbot,rhodibot,seambot,the-hotchocolabot} Pre-existing unrelated break (out of scope): bots/sustainabot has a path dependency on bots/panic-attacker/ which does not exist in-tree. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 18f87f3 commit a3ad3a4

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)