-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add support for cleaning up files created by tool #1259
Conversation
…p install report dry run
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
src/Microsoft.ComponentDetection.Detectors/pip/PipReportComponentDetector.cs
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Contracts/FileComponentDetectorWithCleanup.cs
Outdated
Show resolved
Hide resolved
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.
provided comments
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1259 +/- ##
======================================
Coverage 89.1% 89.1%
======================================
Files 360 364 +4
Lines 28076 28436 +360
Branches 1790 1807 +17
======================================
+ Hits 25027 25364 +337
- Misses 2661 2682 +21
- Partials 388 390 +2 ☔ View full report in Codecov by Sentry. |
Problem
The python PipReport detector creates some files during its run of
pip install --report --dry-run
. There aren't options in the pip install cli that can restrict or clean up these files.Solution
Introduce a new property on the FileComponentDetector that can be overridden in the inheriting classes to specify files/directories that the detector may create and that should be cleaned up after the detector has run. This will only remove new files that were added during detection run, and will leave existing files that match the specified patterns.