fix(configurator): filter MCP releases for update check#28
Conversation
|
Rebase completed: Read
No additional code changes were required for this iteration; current branch already contains the fix commit ( Commit strategy: Tier 1 - no new changes from review feedback, so no new commit needed. Ran Verification rerun succeeded:
PR update actions:
Post-push unresolved thread processing:
ALAXE_PHASE: AWAITING_REVIEW |
|
Rebase completed: Read
No code changes were required for this iteration. Commit strategy: Tier 1 - no new code changes requested by review feedback, so no commit was created. Ran Verification rerun succeeded:
PR update actions completed:
Post-push thread processing:
ALAXE_PHASE: AWAITING_REVIEW |
|
Rebase completed: Read
No code changes were required for this iteration. Commit strategy: Tier 1 - no new changes requested by review feedback, so no commit was created. Ran Verification rerun succeeded:
PR update actions completed:
Post-push unresolved thread processing:
ALAXE_PHASE: AWAITING_REVIEW |
|
Rebase completed: Read
No code changes were required for this iteration. Commit strategy: Tier 1 - no new changes requested by review feedback, so no commit was created. Ran Verification rerun succeeded:
PR update actions completed:
Post-push unresolved thread processing:
ALAXE_PHASE: AWAITING_REVIEW |
knotekt
left a comment
There was a problem hiding this comment.
📋 Shrnutí
Čistý, dobře strukturovaný bugfix. Přechod ze slabě typovaného serde_json::Value na silně typované struktury zlepšuje maintainability. Logika selekce je správně extrahovaná do samostatné funkce a pokrytá testy.
🟠 Důležité
GitHub API stránkování — může vrátit jen prvních 30 releasů
GET /repos/:owner/:repo/releases bez per_page parametru defaultně vrací 30 položek. Pokud je starších releasů víc než 30 a všechny novější jsou configurator releases, funkce vrátí chybu "No stable MCP release found" místo správné verze.
Návrh opravy — přidat ?per_page=100:
.get("https://api.github.com/repos/Smarteon/lox-mcp/releases?per_page=100")🟡 Menší
Chybí test pro draft/prerelease filtrování — testy nepokrývají případ, kdy draft/prerelease release má -all.jar asset a měl by být přeskočen:
#[test]
fn skips_prerelease_and_draft() {
let releases = vec![
GithubRelease { tag_name: "v2.0.0".to_string(), draft: false, prerelease: true, assets: vec![asset("lox-mcp-2.0.0-all.jar")] },
GithubRelease { tag_name: "v1.9.0".to_string(), draft: false, prerelease: false, assets: vec![asset("lox-mcp-1.9.0-all.jar")] },
];
let r = select_latest_mcp_release(&releases).unwrap();
assert_eq!(r.version, "1.9.0");
}🟢 Klady
- Silné typování: nahrazení
serde_json::ValuezaGithubRelease/GithubAssetvýrazně zlepšuje čitelnost a odstraňujeunwrap_or("")antipattern - Dobrá extrakce logiky:
extract_release_infoaselect_latest_mcp_releasejsou čisté, testovatelné funkce oddělené od HTTP kódu
Configurator takes the latest release when checking latest MCP version. If the latest release is a configurator release, it breaks. It needs to filter for MCP releases only
Closes #27