#1453 frontend: update the build state descriptions
Merged 3 years ago by praiskup. Opened 3 years ago by praiskup.
Unknown source update-build-states  into  master

@@ -194,12 +194,12 @@

          "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.",

      }

  

@@ -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 %}

  <h1> Task queue </h1>

  <ul class="nav nav-tabs">

-   <li class="{% block importing_selected %}{% endblock %}">

-       <a href="{{ url_for('status_ns.importing') }}">

-           Importing

-           <span class="badge">{{ queue_sizes['importing'] }}</span>

-       </a>

-   </li>

-   <li class="{% block pending_selected %}{% endblock %}">

-       <a href="{{ url_for('status_ns.pending') }}">

-           Pending

-           <span class="badge">{{ queue_sizes['pending'] }}</span>

-       </a>

-   </li>

-   <li class="{% block starting_selected %}{% endblock %}">

-       <a href="{{ url_for('status_ns.starting') }}">

-           Starting

-           <span class="badge">{{ queue_sizes['starting'] }}</span>

-       </a>

-   </li>

-    <li class="{% block running_selected %}{% endblock %}">

-       <a href="{{ url_for('status_ns.running') }}">

-           Running

-           <span class="badge">{{ queue_sizes['running'] }}</span>

+   {% for state in ["importing", "pending", "starting", "running"] %}

+   <li {% if state_of_tasks == state %}class="active"{% endif %}>

+       <a href="{{ url_for('status_ns.' + state ) }}">

+           {{ state|capitalize }}

+           <span class="badge">{{ queue_sizes[state] }}</span>

        </a>

    </li>

+   {% endfor %}

+ 

    <li class="{% block stats_selected %}{% endblock %}">

        <a href="{{ url_for('status_ns.stats') }}">Statistics</a>

    </li>

  </ul>

- {% block status_body %}{% endblock %}

+ 

+ {% block status_body %}

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

+ <h2>

+     {% 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.

+ </h2>

+ <p>{{ build_state_text(state_of_tasks) }} - {{ state_of_tasks|build_state_description }}</p>

+ {{ status_info(type=state_of_tasks, tasks=tasks) }}

+ {{ initialize_datatables(order="desc") }}

+ {% endblock %}

  {% endblock %}

@@ -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 %}

- <li class="active">

-   Importing

- </li>

- {%endblock%}

- {% block status_body %}

- <h2>{%if number == 0:%}

-         No tasks

-     {%elif number == 1:%}

-         {{number}} task

-     {%else%}

-         {{number}} tasks

-     {%endif%}

-     are being imported

-     (+ {{ bg_tasks_cnt }} others with lower priority)

- </h2>

- 

- {{ status_info(type="importing", tasks=tasks) }}

- 

- {{ initialize_datatables(order="desc") }}

- {% endblock %} 

\ No newline at end of file

@@ -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 %}

- <li class="active">

-   Pending

- </li>

- {%endblock%}

- {% block status_body %}

- <h2>{%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)

- </h2>

- 

- {{ status_info(type="pending", tasks=tasks) }}

- 

- {{ initialize_datatables(order="desc") }}

- {% endblock %}

@@ -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 %}

- <li class="active">

-   Running

- </li>

- {%endblock%}

- {% block status_body %}

- <h2>{%if number == 0:%}

-         No tasks

-     {%elif number == 1:%}

-         {{number}} task

-     {%else%}

-         {{number}} tasks

-     {%endif%}

-     are running

- </h2>

- 

- {{ status_info(type="running", tasks=tasks) }}

- 

- {{ initialize_datatables(order="desc") }}

- {% endblock %}

@@ -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 %}

- <li class="active">

-   Starting

- </li>

- {%endblock%}

- {% block status_body %}

- <h2>{%if number == 0:%}

-         No tasks

-     {%elif number == 1:%}

-         {{number}} task

-     {%else%}

-         {{number}} tasks

-     {%endif%}

-     are are starting to be built

- </h2>

- 

- {{ status_info(type="starting", tasks=tasks) }}

- 

- {{ initialize_datatables(order="desc") }}

- {% endblock %}

@@ -40,8 +40,9 @@

  

  

  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/")

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".

One additional commit is coming.

rebased onto a0a9158

3 years ago

2 new commits added

  • frontend: de-duplicate build status templates
  • frontend: update the build state descriptions
3 years ago

Pull-Request has been merged by praiskup

3 years ago