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

[ANE-699] Analysis discovery filter should be applied prior to analysis #1194

Merged
merged 2 commits into from
May 23, 2023

Conversation

meghfossa
Copy link
Contributor

@meghfossa meghfossa commented May 17, 2023

Overview

This PR,

  • Makes default non-production path filtering prior to analysis stage

Currently, discovery path filters are applied at walk', so we don't even discover the targets, but for non-production path filtering
I did not choose this approach, as we still want to show that we intentionally skipped this discovered targets in scan summary. If,
we choose to apply non-production path filtering at walk' stage - users won't know why certain projects were skipped.

Acceptance criteria

  • Targets in default non-production path (e.g. /docs, .git/, etc.) should not be analyzed

Testing plan

Here is the directory structure (zip attached) for filesystem, and (sandbox/container.tar) for container.
sandbox.zip

.
├── Dockerfile
├── backend
│   ├── docs
│   │   └── reqs.txt
│   └── util
│       └── example
│           └── reqs.txt
├── container.tar
├── docs
│   └── app
│       └── reqs.txt
└── reqs.txt

7 directories, 6 files
  1. git pull origin && git checkout feat/non-prod-path-discovery-filters && make install-dev
  2. fossa-dev analyze <extracted-zip-dir> -o | jq
  3. fossa-dev container analyze <extracted-zip-dir/container.tar> -o | jq

For both of this you should see only 1 source unit manifest for reqs.txt

Risks

N/A

References

ANE-699

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).
  • If this PR introduced a user-visible change, I added documentation into docs/.
  • If this change is externally visible, I updated Changelog.md. If this PR did not mark a release, I added my changes into an # Unreleased section at the top.
  • If I made changes to .fossa.yml or fossa-deps.{json.yml}, I updated docs/references/files/*.schema.json. You may also need to update these if you have added/removed new dependency type (e.g. pip) or analysis target type (e.g. poetry).

@meghfossa meghfossa marked this pull request as ready for review May 17, 2023 21:52
@meghfossa meghfossa requested a review from a team as a code owner May 17, 2023 21:52
@meghfossa meghfossa requested a review from zlav May 17, 2023 21:52
Copy link
Contributor

@spatten spatten left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me!

@meghfossa meghfossa force-pushed the feat/non-prod-path-discovery-filters branch from 9bcc64e to b94e44c Compare May 18, 2023 21:10
@meghfossa meghfossa enabled auto-merge (squash) May 18, 2023 21:10
@meghfossa meghfossa disabled auto-merge May 18, 2023 21:30
@meghfossa meghfossa force-pushed the feat/non-prod-path-discovery-filters branch from b94e44c to 1c177ab Compare May 23, 2023 15:45
@meghfossa meghfossa force-pushed the feat/non-prod-path-discovery-filters branch from 7bde369 to 578b828 Compare May 23, 2023 17:04
@meghfossa meghfossa enabled auto-merge (squash) May 23, 2023 17:05
@meghfossa meghfossa merged commit 9896845 into master May 23, 2023
17 checks passed
@meghfossa meghfossa deleted the feat/non-prod-path-discovery-filters branch May 23, 2023 17:47
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.

None yet

2 participants