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

Add active Field To Project Versions #3691

Conversation

aravindparappil46
Copy link
Contributor

@aravindparappil46 aravindparappil46 commented May 10, 2024

Description

In order for the frontend to distinguish between active or inactive project versions, we need to include the active boolean field to ProjectVersion model.

Addressed Issue

Required for DependencyTrack/frontend#844

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

In order for the UI to distinguish between active or inactive project versions,
we need to include the active boolean field to ProjectVersion model

Signed-off-by: Aravind Parappil <[email protected]>
Copy link

codacy-production bot commented May 10, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.02% (target: -1.00%) 100.00% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (cf4f2d4) 22058 16750 75.94%
Head commit (14fa2eb) 22045 (-13) 16745 (-5) 75.96% (+0.02%)

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 (#3691) 2 2 100.00%

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 will stop sending the deprecated coverage status from June 5th, 2024. Learn more

Unit test added which checks for the active field, given 3 versions of same project exists

Signed-off-by: Aravind Parappil <[email protected]>
@nscuro
Copy link
Member

nscuro commented May 10, 2024

@aravindparappil46 The coverage check is failing, primarily because the change itself is so tiny.

We can bypass it, but another solution could be to remove the set* methods from the ProjectVersion class. DataNucleus can use the constructor to instantiate the class. It seems the missing coverage here comes from the fact that the setActive method is never called.

@nscuro nscuro added this to the 4.12 milestone May 10, 2024
@nscuro nscuro added the enhancement New feature or request label May 10, 2024
This is to see if the Codacy coverage report succeeds

Signed-off-by: Aravind Parappil <[email protected]>
@aravindparappil46
Copy link
Contributor Author

Thank you @nscuro ! I removed the setActive which I added and the coverage check is passing now.
Do let me know if you'd prefer removing all of the setters (I didn't want to refactor parts I didn't touch without confirming)

@nscuro
Copy link
Member

nscuro commented May 11, 2024

Do let me know if you'd prefer removing all of the setters [...]

I think that would be good to avoid future confusion. You could also simply convert ProjectVersion to a record instead.

Signed-off-by: Aravind Parappil <[email protected]>
@nscuro nscuro merged commit 2b9a0a8 into DependencyTrack:master May 12, 2024
12 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 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.

2 participants