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

Feat: v1 fix with version provenance for requirements.txt projects #1777

Merged
merged 6 commits into from
Mar 30, 2021

Conversation

lili2311
Copy link
Contributor

@lili2311 lili2311 commented Mar 29, 2021

What does this PR do?

  • stop skipping files with -r directive (continue not support -c for now)
  • extract all relevant files referenced via -r and apply fixes with this context in mind
  • sometimes we may have already fixed a certain file that snyk test will send to be fixed because it was included by another file.
  • snyk test does not today skip testing files that have already been tested because they are essentially included as part of other tests, however snyk fix needs to separate this so we do not try to apply fixes again to a fixed file.
  • call out previously fixed in the output as we bail to apply changes again there.

Where should the reviewer start?

How should this be manually tested?

Any background context you want to provide?

The logic behind the fix of grouped files is as follows:

  • for each sorted directory
  • fix all entities in the current directory
  • for each entity extract provenance information (find and parse all files that are included via -r)
  • apply all upgrades first across the related files
  • apply the remaining fixes as pins in the entry file (aka the file that was tested via snyk test first)
  • keep track of files that we applied fixes in and skip fixing it if previously fixed

Screenshots

CleanShot 2021-03-29 at 14 09 22@2x

@lili2311 lili2311 force-pushed the feat/fix-with-version-provenance branch from 89ea58b to b286418 Compare March 29, 2021 14:50
@github-actions
Copy link
Contributor

github-actions bot commented Mar 29, 2021

Expected release notes (by @lili2311)

features:
v1 support for previously fixed reqs.txt (b286418)
basic pip fix -r support (0384020)
include pins optionally (f94c558)
do not skip files with -r directive (66ca77a)
fix individual file with provenance (6e84322)

others (will not be included in Semantic-Release notes):
fix individual reqs manifest (bc44f9a)

  • I hereby acknowledge these release notes are 🥙 AWESOME 🥙

@lili2311 lili2311 self-assigned this Mar 29, 2021
@lili2311 lili2311 marked this pull request as ready for review March 29, 2021 18:14
@lili2311 lili2311 requested a review from a team as a code owner March 29, 2021 18:14
@lili2311 lili2311 merged commit 5ebd685 into master Mar 30, 2021
@lili2311 lili2311 deleted the feat/fix-with-version-provenance branch March 30, 2021 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants