Skip to content
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

Merged
merged 19 commits into from
Oct 3, 2024

Conversation

pauld-msft
Copy link
Member

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.

@pauld-msft pauld-msft requested a review from a team as a code owner October 2, 2024 16:52
@pauld-msft pauld-msft requested a review from amitla1 October 2, 2024 16:52
Copy link

github-actions bot commented Oct 2, 2024

👋 Hi! It looks like you modified some files in the Detectors folder.
You may need to bump the detector versions if any of the following scenarios apply:

  • The detector detects more or fewer components than before
  • The detector generates different parent/child graph relationships than before
  • The detector generates different devDependencies values than before

If none of the above scenarios apply, feel free to ignore this comment 🙂

Copy link
Contributor

@RushabhBhansali RushabhBhansali left a comment

Choose a reason for hiding this comment

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

provided comments

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 93.58289% with 24 lines in your changes missing coverage. Please review.

Project coverage is 89.1%. Comparing base (15c96f4) to head (d75c410).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...tion.Contracts/FileComponentDetectorWithCleanup.cs 79.7% 14 Missing and 3 partials ⚠️
...cts.Tests/FileComponentDetectorWithCleanupTests.cs 98.1% 4 Missing ⚠️
...mponentDetection.Common/DirectoryUtilityService.cs 91.6% 2 Missing ⚠️
...ft.ComponentDetection.Common/FileUtilityService.cs 0.0% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@pauld-msft pauld-msft merged commit ed4488a into main Oct 3, 2024
22 of 25 checks passed
@pauld-msft pauld-msft deleted the pauldorsch/remove-created-py-files branch October 3, 2024 20:49
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.

2 participants