You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "PApostol (via GitHub)" <gi...@apache.org> on 2023/05/18 16:19:54 UTC

[GitHub] [airflow] PApostol commented on a diff in pull request #30429: Add running and failed status tab for DAGs on the UI

PApostol commented on code in PR #30429:
URL: https://github.com/apache/airflow/pull/30429#discussion_r1198022876


##########
airflow/www/templates/airflow/dags.html:
##########
@@ -132,22 +132,38 @@ <h2>{{ page_title }}</h2>
   <div id="main_content">
     <div class="row dags-table-header">
       <div class="col-sm-4 col-md-4 no-x-padding">
-        <div class="form-group btn-group">
-          <a
-            href="{{ url_for('Airflow.index', status='all', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}"
-            class="btn {{ 'btn-primary' if status_filter == 'all' else 'btn-default' }}"
-            title="Show active and paused DAGs">All <span class="badge">{{ "{:,}".format(status_count_all) }}</span></a>
-          <a
-            href="{{ url_for('Airflow.index', status='active', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}"
-            class="btn {{ 'btn-primary' if status_filter == 'active' else 'btn-default' }}"
-            title="Show only active DAGs">Active <span class="badge">{{ "{:,}".format(status_count_active) }}</span></a>
-          <a
-            href="{{ url_for('Airflow.index', status='paused', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}"
-            class="btn {{ 'btn-primary' if status_filter == 'paused' else 'btn-default' }}"
-            title="Show only paused DAGs">Paused <span class="badge">{{ "{:,}".format(status_count_paused) }}</span></a>
+        <div class="row">
+          <div class="col-sm-6 col-md-6">
+            <div class="form-group btn-group">
+              <a
+                href="{{ url_for('Airflow.index', status='all', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}"
+                class="btn {{ 'btn-primary' if status_filter == 'all' else 'btn-default' }}"
+                title="Show active and paused DAGs">All <span class="badge">{{ "{:,}".format(status_count_all) }}</span></a>
+              <a
+                href="{{ url_for('Airflow.index', status='active', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}"
+                class="btn {{ 'btn-primary' if status_filter == 'active' else 'btn-default' }}"
+                title="Show only active DAGs">Active <span class="badge">{{ "{:,}".format(status_count_active) }}</span></a>
+              <a
+                href="{{ url_for('Airflow.index', status='paused', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}"
+                class="btn {{ 'btn-primary' if status_filter == 'paused' else 'btn-default' }}"
+                title="Show only paused DAGs">Paused <span class="badge">{{ "{:,}".format(status_count_paused) }}</span></a>
+            </div>
+          </div>
+          <div class="col-sm-3 col-md-3 text-center">
+            <div class="form-group btn-group">
+              <a
+                href="{{ url_for('Airflow.index', status='running', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}"
+                class="btn {{ 'btn-primary' if status_filter == 'running' else 'btn-default' }}"
+                title="Show currently running DAG runs">Running <span class="badge">{{ "{:,}".format(status_count_running) }}</span></a>
+              <a
+                href="{{ url_for('Airflow.index', status='failed', search=request.args.get('search', None), tags=request.args.getlist('tags', None)) }}"
+                class="btn {{ 'btn-primary' if status_filter == 'failed' else 'btn-default' }}"
+                title="Show DAGs with failed latest DAG run">Failed <span class="badge">{{ "{:,}".format(status_count_failed) }}</span></a>

Review Comment:
   The join `subq_join` added in `views.py` actually ensures that only DAGs whose latest run is `FAILED` will appear in the Failed tab. This is so DAGs won't be stuck in the Failed tab if they have an old failed run. Instead, users would be shown only the DAGs that are currently failing and require action/mitigation. If a failed DAG is re-run and succeeds, it doesn't show in the Failed tab anymore. I feel if we show DAGs with any failed past runs, then there is not much useful information for users.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org