Skip to content

Commit aa53acf

Browse files
committed
ui: display pipeline run retention period and minimum runs retained on dashboard
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent a738647 commit aa53acf

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

‎vulnerabilities/templates/pipeline_run_list.html‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,22 @@ <h1>{{ pipeline_name }} Runs</h1>
4141
</div>
4242

4343
{% if pipeline_description %}
44-
<div class="notification is-info is-light">
45-
<p class="is-size-5 has-text-grey-dark has-text-centered">
46-
{{ pipeline_description }}
47-
</p>
48-
</div>
44+
<div class="notification is-info is-light">
45+
<div class="is-size-5 has-text-grey-dark">
46+
{{ pipeline_description|linebreaks }}
47+
</div>
48+
</div>
4949
{% endif %}
5050

5151
<div class="box">
52+
<div class="notification has-text-centered" style="background-color: #f8edb2;">
53+
<p class="is-size-6 has-text-grey-dark">
54+
<i class="fa fa-exclamation-triangle mr-1"></i>
55+
Pipeline runs older than {{ pipeline_run_retention_days }} days are automatically removed.
56+
At least the latest {{ minimum_pipeline_runs_retain }} pipeline runs are always retained.
57+
</p>
58+
</div>
59+
5260
<table class="table is-striped is-hoverable is-fullwidth">
5361
<thead>
5462
<tr>

‎vulnerabilities/views.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
from vulnerabilities.utils import safe_altcha_redirect
6767
from vulnerablecode import __version__ as VULNERABLECODE_VERSION
6868
from vulnerablecode.settings import VULNERABLECODE_ALTCHA_SESSION_TIMEOUT
69+
from vulnerablecode.settings import VULNERABLECODE_MINIMUM_PIPELINE_RUNS_TO_RETAIN
70+
from vulnerablecode.settings import VULNERABLECODE_PIPELINE_RUN_RETENTION_DAYS
6971
from vulnerablecode.settings import env
7072

7173
PAGE_SIZE = 10
@@ -1048,6 +1050,8 @@ def get_context_data(self, **kwargs):
10481050
)
10491051
context["pipeline_name"] = pipeline.pipeline_class.__name__
10501052
context["pipeline_description"] = pipeline.description
1053+
context["pipeline_run_retention_days"] = VULNERABLECODE_PIPELINE_RUN_RETENTION_DAYS
1054+
context["minimum_pipeline_runs_retain"] = VULNERABLECODE_MINIMUM_PIPELINE_RUNS_TO_RETAIN
10511055
return context
10521056

10531057

0 commit comments

Comments
 (0)