feat: automatically analyze newly created projects #514
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 forces analysis when a new project is created. This ensures the project is initially populated with results in the Phylum UI, which helps for users configuring Phylum analysis exclusively through the CI integrations. This is doubly true when the set of dependency files do not include a manifest, which is the other trigger for automatically forcing analysis.
The desire expressed from users of the integrations is that setting up the integration and running it the first time should cause the project dependencies to be ingested without needing to set the
--force-analysis
flag or wait until a PR with a modified dependency file emerges. They also don't want to have to use the Phylum CLI to populate the project(s) before scanning them with the CI integrations.Testing
This is what it looks like with the current released version of
phylum-ci
. A new project is specified and created automatically. However, analysis is not performed because thepoetry.lock
file has not changed. This manifests in the Phylum UI as a "PROJECT SETUP INCOMPLETE" entry in the project listing page for this (legacy/personal) organization.Details (click to expand...)
This is what it looks like to run the same command, but with the changes from this PR. The project name is also different/new so that a new project is created. Notice this time that analysis is forced but the results show no findings because the lockfile has not changed and
--all-deps
was not specified. The Phylum UI is populated with the full analysis results, which is the desired behavior.Details (click to expand...)
This is what it looks like to run the same command a second time. This time, the project already exists and so there is nothing to do, which is the expected behavior.
Details (click to expand...)
This is what it looks like to add the
--all-deps
flag. The project name is also different/new so that a new project is created. Notice this time that analysis is forced and the results show all the findings. The Phylum UI is again populated with the full analysis results.Details (click to expand...)
This is what the Phylum UI project view shows for each of the runs above: