-
Notifications
You must be signed in to change notification settings - Fork 179
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
Integrate snippet scanning into FOSSA CLI #1298
Conversation
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.
Looks good to me!
I added some minor comments on the docs, and thought we should add a unit test on mkCmd
, but none of that blocks approval
root = unBaseDir $ analyzeScanDir conf | ||
|
||
mkCmd :: BinaryPaths -> Path Abs Dir -> AnalyzeConfig -> Command | ||
mkCmd bin root AnalyzeConfig{..} = |
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.
I think it would be worth adding some tests for mkCmd
here and for Snippets/Commit.hs too
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.
IMO tests for what amounts to argument shuffling don't make a lot of sense (I don't write them for any application, nor for main
functions, which is effectively what this is).
That aside, we don't actually have a great way to test this today because we'd need to run an actual analysis inside the test to do so. I've filed this ticket to add the ability to test passed arguments: https://fossa.atlassian.net/browse/ANE-1235
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.
Going to go ahead and merge this for now but happy to talk more on this and do a follow up PR if needed!
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.
Yeah, I'm fine with merging without this. This is on the edge of needing testing and it's not worth doing if it's hard to do.
I think you could do it, though, by exporting mkCmd
and just testing that. I do that for themisFlags
, which is pretty much the same thing as mkCmd
, here: https://github.com/fossas/fossa-cli/blob/master/test/App/Fossa/RunThemisSpec.hs
Overview
Integrates snippet scanning into FOSSA CLI as
fossa snippets
.Acceptance criteria
Users no longer need to run this as a separate subcommand.
Testing plan
I tested manually:
Risks
No major risk, although we're taking on some backwards compatibility commitments here.
Metrics
None
References
https://fossa.atlassian.net/browse/ANE-1136
Checklist
docs/
.Changelog.md
. If this PR did not mark a release, I added my changes into an# Unreleased
section at the top..fossa.yml
orfossa-deps.{json.yml}
, I updateddocs/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
).docs/references/subcommands/<subcommand>.md
.