Skip to content

Commit

Permalink
Update package details template to show Ghost tag
Browse files Browse the repository at this point in the history
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
  • Loading branch information
keshav-space committed Aug 23, 2024
1 parent d0465cc commit b848747
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Generated by Django 4.1.13 on 2024-08-23 10:03
# Generated by Django 4.1.13 on 2024-08-23 12:47

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("vulnerabilities", "0060_alter_kev_known_ransomware_campaign_use_and_more"),
("vulnerabilities", "0061_alter_packagechangelog_software_version_and_more"),
]

operations = [
Expand Down
4 changes: 2 additions & 2 deletions vulnerabilities/pipelines/flag_ghost_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def detect_and_flag_ghost_packages(logger=None):

def flag_ghost_package(base_purl, packages, logger=None):
"""
Check if all the versions of the `purl` are available upstream.
If they are not available, update the `is_ghost` to `True`.
Check if `packages` are available upstream.
If not, update `is_ghost` to `True`.
"""
if not base_purl.type in RANGE_CLASS_BY_SCHEMES:
return 0
Expand Down
15 changes: 9 additions & 6 deletions vulnerabilities/templates/package_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,21 @@
{{ fixed_package_details.purl.to_string }}
</td>
</tr>
{% if package.is_ghost %}
<tr>
<td class="two-col-left">
<span
class="has-tooltip-multiline has-tooltip-black has-tooltip-arrow has-tooltip-text-left"
data-tooltip="The status of the package can be Malicious, Ghost, Yanked, Valid, or Unknown.">
status
</span>
Tags
</td>
<td class="two-col-right">
{{ package.get_status_display }}
<span
class="tag is-warning is-hoverablem has-tooltip-multiline has-tooltip-black"
data-tooltip="This package does not exist in the upstream package manager or its repository."
style="margin-right: 8px;">
Ghost
</span>
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
Expand Down

0 comments on commit b848747

Please sign in to comment.