From a0a9158bed0575f28274000f3b59d25b56fc5530 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Aug 04 2020 08:02:26 +0000 Subject: [PATCH 1/2] frontend: update the build state descriptions Some are just revamped, and some are updated to the recent state of things; we now (again, after some period of time) start backend workers before we have a corresponding builder machine in hand. So the builds can (again) spend some time in "starting" state, waiting for VMs. And it is a bit more correct to differentiate "(Backend) Workers" and "Builders". --- diff --git a/frontend/coprs_frontend/coprs/filters.py b/frontend/coprs_frontend/coprs/filters.py index 770fd44..800b599 100644 --- a/frontend/coprs_frontend/coprs/filters.py +++ b/frontend/coprs_frontend/coprs/filters.py @@ -194,12 +194,12 @@ def build_state_decoration(state): "succeeded": "Successfully built.", "canceled": "The build has been cancelled manually.", "running": "Build in progress.", - "pending": "Your build is waiting for a builder.", + "pending": "Build is waiting in queue for a backend worker.", "skipped": "This package has already been built previously.", - "starting": "Trying to acquire and configure builder for task.", - "importing": "Package content is being imported into DistGit.", + "starting": "Backend worker is trying to acquire a builder machine.", + "importing": "Package sources are being imported into Copr DistGit.", "waiting": "Task is waiting for something else to finish.", - "imported": "Package was successfully imported into DistGit.", + "imported": "Package was successfully imported into Copr DistGit.", "forked": "Build has been forked from another build.", } From d96c804bedf0130bc521b4e4157b932cdf8cfc1f Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Aug 04 2020 09:06:20 +0000 Subject: [PATCH 2/2] frontend: de-duplicate build status templates And also describe what the particular state means on the status page. --- diff --git a/frontend/coprs_frontend/coprs/templates/status.html b/frontend/coprs_frontend/coprs/templates/status.html index 8e8a78c..8c59ada 100644 --- a/frontend/coprs_frontend/coprs/templates/status.html +++ b/frontend/coprs_frontend/coprs/templates/status.html @@ -1,4 +1,7 @@ {% extends "layout.html" %} + +{% from "_helpers.html" import status_info, initialize_datatables, build_state_text %} + {% block title %} Task queue - Copr {% endblock %} {% block header %} Task queue - Copr {% endblock %} {%block main_menu_status %}active{% endblock %} @@ -16,33 +19,34 @@ {% block body %}

Task queue

-{% block status_body %}{% endblock %} + +{% block status_body %} +{% set bg = "" if not bg_tasks_cnt else "(+ {} others with lower priority)".format(bg_tasks_cnt) %} +

+ {% if number == 0 %} + No tasks {{ bg }} are + {% elif number == 1 %} + {{ number }} task {{ bg }} is + {% else %} + {{ number }} tasks {{ bg}} are + {% endif %} + in the {{ state_of_tasks }} state. +

+

{{ build_state_text(state_of_tasks) }} - {{ state_of_tasks|build_state_description }}

+{{ status_info(type=state_of_tasks, tasks=tasks) }} +{{ initialize_datatables(order="desc") }} +{% endblock %} {% endblock %} diff --git a/frontend/coprs_frontend/coprs/templates/status/importing.html b/frontend/coprs_frontend/coprs/templates/status/importing.html deleted file mode 100644 index 1238f18..0000000 --- a/frontend/coprs_frontend/coprs/templates/status/importing.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "status.html" %} -{% from "_helpers.html" import build_href, copr_name, copr_details_href, initialize_datatables, status_info %} -{% block importing_selected %}active{% endblock %} -{%block status_breadcrumb %} -
  • - Importing -
  • -{%endblock%} -{% block status_body %} -

    {%if number == 0:%} - No tasks - {%elif number == 1:%} - {{number}} task - {%else%} - {{number}} tasks - {%endif%} - are being imported - (+ {{ bg_tasks_cnt }} others with lower priority) -

    - -{{ status_info(type="importing", tasks=tasks) }} - -{{ initialize_datatables(order="desc") }} -{% endblock %} \ No newline at end of file diff --git a/frontend/coprs_frontend/coprs/templates/status/pending.html b/frontend/coprs_frontend/coprs/templates/status/pending.html deleted file mode 100644 index 10407db..0000000 --- a/frontend/coprs_frontend/coprs/templates/status/pending.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "status.html" %} -{% from "_helpers.html" import build_href, copr_name, copr_details_href, initialize_datatables, status_info %} -{% block pending_selected %}active{% endblock %} -{%block status_breadcrumb %} -
  • - Pending -
  • -{%endblock%} -{% block status_body %} -

    {%if number == 0:%} - No tasks - {%elif number == 1:%} - {{number}} task - {%else%} - {{number}} tasks - {%endif%} - are waiting to be built - (+{{ bg_tasks_cnt }} others with lower priority) -

    - -{{ status_info(type="pending", tasks=tasks) }} - -{{ initialize_datatables(order="desc") }} -{% endblock %} diff --git a/frontend/coprs_frontend/coprs/templates/status/running.html b/frontend/coprs_frontend/coprs/templates/status/running.html deleted file mode 100644 index fe2c45f..0000000 --- a/frontend/coprs_frontend/coprs/templates/status/running.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends "status.html" %} -{% from "_helpers.html" import build_href, copr_name, copr_details_href, initialize_datatables, status_info %} -{% block running_selected %}active{% endblock %} -{%block status_breadcrumb %} -
  • - Running -
  • -{%endblock%} -{% block status_body %} -

    {%if number == 0:%} - No tasks - {%elif number == 1:%} - {{number}} task - {%else%} - {{number}} tasks - {%endif%} - are running -

    - -{{ status_info(type="running", tasks=tasks) }} - -{{ initialize_datatables(order="desc") }} -{% endblock %} diff --git a/frontend/coprs_frontend/coprs/templates/status/starting.html b/frontend/coprs_frontend/coprs/templates/status/starting.html deleted file mode 100644 index 7a5bdbb..0000000 --- a/frontend/coprs_frontend/coprs/templates/status/starting.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends "status.html" %} -{% from "_helpers.html" import build_href, copr_name, copr_details_href, initialize_datatables, status_info %} -{% block starting_selected %}active{% endblock %} -{%block status_breadcrumb %} -
  • - Starting -
  • -{%endblock%} -{% block status_body %} -

    {%if number == 0:%} - No tasks - {%elif number == 1:%} - {{number}} task - {%else%} - {{number}} tasks - {%endif%} - are are starting to be built -

    - -{{ status_info(type="starting", tasks=tasks) }} - -{{ initialize_datatables(order="desc") }} -{% endblock %} diff --git a/frontend/coprs_frontend/coprs/views/status_ns/status_general.py b/frontend/coprs_frontend/coprs/views/status_ns/status_general.py index f4a9d0f..7216989 100644 --- a/frontend/coprs_frontend/coprs/views/status_ns/status_general.py +++ b/frontend/coprs_frontend/coprs/views/status_ns/status_general.py @@ -40,8 +40,9 @@ def starting(): def render_status(build_status, tasks, bg_tasks_cnt=None): - return flask.render_template("status/{}.html".format(build_status), number=len(tasks), - tasks=tasks, bg_tasks_cnt=bg_tasks_cnt) + return flask.render_template("status.html", number=len(tasks), + tasks=tasks, bg_tasks_cnt=bg_tasks_cnt, + state_of_tasks=build_status) @status_ns.route("/stats/")