# WARNING : 8
# MAJOR INFO : 5
# MINOR INFO : 4
-# DEBUG : 0
+# DEBUG : 1
# The view returns the following fields
# type (of the event)
# build
# by_build
# build_comment
+# job
# user
# by_user
# repository
builds.id AS build,
NULL::integer AS by_build,
NULL::integer AS build_comment,
+ NULL::integer AS job,
NULL::integer AS user,
builds.owner_id AS by_user,
NULL::integer AS repository
builds.id AS build,
NULL AS by_build,
NULL AS build_comment,
+ NULL AS job,
NULL AS user,
NULL AS by_user,
NULL AS repository
builds.id AS build,
NULL AS by_build,
NULL AS build_comment,
+ NULL AS job,
NULL AS user,
builds.deleted_by AS by_user,
NULL AS repository
builds.id AS build,
builds.deprecating_build_id AS by_build,
NULL AS build_comment,
+ NULL AS job,
NULL AS user,
builds.deprecated_by AS by_user,
NULL AS repository
build_comments.build_id AS build,
NULL AS by_build,
build_comments.id AS build_comment,
+ NULL AS job,
NULL AS user,
build_comments.user_id AS by_user,
NULL AS repository
build_watchers.build_id AS build,
NULL AS by_build,
NULL AS build_comment,
+ NULL AS job,
build_watchers.user_id AS user,
NULL AS by_user,
NULL AS repository
build_watchers.build_id AS build,
NULL AS by_build,
NULL AS build_comment,
+ NULL AS job,
build_watchers.user_id AS user,
NULL AS by_user,
NULL AS repository
repository_builds.build_id AS build,
NULL AS by_build,
NULL AS build_comment,
+ NULL AS job,
NULL AS user,
repository_builds.added_by AS by_user,
repository_builds.repo_id AS repository
repository_builds.build_id AS build,
NULL AS by_build,
NULL AS build_comment,
+ NULL AS job,
NULL AS user,
repository_builds.removed_by AS by_user,
repository_builds.repo_id AS repository
repository_builds
WHERE
removed_at IS NOT NULL
+
+ UNION ALL
+
+ -- Jobs Creations
+ SELECT
+ 'job-created' AS type,
+ jobs.created_at AS t,
+ 3 AS priority,
+ jobs.build_id AS build,
+ NULL AS by_build,
+ NULL AS build_comment,
+ jobs.id AS job,
+ NULL AS user,
+ NULL AS by_user,
+ NULL AS repository
+ FROM
+ jobs
+ WHERE
+ jobs.deleted_at IS NULL
+
+ UNION ALL
+
+ -- Failed Jobs
+ SELECT
+ 'job-failed' AS type,
+ jobs.finished_at AS t,
+ 5 AS priority,
+ jobs.build_id AS build,
+ NULL AS by_build,
+ NULL AS build_comment,
+ jobs.id AS job,
+ NULL AS user,
+ NULL AS by_user,
+ NULL AS repository
+ FROM
+ jobs
+ WHERE
+ jobs.deleted_at IS NULL
+ AND
+ jobs.finished_at IS NOT NULL
+ AND
+ jobs.aborted IS FALSE
+ AND
+ jobs.failed IS TRUE
+
+ UNION ALL
+
+ -- Finished Jobs
+ SELECT
+ 'job-finished' AS type,
+ jobs.finished_at AS t,
+ 4 AS priority,
+ jobs.build_id AS build,
+ NULL AS by_build,
+ NULL AS build_comment,
+ jobs.id AS job,
+ NULL AS user,
+ NULL AS by_user,
+ NULL AS repository
+ FROM
+ jobs
+ WHERE
+ jobs.deleted_at IS NULL
+ AND
+ jobs.finished_at IS NOT NULL
+ AND
+ jobs.aborted IS FALSE
+ AND
+ jobs.failed IS FALSE
+
+ UNION ALL
+
+ -- Aborted Jobs
+ SELECT
+ 'job-aborted' AS type,
+ jobs.finished_at AS t,
+ 4 AS priority,
+ jobs.build_id AS build,
+ NULL AS by_build,
+ NULL AS build_comment,
+ jobs.id AS job,
+ NULL AS user,
+ jobs.aborted_by AS by_user,
+ NULL AS repository
+ FROM
+ jobs
+ WHERE
+ jobs.deleted_at IS NULL
+ AND
+ jobs.aborted IS TRUE
+
+ UNION ALL
+
+ -- Dispatched Jobs
+ SELECT
+ 'job-dispatched' AS type,
+ jobs.started_at AS t,
+ 1 AS priority,
+ jobs.build_id AS build,
+ NULL AS by_build,
+ NULL AS build_comment,
+ jobs.id AS job,
+ NULL AS user,
+ NULL AS by_user,
+ NULL AS repository
+ FROM
+ jobs
+ WHERE
+ jobs.deleted_at IS NULL
+ AND
+ jobs.started_at IS NOT NULL
)
"""
# Build Comments
"build_comment" : self.backend.builds.comments.get_by_id,
+ # Jobs
+ "job" : self.backend.jobs.get_by_id,
+
# Repositories
"repository" : self.backend.repos.get_by_id,
<div class="media">
{% block thumbnail %}
<div class="media-left">
- {% if event.type == "build-failed" %}
+ {% if event.type in ("build-failed", "job-failed") %}
<span class="icon is-large has-text-danger">
<i class="fa-solid fa-3x fa-square-xmark"></i>
</span>
- {% elif event.type == "build-finished" %}
+ {% elif event.type in ("build-finished", "job-finished") %}
<span class="icon is-large has-text-success">
<i class="fa-solid fa-3x fa-square-check"></i>
</span>
{{ _("%s started watching this build") % event.user }}
{% elif event.type == "build-watcher-removed" %}
{{ _("%s stopped watching this build") % event.user }}
+ {% elif event.type == "job-created" %}
+ {{ _("Job Created") }}
+ {% elif event.type == "job-failed" %}
+ {{ _("Job Failed") }}
+ {% elif event.type == "job-finished" %}
+ {{ _("Job Finished") }}
+ {% elif event.type == "job-aborted" %}
+ {{ _("Job Aborted") }}
+ {% elif event.type == "job-dispatched" %}
+ {{ _("Job Dispatched") }}
{% elif event.type == "repository-build-added" %}
{{ _("Build has been added to repository %s") % event.repository }}
{% elif event.type == "repository-build-removed" %}
<nav class="level">
<div class="level-left is-small">
{# Build #}
- {% if show_build and event.build %}
+ {% if show_build and event.build and not event.job %}
<a class="level-item" href="/builds/{{ event.build.uuid }}">
{{ event.build }}
</a>
</a>
{% end %}
+ {# Job #}
+ {% if event.job %}
+ <a class="level-item" href="/builds/{{ event.job.build.uuid }}#{{ event.job.arch }}">
+ {{ event.job }}
+ </a>
+ {% end %}
+
{# Repository #}
{% if event.repository %}
<a class="level-item" href="{{ event.repository.url }}">