-
-
Notifications
You must be signed in to change notification settings - Fork 587
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
🚧 WIP: Add Project Tags To Findings #3797
base: master
Are you sure you want to change the base?
🚧 WIP: Add Project Tags To Findings #3797
Conversation
In order to display tags in the vulnerability audit page, added tags to the resultant finding object Signed-off-by: Aravind Parappil <[email protected]>
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more |
I would advise against This should be solvable with a simple EXISTS (
SELECT 1
FROM "TAG"
INNER JOIN "PROJECTS_TAGS"
ON "PROJECTS_TAGS"."TAG_ID" = "TAG"."ID"
WHERE "PROJECTS_TAGS"."PROJECT_ID" = "PROJECT"."ID"
AND "TAG"."NAME" = 'foo'
) Similar to how it's done for the portfolio ACL check: dependency-track/src/main/java/org/dependencytrack/persistence/FindingsSearchQueryManager.java Lines 351 to 378 in f785fc5
|
final Project project = component.getProject(); | ||
if (project != null) { | ||
finding.getComponent().put("tags", project.getTags()); | ||
} | ||
final Analysis analysis = getAnalysis(component, vulnerability); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be made more clear that these are project tags and not finding tags? A future DT version might have finding level tags. Name the field project-tags
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@valentijnscholten Totally agree. Will make the change!
There's also users that use the |
Good question. How would you expect it to be handled? At the moment there's not a lot of "inheritance" logic for the parent-child construct. |
Description
In order to display tags in the vulnerability audit page, added tags to the response of
/findings
API.Addressed Issue
Partially addresses frontend issue: DependencyTrack/frontend#849
Additional Details
Right now, this PR just adds the
tags
to the/finding
API response (used by the Vulnerability Audit page to display it)Help Needed
Need some help figuring out how to filter
Finding
bytags
🤔I understand that filtering is currently done in
FindingsSearchQueryManager.processFilters()
, but unsure how to edit the SQL query to be able to filter by project tags.I see that
Tag
is a child table ofParent
, so guessing we need someLEFT JOIN
magic inFinding.QUERY_ALL_FINDINGS
🪄 🧠Checklist