]> git.ipfire.org Git - pbs.git/commitdiff
jobs: List retried jobs in event queue and hide creation of regular jobs
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 30 Apr 2023 14:19:27 +0000 (14:19 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 30 Apr 2023 14:21:16 +0000 (14:21 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/events.py
src/templates/events/modules/system-message.html

index c9d544f1b819e461e268b5746c2680141846cbd1..d9149ac7b84c38454ebffabbc6775c3d0a761e65 100644 (file)
@@ -238,7 +238,7 @@ EVENTS_VIEW = """
                SELECT
                        'job-created' AS type,
                        jobs.created_at AS t,
-                       3 AS priority,
+                       1 AS priority,
                        jobs.build_id AS build,
                        NULL AS by_build,
                        NULL AS build_comment,
@@ -347,6 +347,28 @@ EVENTS_VIEW = """
                        jobs.deleted_at IS NULL
                AND
                        jobs.started_at IS NOT NULL
+
+               UNION ALL
+
+               -- Retried jobs
+               SELECT
+                       'job-retry' AS type,
+                       jobs.created_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 builder,
+                       NULL AS repository
+               FROM
+                       jobs
+               JOIN
+                       jobs superseeded_jobs ON superseeded_jobs.superseeded_by = jobs.id
+               WHERE
+                       jobs.deleted_at IS NULL
        )
 """
 
index ee4c01990a6906acc33037e7a9ad1070b00f8fd0..fcf2f2173b4c35b911385e3c68a39489bc9b4c84 100644 (file)
@@ -9,6 +9,10 @@
                                <p class="icon is-large has-text-info">
                                        <i class="fa-solid fa-2x fa-gear"></i>
                                </p>
+                       {% elif event.type == "job-retry" %}
+                               <p class="icon is-large has-text-info">
+                                       <i class="fa-solid fa-2x fa-arrow-rotate-left"></i>
+                               </p>
                        {% elif event.type == "build-finished" %}
                                <p class="icon is-large has-text-success">
                                        <i class="fa-solid fa-2x fa-check-double"></i>
@@ -58,6 +62,8 @@
                                        {{ _("Job Aborted") }}
                                {% elif event.type == "job-dispatched" %}
                                        {{ _("Job Dispatched") }}
+                               {% elif event.type == "job-retry" %}
+                                       {{ _("Job Restarted") }}
                                {% elif event.type == "repository-build-added" %}
                                        {{ _("Build has been added to repository %s") % event.repository }}
                                {% elif event.type == "repository-build-removed" %}