This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch sbp
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/sbp by this push:
new b0a18494 Allow consecutive fresh checks for debugging
b0a18494 is described below
commit b0a184949407b008842aa9d3f07aa548b27ba44b
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Mar 13 16:58:23 2026 +0000
Allow consecutive fresh checks for debugging
---
atr/form.py | 6 +++++-
atr/shared/web.py | 10 +++-------
atr/templates/check-selected.html | 18 +++---------------
3 files changed, 11 insertions(+), 23 deletions(-)
diff --git a/atr/form.py b/atr/form.py
index 8463512e..444d9888 100644
--- a/atr/form.py
+++ b/atr/form.py
@@ -264,6 +264,7 @@ def render( # noqa: C901
wider_widgets: bool = False,
skip: list[str] | None = None,
confirm: str | None = None,
+ submit_disabled: bool = False,
) -> htm.Element:
if action is None:
action = quart.request.path
@@ -307,7 +308,10 @@ def render( # noqa: C901
form_children: list[htm.Element | htm.VoidElement | markupsafe.Markup] =
hidden_fields + field_rows
- submit_button = htpy.button(type="submit", class_=f"btn
{submit_classes}")[submit_label]
+ submit_attrs: dict[str, Any] = {"type": "submit", "class_": f"btn
{submit_classes}"}
+ if submit_disabled:
+ submit_attrs["disabled"] = True
+ submit_button = htpy.button(**submit_attrs)[submit_label]
submit_div_contents: list[htm.Element | htm.VoidElement] = [submit_button]
if cancel_url:
cancel_link = htpy.a(href=cancel_url, class_="btn btn-link
text-secondary")["Cancel"]
diff --git a/atr/shared/web.py b/atr/shared/web.py
index 0ed866d8..93089cf3 100644
--- a/atr/shared/web.py
+++ b/atr/shared/web.py
@@ -148,18 +148,17 @@ async def check(
action=util.as_url(
post.draft.recheck, project_name=release.safe_project_name,
version_name=release.safe_version_name
),
- submit_label="Disable global cache",
+ submit_label="Recheck with fresh cache",
submit_classes="btn btn-primary",
- # confirm="Restart all checks without using cached results? This
creates a new revision.",
)
cache_reset_form = form.render(
model_cls=form.Empty,
action=util.as_url(
post.draft.cache_reset, project_name=release.safe_project_name,
version_name=release.safe_version_name
),
- submit_label="Enable global cache",
+ submit_label="Recheck with global cache",
submit_classes="btn btn-primary",
- # confirm="Restart all checks without using cached results? This
creates a new revision.",
+ submit_disabled=release.check_cache_key is None,
)
vote_task_warnings = _warnings_from_vote_result(vote_task)
@@ -172,8 +171,6 @@ async def check(
if revision_number is not None:
blocker_errors = await interaction.has_blocker_checks(release,
revision_number)
- is_local_caching = release.check_cache_key is not None
-
checks_summary_html = render_checks_summary(info,
release.safe_project_name, release.safe_version_name)
return await template.render(
@@ -205,7 +202,6 @@ async def check(
vote_task_warnings=vote_task_warnings,
recheck_form=recheck_form,
cache_reset_form=cache_reset_form,
- is_local_caching=is_local_caching,
csrf_input=str(form.csrf_input()),
resolve_form=resolve_form,
has_files=has_files,
diff --git a/atr/templates/check-selected.html
b/atr/templates/check-selected.html
index ddce95cc..ca615c63 100644
--- a/atr/templates/check-selected.html
+++ b/atr/templates/check-selected.html
@@ -230,21 +230,9 @@
{% if is_viewing_as_admin_fn(current_user.uid) %}
<h3 id="cache-control" class="mt-4">Check cache control</h3>
-
- {% if not is_local_caching %}
- <div class="mb-2">
- <p>Click the button below to opt this release out of the global
check cache</p>
- <p>This will create a new revision and restart all checks.</p>
- </div>
- <div class="mb-2">{{ recheck_form|safe }}</div>
- {% else %}
- <div class="mb-2">
- <p>This release is using a local check cache.</p>
- <p>Click the button below to reset back to using the default global
cache</p>
- <p>This will create a new revision and update check results from the
cache or new checks as appropriate</p>
- </div>
- <div class="mb-2">{{ cache_reset_form |safe }}</div>
- {% endif %}
+ <p>Each button creates a new revision and restarts all checks.</p>
+ <div class="mb-2">{{ recheck_form|safe }}</div>
+ <div class="mb-2">{{ cache_reset_form|safe }}</div>
{% endif %}
<h3 id="delete-draft" class="mt-4">Delete this draft</h3>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]