From 832af0e36a265705da969b25e00d6800d884e947 Mon Sep 17 00:00:00 2001 From: hak8or Date: Wed, 14 Jan 2026 22:01:17 -0500 Subject: [PATCH] Add ability to exclude repos from verification with mandatory reason MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` │ Agent powering down. Goodbye! │ │ Interaction Summary │ Session ID: cd71bf4b-7267-4be7-9ad5-910c1bf4d896 │ Tool Calls: 18 ( ✓ 17 x 1 ) │ Success Rate: 94.4% │ User Agreement: 100.0% (18 reviewed) │ Code Changes: +75 -16 │ │ Performance │ Wall Time: 22m 17s │ Agent Active: 8m 29s │ » API Time: 4m 46s (56.3%) │ » Tool Time: 3m 42s (43.7%) │ │ │ Model Usage Reqs Input Tokens Cache Reads Output Tokens │ ──────────────────────────────────────────────────────────────────────────── │ gemini-2.5-flash-lite 4 6,748 0 330 │ gemini-3-pro-preview 20 75,693 347,715 11,245 │ gemini-2.5-flash 2 0 0 0 │ │ Savings Highlight: 347,715 (80.8%) of input tokens were served from the cache, reducing costs. ``` --- example.toml | 9 +++++ src/main.rs | 38 +++++++++++++++---- .../session_2026_01_14_exclude_verify.md | 28 ++++++++++++++ 3 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 vibe_coding_log/session_2026_01_14_exclude_verify.md diff --git a/example.toml b/example.toml index 2e89854..e857f82 100644 --- a/example.toml +++ b/example.toml @@ -16,6 +16,15 @@ repos = [ { url = "https://github.com/justcallmekoko/ESP32Marauder" } ] +# Optional: List of repository names to exclude from verification (if --verify-canfetch is used) +repos_exclude_verify = [ + { name = "ESP32Marauder", reason = "This repo is known to be flaky." }, + { name = "some-other-repo", reason = """ + This repo is very large and times out. + We will fix this later. + """ } +] + organizations = [ { url = "https://gitea.hak8or.com/mirrors" }, ] diff --git a/src/main.rs b/src/main.rs index 3996e17..1ab3cea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,6 +49,12 @@ struct OrgConfig { api_key: Option, } +#[derive(Deserialize, Debug, Clone)] +struct ExcludeVerifyConfig { + name: String, + reason: String, +} + #[derive(Deserialize, Debug)] struct Config { gitea_url: String, @@ -56,6 +62,7 @@ struct Config { repos: Option>, organizations: Option>, repo_owner: Option, + repos_exclude_verify: Option>, } #[derive(serde::Serialize, Debug)] @@ -94,6 +101,13 @@ async fn main() -> Result<(), Box> { }; info!("Target Owner: {}", owner_name); + // Prepare exclusion map for verification (Name -> Reason) + let exclude_verify_map: HashMap = config + .repos_exclude_verify + .as_ref() + .map(|list| list.iter().map(|item| (item.name.clone(), item.reason.clone())).collect()) + .unwrap_or_default(); + // 2. Build 'Desired' State (Map) info!("Resolving desired state from configuration..."); let mut desired_repos: HashMap = HashMap::new(); @@ -164,6 +178,10 @@ async fn main() -> Result<(), Box> { info!("Verifying accessibility of existing repositories..."); let mut verification_failed = false; for name in &existing_set { + if let Some(reason) = exclude_verify_map.get(name) { + info!("Skipping verification for [EXCLUDED]: {} - Reason: {}", name, reason); + continue; + } let repo_url = format!("{}/{}/{}.git", config.gitea_url, owner_name, name); // Use the API key for auth if needed match verify_repo_accessible(&repo_url, &owner_name, Some(&final_api_key)) { @@ -280,14 +298,18 @@ async fn main() -> Result<(), Box> { info!("Successfully migrated {}", name); // Verify after migration if requested if args.verify_canfetch { - let repo_url = format!("{}/{}/{}.git", config.gitea_url, owner_name, name); - match verify_repo_accessible(&repo_url, &owner_name, Some(&final_api_key)) { - Ok(_) => info!("Verified [OK] (Post-Migration): {}", name), - Err(e) => { - error!("Verified [FAIL] (Post-Migration): {} - {}", name, e); - migration_verification_failed = true; - } - } + if let Some(reason) = exclude_verify_map.get(&name) { + info!("Skipping post-migration verification for [EXCLUDED]: {} - Reason: {}", name, reason); + } else { + let repo_url = format!("{}/{}/{}.git", config.gitea_url, owner_name, name); + match verify_repo_accessible(&repo_url, &owner_name, Some(&final_api_key)) { + Ok(_) => info!("Verified [OK] (Post-Migration): {}", name), + Err(e) => { + error!("Verified [FAIL] (Post-Migration): {} - {}", name, e); + migration_verification_failed = true; + } + } + } } }, Err(e) => error!("Failed to migrate {}: {}", name, e), diff --git a/vibe_coding_log/session_2026_01_14_exclude_verify.md b/vibe_coding_log/session_2026_01_14_exclude_verify.md new file mode 100644 index 0000000..d92ac41 --- /dev/null +++ b/vibe_coding_log/session_2026_01_14_exclude_verify.md @@ -0,0 +1,28 @@ +# Session Log: Exclude Repos from Verification + +**Date**: 2026-01-14 +**Model**: Gemini CLI +**Goal**: Add functionality to exclude specific repositories from verification via `repos_exclude_verify` in TOML config. +**Outcome**: Implemented the config field, updated `main.rs` to filter excluded repos during verification steps, and updated `example.toml`. Verified with cargo checks. +**Update**: Enhanced `repos_exclude_verify` to require a mandatory reason for each exclusion. + +## Details + +User requested the ability to exclude specific repositories from the `verify_canfetch` check via the configuration file. +User subsequently requested that the exclusion list requires a mandatory reason string (which can be multiline) and that this reason is printed during execution. + +### Changes + +1. **Modified `src/main.rs`**: + * Defined `ExcludeVerifyConfig` struct with `name` and `reason` fields. + * Updated `Config` struct to use `Option>` for `repos_exclude_verify`. + * In `main()`, parsed the configuration into a `HashMap` mapping repo names to reasons. + * Updated verification loops (initial and post-migration) to check this map. + * If a repo is excluded, the log now prints: `Skipping verification for [EXCLUDED]: - Reason: `. + +2. **Modified `example.toml`**: + * Updated the `repos_exclude_verify` example to show the new table-array syntax with `name` and `reason` fields, including a multiline string example. + +### Verification + +Ran `cargo check`, `cargo clippy`, and `cargo test`. All passed. \ No newline at end of file