Skip to content

Commit b848747

Browse files
committed
Update package details template to show Ghost tag
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent d0465cc commit b848747

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

vulnerabilities/migrations/0061_package_is_ghost.py renamed to vulnerabilities/migrations/0062_package_is_ghost.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Generated by Django 4.1.13 on 2024-08-23 10:03
1+
# Generated by Django 4.1.13 on 2024-08-23 12:47
22

33
from django.db import migrations, models
44

55

66
class Migration(migrations.Migration):
77

88
dependencies = [
9-
("vulnerabilities", "0060_alter_kev_known_ransomware_campaign_use_and_more"),
9+
("vulnerabilities", "0061_alter_packagechangelog_software_version_and_more"),
1010
]
1111

1212
operations = [

vulnerabilities/pipelines/flag_ghost_packages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def detect_and_flag_ghost_packages(logger=None):
6767

6868
def flag_ghost_package(base_purl, packages, logger=None):
6969
"""
70-
Check if all the versions of the `purl` are available upstream.
71-
If they are not available, update the `is_ghost` to `True`.
70+
Check if `packages` are available upstream.
71+
If not, update `is_ghost` to `True`.
7272
"""
7373
if not base_purl.type in RANGE_CLASS_BY_SCHEMES:
7474
return 0

vulnerabilities/templates/package_details.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,21 @@
6262
{{ fixed_package_details.purl.to_string }}
6363
</td>
6464
</tr>
65+
{% if package.is_ghost %}
6566
<tr>
6667
<td class="two-col-left">
67-
<span
68-
class="has-tooltip-multiline has-tooltip-black has-tooltip-arrow has-tooltip-text-left"
69-
data-tooltip="The status of the package can be Malicious, Ghost, Yanked, Valid, or Unknown.">
70-
status
71-
</span>
68+
Tags
7269
</td>
7370
<td class="two-col-right">
74-
{{ package.get_status_display }}
71+
<span
72+
class="tag is-warning is-hoverablem has-tooltip-multiline has-tooltip-black"
73+
data-tooltip="This package does not exist in the upstream package manager or its repository."
74+
style="margin-right: 8px;">
75+
Ghost
76+
</span>
7577
</td>
7678
</tr>
79+
{% endif %}
7780
</tbody>
7881
</table>
7982
</div>

0 commit comments

Comments
 (0)