-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: secret scan pre-commit crashing on big merges #1048
fix: secret scan pre-commit crashing on big merges #1048
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1048 +/- ##
==========================================
- Coverage 92.10% 91.76% -0.34%
==========================================
Files 181 143 -38
Lines 7762 6048 -1714
==========================================
- Hits 7149 5550 -1599
+ Misses 613 498 -115
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking good to me!
As our CI is running tests in Windows environment, is it possible to design a test which would crash before and now pass? Or are there blockers for such a test?
I added a test that crashed on Windows before the change and passes now. The test is a bit slow, however, as it generates a lot of files, and I can't use cassettes to speed it up so I don't know if we want to keep it. WDYT @sevbch ? |
I tried locally launching your test and it took 0.2s. It's indeed a bit slow for a unit test but it seems acceptable to me. I'd rather keep the test to prevent us from future regressions. |
4e75c15
to
4af42f9
Compare
Context
ggshield secret scan pre-commit
crashes on Windows when committing a merge with many long file names with[WinError 206] The filename or extension is too long
.This happens because ggshield is building a git command that is longer than the maximum path length on Windows. (see #1032 ).
What has been done
Functions that execute git commands on all files in a merge were updated to process files in batches, respecting the limit defined by
MAX_FILES_PER_GIT_COMMAND
.Validation
On Windows:
PR check list
skip-changelog
label has been added to the PR.