#1452 frontend: add new tab showing starting builds
Merged 3 years ago by praiskup. Opened 3 years ago by dturecek.
copr/ dturecek/copr starting-builds-stats  into  master

@@ -255,11 +255,13 @@ 

          importing = BuildsLogic.get_build_importing_queue(background=False).count()

          pending = BuildsLogic.get_pending_build_tasks(background=False).count()

          running = BuildsLogic.get_build_tasks(StatusEnum("running")).count()

+         starting = BuildsLogic.get_build_tasks(StatusEnum("starting")).count()

  

          return dict(

              importing=importing,

              pending=pending,

              running=running,

+             starting=starting,

          )

  

      @classmethod

@@ -321,6 +321,10 @@ 

          <span class="badge">{{ tasks_info.pending }}</span>

          Pending

        </a>

+       <a href="{{url_for('status_ns.starting')}}" class="list-group-item">

+         <span class="badge">{{ tasks_info.starting }}</span>

+         Starting

+       </a>

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

          <span class="badge">{{ tasks_info.running }}</span>

          Running
@@ -669,6 +673,8 @@ 

                Waiting

              {% elif type == 'pending' %}

                Pending

+             {% elif type == 'starting' %}

+               Starting

              {% else %}

                Running

              {% endif %}

@@ -28,7 +28,13 @@ 

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

        </a>

    </li>

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

+   <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>

@@ -0,0 +1,23 @@ 

+ {% 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:%}

The colon is weird here ...

+         No tasks

+     {%elif number == 1:%}

+         {{number}} task

+     {%else%}

+         {{number}} tasks

+     {%endif%}

+     are are starting to be built

I'd say {{ number or "No" }} task {{ "worker is" if number == 1 else "workers are" }} trying to acquire a builder machine.

See also #1453.

+ </h2>

+ 

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

+ 

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

+ {% endblock %}

@@ -33,6 +33,12 @@ 

      return render_status("importing", tasks=tasks, bg_tasks_cnt=bg_tasks_cnt)

  

  

+ @status_ns.route("/starting/")

+ def starting():

+     tasks = builds_logic.BuildsLogic.get_build_tasks(StatusEnum("starting")).all()

+     return render_status("starting", tasks=tasks)

+ 

+ 

  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)

Metadata Update from @dturecek:
- Pull-request tagged with: wip

3 years ago

rebased onto 3b62a6246051b66e42aec4c47f5d74ee48ced548

3 years ago

Metadata Update from @dturecek:
- Pull-request untagged with: wip

3 years ago

rebased onto 51988d61e16ebed1457fe7ec95278f765a0e50b4

3 years ago

I'd say {{ number or "No" }} task {{ "worker is" if number == 1 else "workers are" }} trying to acquire a builder machine.

Otherwise looks fine, thank you

Ok, nevermind ... I see the nits are just a result of C&P (other files are C&P too). +1

rebased onto 4cc83c4

3 years ago

Pull-Request has been merged by praiskup

3 years ago