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-releases.git
The following commit(s) were added to refs/heads/main by this push:
new 0d5928f Require subject template hashes only from forms and not from
the API
0d5928f is described below
commit 0d5928f26a912d3343ebcdecf08fc3d99bfe5b42
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Jan 20 14:08:26 2026 +0000
Require subject template hashes only from forms and not from the API
---
atr/api/__init__.py | 34 ++++++++++++++++------------------
atr/models/api.py | 2 --
atr/post/announce.py | 18 +++++++++---------
atr/storage/writers/announce.py | 2 +-
4 files changed, 26 insertions(+), 30 deletions(-)
diff --git a/atr/api/__init__.py b/atr/api/__init__.py
index c147431..e253a14 100644
--- a/atr/api/__init__.py
+++ b/atr/api/__init__.py
@@ -774,15 +774,14 @@ async def publisher_release_announce(data:
models.api.PublisherReleaseAnnounceAr
committee = util.unwrap(project.committee)
async with storage.write_as_committee_member(committee.name, asf_uid)
as wacm:
await wacm.announce.release(
- project.name,
- data.version,
- data.revision,
- data.email_to,
- data.subject,
- data.body,
- data.path_suffix,
- asf_uid,
- asf_uid,
+ project_name=project.name,
+ version_name=data.version,
+ preview_revision_number=data.revision,
+ recipient=data.email_to,
+ body=data.body,
+ download_path_suffix=data.path_suffix,
+ asf_uid=asf_uid,
+ fullname=asf_uid,
)
except storage.AccessError as e:
raise exceptions.BadRequest(str(e))
@@ -867,15 +866,14 @@ async def release_announce(data:
models.api.ReleaseAnnounceArgs) -> DictResponse
async with storage.write_as_project_committee_member(data.project,
asf_uid) as wacm:
# TODO: Get fullname and use it instead of asf_uid
await wacm.announce.release(
- data.project,
- data.version,
- data.revision,
- data.email_to,
- data.subject,
- data.body,
- data.path_suffix,
- asf_uid,
- asf_uid,
+ project_name=data.project,
+ version_name=data.version,
+ preview_revision_number=data.revision,
+ recipient=data.email_to,
+ body=data.body,
+ download_path_suffix=data.path_suffix,
+ asf_uid=asf_uid,
+ fullname=asf_uid,
)
except storage.AccessError as e:
raise exceptions.BadRequest(str(e))
diff --git a/atr/models/api.py b/atr/models/api.py
index e4fff34..ad9842e 100644
--- a/atr/models/api.py
+++ b/atr/models/api.py
@@ -344,7 +344,6 @@ class PublisherReleaseAnnounceArgs(schema.Strict):
version: str = schema.example("0.0.1")
revision: str = schema.example("00005")
email_to: str = schema.example("[email protected]")
- subject: str = schema.example("[ANNOUNCE] Apache Example 1.0.0 release")
body: str = schema.example("The Apache Example team is pleased to announce
the release of Example 1.0.0...")
path_suffix: str = schema.example("example/1.0.0")
@@ -384,7 +383,6 @@ class ReleaseAnnounceArgs(schema.Strict):
version: str = schema.example("1.0.0")
revision: str = schema.example("00005")
email_to: str = schema.example("[email protected]")
- subject: str = schema.example("[ANNOUNCE] Apache Example 1.0.0 release")
body: str = schema.example("The Apache Example team is pleased to announce
the release of Example 1.0.0...")
path_suffix: str = schema.example("example/1.0.0")
diff --git a/atr/post/announce.py b/atr/post/announce.py
index 3606802..44ac948 100644
--- a/atr/post/announce.py
+++ b/atr/post/announce.py
@@ -73,15 +73,15 @@ async def selected(
try:
async with storage.write_as_project_committee_member(project_name,
session) as wacm:
await wacm.announce.release(
- project_name,
- version_name,
- preview_revision_number,
- announce_form.mailing_list,
- announce_form.subject_template_hash,
- announce_form.body,
- announce_form.download_path_suffix,
- session.uid,
- session.fullname,
+ project_name=project_name,
+ version_name=version_name,
+ preview_revision_number=preview_revision_number,
+ recipient=announce_form.mailing_list,
+ body=announce_form.body,
+ download_path_suffix=announce_form.download_path_suffix,
+ asf_uid=session.uid,
+ fullname=session.fullname,
+ subject_template_hash=announce_form.subject_template_hash,
)
except storage.AccessError as e:
return await session.redirect(
diff --git a/atr/storage/writers/announce.py b/atr/storage/writers/announce.py
index 7a5f66a..cbf9692 100644
--- a/atr/storage/writers/announce.py
+++ b/atr/storage/writers/announce.py
@@ -106,11 +106,11 @@ class CommitteeMember(CommitteeParticipant):
version_name: str,
preview_revision_number: str,
recipient: str,
- subject_template_hash: str | None,
body: str,
download_path_suffix: str,
asf_uid: str,
fullname: str,
+ subject_template_hash: str | None = None,
) -> None:
if recipient not in util.permitted_announce_recipients(asf_uid):
raise storage.AccessError(f"You are not permitted to send
announcements to {recipient}")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]