Skip to content

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

Closed
flamingo[bot] wants to merge 1 commit into
mainfrom
ai-fix/adhoc-codewiki-src-be-dependency-analyzer-analysis-cloning-p-9ab6c18d-9aa9712c
Closed

flamingo[bot] wants to merge 1 commit into
mainfrom
ai-fix/adhoc-codewiki-src-be-dependency-analyzer-analysis-cloning-p-9ab6c18d-9aa9712c

Conversation

@flamingo

@flamingo flamingo Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

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.

# Fix confidence Finding Location
1 🟡 85 medium Bare except clauses in clone_repository silently swallow git config failures on Windows, hiding real errors codewiki/src/be/dependency_analyzer/analysis/cloning.py:96

What 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-95e5cff4b3cd

Merging 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)

…are except clauses in clone_repository silently swallow git config failures on Windows, hiding real errors

@flamingo flamingo Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 What this fix changed, finding by finding

1 finding(s) fixed in this draft — 1 explained inline on the diff.

Comment on lines 106 to 113
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(
[

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦩 🟠 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

@flamingo flamingo Bot changed the title fix(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 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 Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant