Pass snippet scan retention days to ficus #1586
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR gets the snippet-scan-retention-days setting from the response of
GET /api/cli/organization
and, if it exists in the response, passes it into Ficus via the--snippet-scan-retention-days
flag.The full workflow is:
/api/cli/organization
endpoint (https://github.com/fossas/FOSSA/pull/16333)Acceptance criteria
The CLI will pass the snippet scan retention days param into Ficus via the
--snippet-scan-retention-days
flag if it exists in the response from Core.If it does not exist in the response from Core, then it will not pass the flag in when it invokes Ficus. Ficus will default to 30 days.
Testing plan
You'll need a version of Ficus that uses this flag.
I did this by:
Then you can re-compile the CLI and it will embed the new Ficus version.
You'll also want to be running a version of Core that includes that setting in the response to
GET /api/cli/organization
. https://github.com/fossas/FOSSA/pull/16333 is merged, so you can just use prod.Go into the org settings and set snippet scan retention days to something other than 30.
Now run the CLI against production:
The scan should complete successfully and create an analysis. The logs will tell you what the analysis ID is.
Look in the production sparkle DB. It should have an
contents_expiration
that matches the retention days that you set in Core. I set it to 10 days from now, and that's what I see:Risks
Metrics
References
Checklist
docs/
.docs/README.ms
and gave consideration to how discoverable or not my documentation is.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
AND I have updated example files used byfossa 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
).docs/references/subcommands/<subcommand>.md
.