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

Introduce isLatest project flag & allow policies to be limited to latest version #4184

Merged

Conversation

rkg-mm
Copy link
Contributor

@rkg-mm rkg-mm commented Sep 27, 2024

Description

Frontend PR: DependencyTrack/frontend#1017

Implements #4148 :

  1. Allows projects to be marked as "latest version" via API endpoints allowing creation and updating of projects
  2. It is ensured only 1 project version (per project name) is marked as latest, previously marked version is no longer set to latest after a new version is set to latest
  3. Allows policies to be limited to project versions marked as latest (e.g. helpful to only apply the version distance policy to the latest development version)
  4. Fixed Bug: ProjectQueryManager contains 2 createProject() Methods, but only one triggered a PROJECT_CREATED event. Refactored both methods to use same implementation to avoid such inconsistencies.

Addressed Issue

closes #4148

Additional Details

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@rkg-mm rkg-mm force-pushed the 4148-introduce-isLatest-project-flag branch from 6428a8f to cee3701 Compare September 28, 2024 21:34
*Simplify Boolean to boolean in Project and Policy and remove unncessary migration script part
*Move reads into transaction
*remove unnecessary index
*Rename ONLY_FOR_LATEST_PROJECT_VERSION to ONLY_LATEST_PROJECT_VERSION

Signed-off-by: Ralf King <[email protected]>
Copy link

codacy-production bot commented Sep 28, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.05% (target: -1.00%) 90.85% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7b18365) 22159 17511 79.02%
Head commit (229a326) 22268 (+109) 17609 (+98) 79.08% (+0.05%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4184) 142 129 90.85%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link
Member

@nscuro nscuro left a comment

Choose a reason for hiding this comment

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

Great work, thanks!

@nscuro nscuro merged commit d27c070 into DependencyTrack:master Sep 29, 2024
11 checks passed
@nscuro nscuro changed the title feat#4148 introduce is latest project flag & allow policies to be limited to latest version Introduce isLatest project flag & allow policies to be limited to latest version Sep 29, 2024
@nscuro nscuro added the enhancement New feature or request label Sep 29, 2024
@nscuro nscuro added this to the 4.12 milestone Sep 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce isLatest flag to mark latest version of project
2 participants