You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by sb...@apache.org on 2025/04/30 15:40:42 UTC
(tooling-trusted-release) branch main updated: Make the option to send to self progress a release to the vote phase
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 dee6ace Make the option to send to self progress a release to the vote phase
dee6ace is described below
commit dee6ace97591dbcf8384727dfdfda1d343718b40
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Wed Apr 30 16:40:16 2025 +0100
Make the option to send to self progress a release to the vote phase
---
atr/routes/voting.py | 38 ++++++++++++-----------------
atr/templates/voting-selected-revision.html | 4 +--
2 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/atr/routes/voting.py b/atr/routes/voting.py
index 0e89100..3393fdb 100644
--- a/atr/routes/voting.py
+++ b/atr/routes/voting.py
@@ -69,10 +69,7 @@ async def selected_revision(
release_name = wtforms.HiddenField("Release Name")
mailing_list = wtforms.RadioField(
"Send vote email to",
- choices=[
- (recipient, recipient) if (recipient != sender) else (recipient, f"{recipient} (preview only)")
- for recipient in permitted_recipients
- ],
+ choices=sorted([(recipient, recipient) for recipient in permitted_recipients]),
validators=[wtforms.validators.InputRequired("Mailing list selection is required")],
default="user-tests@tooling.apache.org",
)
@@ -119,24 +116,21 @@ async def selected_revision(
if email_to not in permitted_recipients:
# This will be checked again by tasks/vote.py for extra safety
raise base.ASFQuartException("Invalid mailing list choice", errorcode=400)
- if email_to != sender:
- error = await _promote(data, release.name)
- if error:
- return await session.redirect(root.index, error=error)
-
- # This is now handled by the _promote call, above
- # # Update the release phase to the voting phase only if not sending a test message to the user
- # release.phase = models.ReleasePhase.RELEASE_CANDIDATE
-
- # Store when the release was put into the voting phase
- release.vote_started = datetime.datetime.now(datetime.UTC)
-
- # TODO: We also need to store the duration of the vote
- # We can't allow resolution of the vote until the duration has elapsed
- # But we allow the user to specify in the form
- # And yet we also have VotePolicy.min_hours
- # Presumably this sets the default, and the form takes precedence?
- # VotePolicy.min_hours can also be 0, though
+
+ # This sets the phase to RELEASE_CANDIDATE
+ error = await _promote(data, release.name)
+ if error:
+ return await session.redirect(root.index, error=error)
+
+ # Store when the release was put into the voting phase
+ release.vote_started = datetime.datetime.now(datetime.UTC)
+
+ # TODO: We also need to store the duration of the vote
+ # We can't allow resolution of the vote until the duration has elapsed
+ # But we allow the user to specify in the form
+ # And yet we also have VotePolicy.min_hours
+ # Presumably this sets the default, and the form takes precedence?
+ # VotePolicy.min_hours can also be 0, though
# Create a task for vote initiation
task = models.Task(
diff --git a/atr/templates/voting-selected-revision.html b/atr/templates/voting-selected-revision.html
index b44a0f6..53b5d92 100644
--- a/atr/templates/voting-selected-revision.html
+++ b/atr/templates/voting-selected-revision.html
@@ -48,7 +48,7 @@
<div class="row mb-3 pb-3 border-bottom">
<div class="col-md-3 text-md-end fw-medium">{{ form.mailing_list.label }}</div>
<div class="col-md-9">
- <div class="d-flex gap-4">
+ <div class="d-flex gap-4 mb-2">
{% for subfield in form.mailing_list %}
<div class="form-check">
{{ subfield(class_='form-check-input') }}
@@ -61,7 +61,7 @@
{% for error in form.mailing_list.errors %}{{ error }}{% endfor %}
</div>
{% endif %}
- <small class="form-text text-muted">NOTE: Sending a message to yourself for testing will not update the release phase.</small>
+ <small class="form-text text-muted">NOTE: The limited options above are provided for testing purposes. In the finished version of ATR, you will be able to send to your own specified mailing lists.</small>
</div>
</div>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org