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 6b2aec9 Disallow manual voting process for incubator releases
6b2aec9 is described below
commit 6b2aec961a7c58f6cccb46cad97e3378cf44cbb0
Author: Sean B. Palmer <[email protected]>
AuthorDate: Wed Jul 2 16:29:43 2025 +0100
Disallow manual voting process for incubator releases
---
atr/routes/projects.py | 7 +++++-
atr/templates/project-view.html | 50 ++++++++++++++++++++++-------------------
2 files changed, 33 insertions(+), 24 deletions(-)
diff --git a/atr/routes/projects.py b/atr/routes/projects.py
index 1cf560d..0440b22 100644
--- a/atr/routes/projects.py
+++ b/atr/routes/projects.py
@@ -84,6 +84,7 @@ class ReleasePolicyForm(util.QuartFormTyped):
manual_vote = wtforms.BooleanField(
"Manual voting process",
description="If this is set then the vote will be completely manual
and following policy is ignored.",
+ default=False,
)
mailto_addresses = wtforms.FieldList(
wtforms.StringField(
@@ -476,13 +477,17 @@ async def _policy_edit(
release_policy.strict_checking =
util.unwrap(policy_form.strict_checking.data)
# Vote section
- release_policy.manual_vote = util.unwrap(policy_form.manual_vote.data)
+ release_policy.manual_vote = policy_form.manual_vote.data or False
if not release_policy.manual_vote:
release_policy.mailto_addresses =
[util.unwrap(policy_form.mailto_addresses.entries[0].data)]
_set_default_min_hours(policy_form, project, release_policy)
release_policy.pause_for_rm =
util.unwrap(policy_form.pause_for_rm.data)
release_policy.release_checklist =
util.unwrap(policy_form.release_checklist.data)
_set_default_start_vote_template(policy_form, project,
release_policy)
+ elif project.committee and project.committee.is_podling:
+ # The caller ensures that project.committee is not None
+ await quart.flash("Manual voting is not allowed for podlings.",
"error")
+ return False, policy_form
# Finish section
_set_default_announce_release_template(policy_form, project,
release_policy)
diff --git a/atr/templates/project-view.html b/atr/templates/project-view.html
index 0176239..33c41ed 100644
--- a/atr/templates/project-view.html
+++ b/atr/templates/project-view.html
@@ -121,16 +121,18 @@
<h3 class="col-md-3 col-form-label text-md-end fs-4">Vote
options</h3>
</div>
- <div class="mb-3 pb-3 row border-bottom">
- {{ forms.label(policy_form.manual_vote, col="md3-high") }}
- <div class="col-sm-8">
- <div class="form-check">
- {{ forms.widget(policy_form.manual_vote,
classes="form-check-input", boolean_label="Enable") }}
- {{ forms.errors(policy_form.manual_vote,
classes="invalid-feedback d-block") }}
+ {% if not project.committee.is_podling %}
+ <div class="mb-3 pb-3 row border-bottom">
+ {{ forms.label(policy_form.manual_vote, col="md3-high") }}
+ <div class="col-sm-8">
+ <div class="form-check">
+ {{ forms.widget(policy_form.manual_vote,
classes="form-check-input", boolean_label="Enable") }}
+ {{ forms.errors(policy_form.manual_vote,
classes="invalid-feedback d-block") }}
+ </div>
+ {{ forms.description(policy_form.manual_vote) }}
</div>
- {{ forms.description(policy_form.manual_vote) }}
</div>
- </div>
+ {% endif %}
<div id="vote-options-extra">
@@ -464,19 +466,21 @@
{% block javascripts %}
{{ super() }}
- <script>
- document.addEventListener("DOMContentLoaded", () => {
- const manual = document.querySelector("input[name='manual_vote']");
- const extra = document.getElementById("vote-options-extra");
- if (!manual || !extra) return;
-
- function toggle() {
- extra.hidden = manual.checked;
- extra.querySelectorAll("input, textarea, select").forEach(el
=> (el.disabled = manual.checked));
- }
-
- manual.addEventListener("change", toggle);
- toggle();
- });
- </script>
+ {% if not project.committee.is_podling %}
+ <script>
+ document.addEventListener("DOMContentLoaded", () => {
+ const manual =
document.querySelector("input[name='manual_vote']");
+ const extra = document.getElementById("vote-options-extra");
+ if (!manual || !extra) return;
+
+ function toggle() {
+ extra.hidden = manual.checked;
+ extra.querySelectorAll("input, textarea, select").forEach(el
=> (el.disabled = manual.checked));
+ }
+
+ manual.addEventListener("change", toggle);
+ toggle();
+ });
+ </script>
+ {% endif %}
{% endblock javascripts %}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]