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

feat: autocreate project with tags #3843

Merged
merged 4 commits into from
Jun 18, 2024
Merged

feat: autocreate project with tags #3843

merged 4 commits into from
Jun 18, 2024

Conversation

JCHacking
Copy link
Contributor

@JCHacking JCHacking commented Jun 13, 2024

Description

To be able to upload a bom and auto-create the project with specific tags

Addressed Issue

#1674

Additional Details

I have added the optional property to the PUT method to upload BOM files, I have not programmed much in Java so any suggestion to improve this PR is welcome.
Thanks!!!

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

Refs: 1674

Signed-off-by: JCHacking <[email protected]>
@valentijnscholten
Copy link
Contributor

I like it. Can you add a test with tags populated?

@JCHacking
Copy link
Contributor Author

Sure! Tests added

@nscuro nscuro added the enhancement New feature or request label Jun 14, 2024
@nscuro nscuro added this to the 4.12 milestone Jun 14, 2024
Refs: 1674

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

I see that the test has failed, I imagine that it is because it is not the same object since one is the tags only with name and the others are the tags obtained from the persistence that will have more properties.

I should only make an assertEquals of the list of strings with the name of the tags, right?

@nscuro
Copy link
Member

nscuro commented Jun 18, 2024

I should only make an assertEquals of the list of strings with the name of the tags, right?

Yes. Consider using AssertJ's fluent assertions, like so:

assertThat(project.getTags())
    .extracting(Tag::getName)
    .containsExactlyInAnyOrder("foo", "bar");

Refs: 1674

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

Fixed it with your suggestion, thanks!!

Copy link

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 (1a4857f) 21715 16485 75.92%
Head commit (df322b4) 21717 (+2) 16490 (+5) 75.93% (+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 (#3843) 4 4 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


🚀 Don’t miss a bit, follow what’s new on Codacy.

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.

Thanks!

@nscuro nscuro merged commit 66e9ae3 into DependencyTrack:master Jun 18, 2024
11 checks passed
@nscuro nscuro mentioned this pull request Jun 30, 2024
nscuro added a commit to nscuro/dependency-track that referenced this pull request Jul 9, 2024
Signed-off-by: nscuro <[email protected]>

DependencyTrack#3843 added the parameter to the JSON-based `PUT /v1/bom` endpoint.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 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.

3 participants