Repository navigation
Fix TruffleHog PR scans that silently scanned nothing - #2648
Conversation
The shallow PR checkout lacks the base commit, so TruffleHog failed to resolve it, scanned 0 chunks, and passed. Fetch full history on PRs, and move the trufflehog:ignore markers in test_mlflow.py onto the lines the nightly scan flags. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Keval Morabia <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe workflow checkout depth now varies by event type. The MLflow credential-splitting test expects the percent-encoded password to decode to ChangesWorkflow checkout
MLflow credential test
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Pull-request scans can compare against the base commit, and the credential test expects the decoded password. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2648 +/- ##
==========================================
- Coverage 68.74% 68.10% -0.65%
==========================================
Files 619 620 +1
Lines 69539 70276 +737
==========================================
+ Hits 47808 47861 +53
- Misses 21731 22415 +684
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
What does this PR do?
Type of change: Bug fix
The nightly
code-qualityrun has failed every night since #2514 merged (e.g. run 36648252702), even though every PR passes.Root cause: on
pull_request,actions/checkoutdoes a depth-1 clone, so the PR's base commit is missing. TruffleHog logsunable to resolve commit: object not found, scans 0 chunks, and exits 0. Every recent PR run shows"chunks": 0, so the PR secret scan has been a no-op. Nightly has no base to diff against and scans the whole tree, so it is the only run that actually checks anything.Changes:
code_quality.yml: fetch full history on PRs (fetch-depth: 0) so--since-commit <base>resolves. Nightly stays shallow, so it keeps scanning the current tree instead of all of git history. ('0'is a string because the number0is falsy in expressions and would fall through to1.)test_mlflow.py:# trufflehog:ignoreonly applies to its own line. The marker sat on the closing), not on the two credential-URI lines that were flagged (1260, 1264). I moved it onto those lines and shortened one test password so the line fits the 100-char limit; it still tests a percent-encoded/.Heads-up: now that PR scans actually run, PRs that add secret-looking strings will fail the scan, as intended.
Testing
URIfindings at lines 1260 and 1264 and exits 183, so it would have blocked that PR.pytest tests/unit/torch/utils/test_mlflow.py -k credentials_move: 6 passed. pre-commit passes on the changed files.Before your PR is "Ready for review"
CONTRIBUTING.md: N/AAdditional Information
The action pulls
trufflehog:latest, so new upstream detectors can change results. It could be pinned via the action'sversion:input; this PR leaves that unchanged.🤖 Generated with Claude Code
Summary by CodeRabbit