feat: add option to fail for incomplete analysis #510
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.
This change adds a flag named
--fail-incomplete
to set a failure code when some analysis results are unknown. This is useful in environments where strictness is desired to prevent adding any new dependency until it passes established policy. This is a mutually exclusive option with--audit
.The name
--strict
was also considered but not used because that name implies a "strict mode" which would be more than just the opposite of audit mode. For instance, the ability to ignore errors with the--ignore-errors
flag should not be possible in a true strict mode. So, the more specific option name was used to limit the effects of specifying it.Testing
The changes in this PR are available for testing with the
maxrake/phylum-ci:stricter
Docker image found on Docker Hub.The
--audit
and--fail-incomplete
options are mutually exclusive:Details
What it looks like for the current released version of
phylum-ci
when analysis is incomplete:Details
What it looks like to submit the same dependency file, but using the new flag provided in this PR:
Details
TODO
phylum-analyze-pr-action
repo will be created toupdate the documentation there to match the changes here