fix(adhoc-codewiki-src-be-dependency-analyzer-analysis-cloning-py): CU-86akn96pk Bare except clauses in clone_repository silently swallow git config failures on Windows, hiding real errors - #100
flamingo[bot] wants to merge 1 commit into
Conversation
…are except clauses in clone_repository silently swallow git config failures on Windows, hiding real errors
| capture_output=True, | ||
| text=True, | ||
| ) | ||
| except: | ||
| pass | ||
| except (OSError, subprocess.SubprocessError) as e: | ||
| logger.debug(f"Failed to set git core.longpaths on Windows: {e}") | ||
|
|
||
| subprocess.run( | ||
| [ |
There was a problem hiding this comment.
🦩 🟠 Bare except clauses in clone_repository silently swallow git config failures on Windows, hiding real errors
In clone_repository (codewiki/src/be/dependency_analyzer/analysis/cloning.py), replaced both bare except: clauses (one around the git config core.longpaths call, one around the sparse-checkout config/read-tree block) with except (OSError, subprocess.SubprocessError) as e: combined with logger.debug(...) calls that log the caught exception. This preserves the existing non-fatal behavior for expected Windows edge cases while making unexpected failures visible via debug logging, and no longer masks unrelated exceptions like KeyboardInterrupt/SystemExit since those are not subclasses of OSError or subprocess.SubprocessError.
🤖 Prompt for AI agents
In codewiki/src/be/dependency_analyzer/analysis/cloning.py around line 96, review and complete this code-review fix: Bare except clauses in clone_repository silently swallow git config failures on Windows, hiding real errors.
What the draft fix changed: In `clone_repository` (codewiki/src/be/dependency_analyzer/analysis/cloning.py), replaced both bare `except:` clauses (one around the `git config core.longpaths` call, one around the sparse-checkout config/read-tree block) with `except (OSError, subprocess.SubprocessError) as e:` combined with `logger.debug(...)` calls that log the caught exception. This preserves the existing non-fatal behavior for expected Windows edge cases while making unexpected failures visible via debug logging, and no longer masks unrelated exceptions like `KeyboardInterrupt`/`SystemExit` since those are not subclasses of `OSError` or `subprocess.SubprocessError`.
Verify the change is correct and complete; do not refactor unrelated code.
fix confidence: 🟡 85 medium — react 👍/👎 to teach the reviewer
Closes findings from rule adhoc-codewiki-src-be-dependency-analyzer-analysis-cloning-py — Bare except clauses in clone_repository silently swallow git config failures on Windows, hiding real errors.
Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.
codewiki/src/be/dependency_analyzer/analysis/cloning.py:96What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.
Run: https://product-hub.flamingo.so/admin/code-review
Run id:
9aa9712c-4ca2-4571-94bc-95e5cff4b3cdMerging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.
ClickUp task: CU-86akn96pk CodeWiki review findings sweep (9 PRs)