Skip to content

Commit 5f2eb94

Browse files
committed
Display pipeline description in UI
Signed-off-by: Keshav Priyadarshi <[email protected]>
1 parent 9d8d22e commit 5f2eb94

File tree

9 files changed

+40
-13
lines changed

9 files changed

+40
-13
lines changed

vulnerabilities/api_v2.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,9 @@ class Meta:
686686
"url",
687687
"pipeline_id",
688688
"is_active",
689+
"live_logging",
689690
"run_interval",
691+
"execution_timeout",
690692
"created_date",
691693
"schedule_work_id",
692694
"next_run_date",
@@ -705,17 +707,33 @@ def get_latest_run(self, schedule):
705707
class PipelineScheduleCreateSerializer(serializers.ModelSerializer):
706708
class Meta:
707709
model = PipelineSchedule
708-
fields = ["pipeline_id", "is_active", "run_interval"]
710+
fields = [
711+
"pipeline_id",
712+
"is_active",
713+
"run_interval",
714+
"live_logging",
715+
"execution_timeout",
716+
]
709717
extra_kwargs = {
710718
field: {"initial": PipelineSchedule._meta.get_field(field).get_default()}
711-
for field in ["is_active", "run_interval"]
719+
for field in [
720+
"is_active",
721+
"run_interval",
722+
"live_logging",
723+
"execution_timeout",
724+
]
712725
}
713726

714727

715728
class PipelineScheduleUpdateSerializer(serializers.ModelSerializer):
716729
class Meta:
717730
model = PipelineSchedule
718-
fields = ["is_active", "run_interval"]
731+
fields = [
732+
"is_active",
733+
"run_interval",
734+
"live_logging",
735+
"execution_timeout",
736+
]
719737

720738

721739
class PipelineScheduleV2ViewSet(CreateListRetrieveUpdateViewSet):

vulnerabilities/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,8 +2124,8 @@ class PipelineSchedule(models.Model):
21242124
db_index=True,
21252125
default=True,
21262126
help_text=(
2127-
"When set to True (Yes), this Pipeline is active. "
2128-
"When set to False (No), this Pipeline is inactive and not run."
2127+
"When set to True, this Pipeline is active. "
2128+
"When set to False, this Pipeline is inactive and not run."
21292129
),
21302130
)
21312131

vulnerabilities/pipelines/compute_package_risk.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717

1818

1919
class ComputePackageRiskPipeline(VulnerableCodePipeline):
20-
"""
21-
Compute risk score for packages.
20+
"""Compute risk score for packages."""
2221

23-
See https://github.com/aboutcode-org/vulnerablecode/issues/1543
24-
"""
22+
# See https://github.com/aboutcode-org/vulnerablecode/issues/1543
2523

2624
pipeline_id = "compute_package_risk"
2725
license_expression = None

vulnerabilities/pipelines/enhance_with_exploitdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
class ExploitDBImproverPipeline(VulnerableCodePipeline):
2828
"""
29-
ExploitDB Improver Pipeline: Fetch ExploitDB data, iterate over it to find the vulnerability with
29+
Fetch ExploitDB data, iterate over it to find the vulnerability with
3030
the specified alias, and create or update the ref and ref-type accordingly.
3131
"""
3232

vulnerabilities/pipelines/enhance_with_kev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class VulnerabilityKevPipeline(VulnerableCodePipeline):
2222
"""
23-
Known Exploited Vulnerabilities Pipeline: Retrieve KEV data, iterate through it to identify vulnerabilities
23+
Retrieve KEV data, iterate through it to identify vulnerabilities
2424
by their associated aliases, and create or update the corresponding Exploit instances.
2525
"""
2626

vulnerabilities/pipelines/enhance_with_metasploit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class MetasploitImproverPipeline(VulnerableCodePipeline):
2424
"""
25-
Metasploit Exploits Pipeline: Retrieve Metasploit data, iterate through it to identify vulnerabilities
25+
Retrieve Metasploit data, iterate through it to identify vulnerabilities
2626
by their associated aliases, and create or update the corresponding Exploit instances.
2727
"""
2828

vulnerabilities/templates/pipeline_run_list.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@
3838
<h1>{{ pipeline_name }} Runs</h1>
3939
<hr />
4040
</div>
41+
42+
{% if pipeline_description %}
43+
<div class="notification is-info is-light">
44+
<p class="is-size-5 has-text-grey-dark has-text-centered">
45+
{{ pipeline_description }}
46+
</p>
47+
</div>
48+
{% endif %}
49+
4150
<div class="box">
4251
<table class="table is-striped is-hoverable is-fullwidth">
4352
<thead>

vulnerabilities/tests/test_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,8 @@ def test_pipelineschedule_status(self):
689689
self.assertEqual(self.schedule1.status, "running")
690690

691691
def test_pipelineschedule_latest_run_date(self):
692-
self.assertEqual(self.schedule1.latest_run_date, self.run2.created_date)
692+
self.run2.set_run_started()
693+
self.assertEqual(self.schedule1.latest_run_date, self.run2.run_start_date)
693694

694695
def test_pipelineschedule_all_runs(self):
695696
self.assertEqual(self.schedule1.all_runs.count(), 2)

vulnerabilities/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ def get_context_data(self, **kwargs):
389389
pipeline_id=self.kwargs["pipeline_id"],
390390
)
391391
context["pipeline_name"] = pipeline.pipeline_class.__name__
392+
context["pipeline_description"] = pipeline.description
392393
return context
393394

394395

0 commit comments

Comments
 (0)