Commit bfe4672b authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

pipelines results

parent d5b15f3d
Pipeline #14810 failed with stage
in 54 seconds
......@@ -462,6 +462,19 @@ class Project(Links, NamedModel, TimeStampedModel):
link = repo.first().url + '/pipeline_schedules'
return mark_safe(f'<a href="{link}">{self.cron()}</a>')
def pipeline_results(self):
""" Show state and link to latest master & devel gitlab pipelines """
repo = self.main_gitlab_repo()
ret = []
for branch in ['master', 'main', 'devel']:
build = repo.cibuild_set.filter(branch__name__endswith=branch).first()
if build is not None:
link = repo.url + f'/-/pipelines/{build.build_id}'
sym = '✓' if build.passed else '✘'
ret.append(f'<a href="{link}">{branch}: {sym}</a>')
return mark_safe('<br>'.join(ret))
class Repo(TimeStampedModel):
name = models.CharField(max_length=200)
......
......@@ -23,6 +23,7 @@ class NamespaceTable(StrippedTable):
class ProjectTable(StrippedTable):
pipeline_results = tables.Column(accessor='pipeline_results', orderable=False)
commits_since = tables.Column(accessor='commits_since', orderable=False)
repos = tables.Column(accessor='repos', orderable=False)
issues = tables.Column(accessor='open_issues', orderable=False)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment