Skip to content

Conversation

@james-fossa
Copy link
Contributor

@james-fossa james-fossa commented May 1, 2025

Overview

Passes LicenseScanPathFilters to lernie to give only and exclude globs to lernie pursuant to this PR.

Acceptance criteria

Passes the new arguments to Lernie.

Testing plan

  • rm ./vendor-bins/*
  • `./vendor
  • Create a directory structure like that below (mkdir -p a/b b c/b d/e/b && echo test | tee a/b/license.txt b/license.txt b/not-license.txt c/b/license.txt d/e/b/license.txt > /dev/null && touch a/b/pom.xml b/pom.xml d/e/b/pom.xml works)
  • Use a .fossa.yml like that below.
  • Run fossa analyze --output on the dir. You should see results for every license.txt but not not-license.txt
  • Uncomment the exclude line and repeat. You should see no results.

Tree Structure

├── a
│   └── b
│       ├── license.txt
│       └── pom.xml
├── b
│   ├── license.txt
│   ├── not-license.txt
│   └── pom.xml
├── c
│   └── b
│       └── license.txt
└── d
    └── e
        └── b
            ├── license.txt
            └── pom.xml

Fossa Yaml

version: 3

server:: https://app.fossa.com
apiKey: REDACTED

project:
  locator: custom+1/jclemer/ane-1070

customLicenseSearch:
  - matchCriteria: test
    name: "Test ANE-1070"

vendoredDependencies:
dependencies.md#path-filtering
  licenseScanPathFilters:
    only:
      - "**/*.txt"
    exclude:
      - "**/not-license.txt"
      # To test that exclude works on the directory level, un-comment the next line:
      # - "**/b/*.txt"
customLicenseSearch:
   - matchCriteria: test
     name: "Proprietary License"

Output

Should include

With just the not-license.txt Exclusion

* Custom-License Search: succeeded
  ** Proprietary License - /Users/jclemer/testcli/a/b/license.txt (lines 1-1)
  ** Proprietary License - /Users/jclemer/testcli/c/b/license.txt (lines 1-1)
  ** Proprietary License - /Users/jclemer/testcli/b/license.txt (lines 1-1)
  ** Proprietary License - /Users/jclemer/testcli/d/e/b/license.txt (lines 1-1)

With Exclusions

* Custom-License Search: succeeded
  ** No results found

Risks

I'm pretty confident the glob library we're using in lernie is semantically compatible with what's going on in themis but there could always be an edge case somewhere.

Metrics

N/A

References

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 PR added docs, I added links as appropriate to the user manual's ToC in docs/README.ms and gave consideration to how discoverable or not my documentation is.
  • 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 AND I have updated example files used by fossa init command. 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).
  • If I made changes to a subcommand's options, I updated docs/references/subcommands/<subcommand>.md.

@james-fossa james-fossa requested a review from spatten May 1, 2025 21:47
@james-fossa james-fossa force-pushed the jclemer/ane-1070 branch 7 times, most recently from d5bd737 to 5ed5e21 Compare May 2, 2025 15:53
@james-fossa james-fossa marked this pull request as ready for review May 2, 2025 16:26
@james-fossa james-fossa requested a review from a team as a code owner May 2, 2025 16:26
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 great! I left one small comment on the test, but nothing blocking

@james-fossa james-fossa enabled auto-merge (squash) May 9, 2025 15:27
@james-fossa james-fossa merged commit 22c43f7 into master May 12, 2025
18 of 19 checks passed
@james-fossa james-fossa deleted the jclemer/ane-1070 branch May 12, 2025 15:14
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.

3 participants