Skip to content
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

refactor: Decoupling Project Analysis from Risk Score Check #12

Merged
merged 6 commits into from
Feb 1, 2024

Conversation

nvima
Copy link
Contributor

@nvima nvima commented Feb 1, 2024

This pull request introduces a significant structural improvement to the Dependency Track plugin by decoupling the project analysis process from the risk score check. Previously, these two functionalities were bundled together in a single task, leading to inefficiencies and the need for timeouts due to the time Dependency Track takes to analyze projects.

Key changes in this update include:

  • Introduction of analyzeProject Task: A new, standalone task that exclusively handles the analysis of projects. This task allows for more precise control over when and how project analysis is triggered, especially useful for projects initially created as inactive.

  • Refinement of Risk Score Check: The risk score check functionality has been isolated into its own task, eliminating the need for timeouts and streamlining the process. This change allows for the risk score check to be integrated at a later stage in the pipeline, such as post end-to-end testing, enhancing the overall workflow efficiency.

  • Updated runDepTrackWorkflow Task: The runDepTrackWorkflow task no longer includes the risk score check. Users who prefer the comprehensive workflow must now explicitly invoke the riskScore task alongside runDepTrackWorkflow.

This pull request introduces a breaking change for users who rely solely on the runDepTrackWorkflow task for risk score assessment. To adapt to this change, such users will need to include the riskScore task in their pipeline explicitly.

The aim of these changes is to offer users more flexibility and control over their CI/CD pipelines, ensuring each task within the Dependency Track plugin is purpose-driven and efficiently executed.

@nvima nvima marked this pull request as ready for review February 1, 2024 13:02
@nvima nvima changed the title refactor: remove project analyze from riskScore refactor: Decoupling Project Analysis from Risk Score Check Feb 1, 2024

- `url`: Dependency Track API URL
- `apiKey`: Dependency Track API KEY
- `projectUUID`: *Optional* - You need to set UUID or projectName and projectVersion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the logic here UUID || (projectName && projectVersion) or is it (UUID && projectVersion) || (projectName && projectVersion)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's "UUID || (projectName && projectVersion)"

Copy link
Member

@Khartris Khartris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Khartris Khartris merged commit 2350f30 into main Feb 1, 2024
1 check passed
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.

None yet

2 participants