Send groupby to defect dojo#6130
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | -50 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
b32ecb7 to
a39e973
Compare
…erty Signed-off-by: webdevred <148627186+webdevred@users.noreply.github.com>
When set, forwards the value as group_by in the DefectDojo import-scan and reimport-scan multipart form requests, allowing findings to be grouped into Finding Groups on import. When not set, behavior is unchanged (backwards compatible). Closes DependencyTrack#6061 Signed-off-by: webdevred <148627186+webdevred@users.noreply.github.com>
…TrackFindings Signed-off-by: webdevred <148627186+webdevred@users.noreply.github.com>
a39e973 to
5025266
Compare
Signed-off-by: webdevred <148627186+webdevred@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds support for forwarding DefectDojo’s group_by import option from a per-project Dependency-Track property, enabling DefectDojo finding grouping during import and reimport.
Changes:
- Adds
defectdojo.groupBylookup in the DefectDojo uploader. - Sends
group_bymultipart form field for both import and reimport requests when configured. - Adds unit/integration-style tests and documentation for the new project property.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/main/java/org/dependencytrack/integrations/defectdojo/DefectDojoUploader.java |
Reads the new per-project group-by property and passes it to the client. |
src/main/java/org/dependencytrack/integrations/defectdojo/DefectDojoClient.java |
Adds group_by to DefectDojo import/reimport multipart requests. |
src/test/java/org/dependencytrack/integrations/defectdojo/DefectDojoUploaderTest.java |
Tests configured and unconfigured groupBy property lookup. |
src/test/java/org/dependencytrack/tasks/DefectDojoUploadTaskTest.java |
Verifies group_by is sent for import and reimport flows. |
docs/_docs/integrations/defectdojo.md |
Documents the new defectdojo.groupBy project property. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: August Johansson <148627186+webdevred@users.noreply.github.com>
Applied, thanks |
|
Hi @webdevred, please re-target your PR at either |
Description
DefectDojo's import-scan and reimport-scan endpoints accept a
group_byparameter that clusters findings into Finding Groups on import, but Dependency-Track never forwarded it. This adds a new per-project propertydefectdojo.groupBythat, when set, is sent asgroup_byin the multipart form for both import and reimport requests.Also removes a pre-existing dead
.build()call at the end of thereimportDependencyTrackFindingsfluent chain whose return value was discarded beforerequest.setEntity()was called.I have verified that after the findings groups are created in Defect Dojo in my own local test environment.
Addressed Issue
Closes #6061
Additional Details
The implementation follows the same pattern as
defectdojo.testTitle(#4796): a per-projectProjectPropertyis read inDefectDojoUploaderand forwarded as a multipart form field inDefectDojoClient. No new abstraction was introduced.The fix to
reimportDependencyTrackFindings(removing the dangling.build()call at the end of the fluentMultipartEntityBuilderchain) is included here because it was discovered while addinggroup_bysupport to that method. It was pre-existing dead code, the return value was discarded and the actual entity was set correctly via a laterbuilder.build()call, so it had no runtime effect.Checklist