Add ability to exclude repos from verification with mandatory reason

```
│  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.
```
This commit is contained in:
2026-01-14 22:01:17 -05:00
parent 20ffe86776
commit 832af0e36a
3 changed files with 67 additions and 8 deletions

View File

@@ -16,6 +16,15 @@ repos = [
{ url = "https://github.com/justcallmekoko/ESP32Marauder" } { 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 = [ organizations = [
{ url = "https://gitea.hak8or.com/mirrors" }, { url = "https://gitea.hak8or.com/mirrors" },
] ]

View File

@@ -49,6 +49,12 @@ struct OrgConfig {
api_key: Option<String>, api_key: Option<String>,
} }
#[derive(Deserialize, Debug, Clone)]
struct ExcludeVerifyConfig {
name: String,
reason: String,
}
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]
struct Config { struct Config {
gitea_url: String, gitea_url: String,
@@ -56,6 +62,7 @@ struct Config {
repos: Option<Vec<RepoConfig>>, repos: Option<Vec<RepoConfig>>,
organizations: Option<Vec<OrgConfig>>, organizations: Option<Vec<OrgConfig>>,
repo_owner: Option<String>, repo_owner: Option<String>,
repos_exclude_verify: Option<Vec<ExcludeVerifyConfig>>,
} }
#[derive(serde::Serialize, Debug)] #[derive(serde::Serialize, Debug)]
@@ -94,6 +101,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}; };
info!("Target Owner: {}", owner_name); info!("Target Owner: {}", owner_name);
// Prepare exclusion map for verification (Name -> Reason)
let exclude_verify_map: HashMap<String, String> = 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<RepoName, CloneUrl>) // 2. Build 'Desired' State (Map<RepoName, CloneUrl>)
info!("Resolving desired state from configuration..."); info!("Resolving desired state from configuration...");
let mut desired_repos: HashMap<String, String> = HashMap::new(); let mut desired_repos: HashMap<String, String> = HashMap::new();
@@ -164,6 +178,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
info!("Verifying accessibility of existing repositories..."); info!("Verifying accessibility of existing repositories...");
let mut verification_failed = false; let mut verification_failed = false;
for name in &existing_set { 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); let repo_url = format!("{}/{}/{}.git", config.gitea_url, owner_name, name);
// Use the API key for auth if needed // Use the API key for auth if needed
match verify_repo_accessible(&repo_url, &owner_name, Some(&final_api_key)) { match verify_repo_accessible(&repo_url, &owner_name, Some(&final_api_key)) {
@@ -280,14 +298,18 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
info!("Successfully migrated {}", name); info!("Successfully migrated {}", name);
// Verify after migration if requested // Verify after migration if requested
if args.verify_canfetch { if args.verify_canfetch {
let repo_url = format!("{}/{}/{}.git", config.gitea_url, owner_name, name); if let Some(reason) = exclude_verify_map.get(&name) {
match verify_repo_accessible(&repo_url, &owner_name, Some(&final_api_key)) { info!("Skipping post-migration verification for [EXCLUDED]: {} - Reason: {}", name, reason);
Ok(_) => info!("Verified [OK] (Post-Migration): {}", name), } else {
Err(e) => { let repo_url = format!("{}/{}/{}.git", config.gitea_url, owner_name, name);
error!("Verified [FAIL] (Post-Migration): {} - {}", name, e); match verify_repo_accessible(&repo_url, &owner_name, Some(&final_api_key)) {
migration_verification_failed = true; 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), Err(e) => error!("Failed to migrate {}: {}", name, e),

View File

@@ -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<Vec<ExcludeVerifyConfig>>` for `repos_exclude_verify`.
* In `main()`, parsed the configuration into a `HashMap<String, String>` 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]: <name> - Reason: <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.