This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git
The following commit(s) were added to refs/heads/main by this push:
new 3a4f667 Warn the user if there are check tasks ongoing
3a4f667 is described below
commit 3a4f667660f5b724c0306678ca252dca33326e77
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Apr 15 16:41:14 2025 +0100
Warn the user if there are check tasks ongoing
---
atr/routes/draft.py | 6 ++++++
atr/templates/draft-evaluate.html | 7 +++++++
2 files changed, 13 insertions(+)
diff --git a/atr/routes/draft.py b/atr/routes/draft.py
index 0ee0447..97471b5 100644
--- a/atr/routes/draft.py
+++ b/atr/routes/draft.py
@@ -401,6 +401,11 @@ async def evaluate(session: routes.CommitterSession,
project_name: str, version_
revision_name_from_link, revision_editor, revision_time = await
revision.latest_info(project_name, version_name)
+ # Get the number of ongoing tasks for the current revision
+ ongoing_tasks_count = 0
+ if revision_name_from_link:
+ ongoing_tasks_count = await db.tasks_ongoing(project_name,
version_name, revision_name_from_link)
+
delete_file_form = await DeleteFileForm.create_form()
return await quart.render_template(
"draft-evaluate.html",
@@ -425,6 +430,7 @@ async def evaluate(session: routes.CommitterSession,
project_name: str, version_
revision_editor=revision_editor,
revision_time=revision_time,
revision_name_from_link=revision_name_from_link,
+ ongoing_tasks_count=ongoing_tasks_count,
)
diff --git a/atr/templates/draft-evaluate.html
b/atr/templates/draft-evaluate.html
index 5ce3021..41e1296 100644
--- a/atr/templates/draft-evaluate.html
+++ b/atr/templates/draft-evaluate.html
@@ -61,6 +61,13 @@
</div>
</div>
+ {% if ongoing_tasks_count > 0 %}
+ <div class="alert alert-warning" role="alert">
+ <i class="fa-solid fa-triangle-exclamation"></i>
+ There {{ 'is' if ongoing_tasks_count == 1 else 'are' }} currently
<strong>{{ ongoing_tasks_count }}</strong> background verification {{ 'task' if
ongoing_tasks_count == 1 else 'tasks' }} running for this revision. Results
shown below may be incomplete or outdated until the tasks finish. Refresh the
page to see updates.
+ </div>
+ {% endif %}
+
<div class="card mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<h5 class="mb-0">Files</h5>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]