-
Notifications
You must be signed in to change notification settings - Fork 197
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(frontend): Upstream and Downstream hierarchy display on frontend #3208
base: master
Are you sure you want to change the base?
Conversation
@@ -302,9 +303,25 @@ def bug_to_response(bug, detailed=True): | |||
if detailed: | |||
add_links(response) | |||
add_source_info(bug, response) | |||
add_stream_info(bug, response) |
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.
how long does this take, relative to the other add info functions?
for child in graph[vuln_id]: | ||
if child != target_bug_id: | ||
output_lines.append("<ul>") | ||
print_subtree(child) |
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.
does this handle cycles?
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.
Just added a change that will prevent the cycle from displaying, and will log an error, but won't prevent the whole vuln from being displayed.
"""Add upstream hierarchy information to `response`.""" | ||
# Check whether there are upstreams | ||
if bug.upstream_raw: | ||
upstream_hierarchy_string = get_upstreams_of_vulnerability(bug.db_id) |
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.
Maybe we can use response['upstream'], which already contains upstream information from the upstream_group. Passing response['upstream'] into the function can save a query.
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.
As far as I can tell, response['upstream'] doesn't exist. and bug only has bug.upstream_raw, which we can't rely on to be the full set of transitive upstreams to feed to the hierarchy string generator.
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.
Yeah bug
itself doesn't contain the final upstream, but vulnerability
does. The response here is converted from vulnerability
. We did queries for upstream and aliases inside the to_vulnerability() function.
Added the logic to display the hierarchy of the upstream and downstream vuln entries.
Example of top, middle, and bottom levels of vulns: