Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
dbnomics
dbnomics-dashboard
Commits
001e8825
Commit
001e8825
authored
Jul 20, 2020
by
Christophe Benz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lint schedules
parent
a6e3b1b9
Pipeline
#165860
passed with stage
in 4 minutes and 8 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
5 deletions
+26
-5
generate-dashboard.py
generate-dashboard.py
+18
-1
templates/dashboard.html
templates/dashboard.html
+3
-3
templates/macros.html
templates/macros.html
+5
-1
No files found.
generate-dashboard.py
View file @
001e8825
...
...
@@ -379,6 +379,20 @@ def json_data_url(base_url: str, provider_slug: str):
class
DashboardGenerator
:
args
:
argparse
.
Namespace
def
check_schedule
(
self
,
schedule
:
ProjectPipelineSchedule
,
provider_slug
:
str
):
problems
=
[]
maintainer
=
self
.
fetcher_metadata_by_slug
.
get
(
provider_slug
,
{}).
get
(
"maintainer"
)
owner
=
schedule
.
owner
[
"username"
]
if
maintainer
is
not
None
and
owner
!=
maintainer
:
problems
.
append
(
f
"Schedule owner
{
owner
!
r
}
is different from fetcher maintainer
{
maintainer
!
r
}
"
)
return
problems
def
fetch
(
self
):
args
=
self
.
args
...
...
@@ -492,7 +506,10 @@ class DashboardGenerator:
logger
.
info
(
"Fetch GitLab CI pipeline schedules of all fetchers..."
)
return
{
provider_slug
:
project
.
pipelineschedules
.
list
()
provider_slug
:
[
(
schedule
,
self
.
check_schedule
(
schedule
,
provider_slug
))
for
schedule
in
project
.
pipelineschedules
.
list
()
]
for
provider_slug
,
project
in
self
.
project_by_slug
.
items
()
}
...
...
templates/dashboard.html
View file @
001e8825
...
...
@@ -82,9 +82,9 @@
</a>
</th>
<td>
{% for schedule in fetcher.schedules %}
<a
href=
"{{ schedule_url(args.gitlab_base_url, fetcher.project, schedule) }}"
data-toggle=
"tooltip"
data-html=
"true"
data-placement=
"auto"
title=
"{{ schedule_tooltip(schedule) }}"
>
<i
class=
"fas {{ 'fa-
check text-success
' if schedule.active else 'fa-
times
text-
warning
' }}"
></i>
{% for schedule
, problems
in fetcher.schedules %}
<a
href=
"{{ schedule_url(args.gitlab_base_url, fetcher.project, schedule) }}"
data-toggle=
"tooltip"
data-html=
"true"
data-placement=
"auto"
title=
"{{ schedule_tooltip(schedule
, problems
) }}"
>
<i
class=
"fas {{ 'fa-
exclamation text-danger' if problems is not none else 'fa-times text-warning
' if
not
schedule.active else 'fa-
check
text-
success
' }}"
></i>
</a>
{% else %}
<a
href=
"{{ schedule_url(args.gitlab_base_url, fetcher.project) }}"
data-toggle=
"tooltip"
data-placement=
"auto"
title=
"No schedule defined"
>
...
...
templates/macros.html
View file @
001e8825
...
...
@@ -5,7 +5,11 @@
</local-time>
{% endmacro %}
{% macro schedule_tooltip(schedule) %}
{% macro schedule_tooltip(schedule, problems) %}
{% if problems is not none %}
problems: {{ ", ".join(problems) }}
<br>
{% endif %}
status: {{ "active" if schedule.active else "inactive" }}
<br>
{% if schedule.active %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment