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 2026/07/23 13:47:41 UTC
(tooling-trusted-releases) 02/02: Rename the disclaimer template variable for podlings
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
commit eae70edd97ece86c526e48139aff244dcc09337c
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Thu Jul 23 14:15:46 2026 +0100
Rename the disclaimer template variable for podlings
---
atr/construct.py | 6 ++--
atr/models/sql.py | 7 ++--
migrations/versions/0112_2026.07.22_d374db02.py | 47 +++++++++++++++++++++++++
tests/unit/test_policy_announce_default.py | 32 +++++++++++++++++
4 files changed, 87 insertions(+), 5 deletions(-)
diff --git a/atr/construct.py b/atr/construct.py
index 06024416..937ed556 100644
--- a/atr/construct.py
+++ b/atr/construct.py
@@ -45,12 +45,12 @@ class _AnnounceSubjectValues(TypedDict):
class _AnnounceValues(TypedDict):
BUG_DATABASE: str
COMMITTEE: str
- DISCLAIMER: str
DOWNLOAD_PAGE: str
DOWNLOAD_URL: str
HOMEPAGE: str
LIFECYCLE_PAGE: str
MAILING_LISTS: str
+ PODLING_DISCLAIMER: str
PROJECT_NAME: str
PROJECT_KEY: str
REPOSITORY: str
@@ -116,7 +116,6 @@ TEMPLATE_DESCRIPTIONS: Final[dict[str, str]] = {
"BUG_DATABASE": "Bug database URL",
"CHECKLIST_URL": "URL to the release checklist",
"COMMITTEE": "Committee name",
- "DISCLAIMER": "Podling incubation disclaimer",
"DOWNLOAD_PAGE": "Download page URL",
"DOWNLOAD_URL": "URL to download the release",
"DURATION": "Vote duration in hours",
@@ -125,6 +124,7 @@ TEMPLATE_DESCRIPTIONS: Final[dict[str, str]] = {
"LIFECYCLE_PAGE": "Lifecycle page URL",
"MAILING_LISTS": "Mailing lists page URL",
"OUTCOME": "Vote outcome - 'passed' or 'failed'",
+ "PODLING_DISCLAIMER": "Podling incubation disclaimer",
"PROJECT_NAME": "Project name",
"PROJECT_KEY": "ATR key for the project",
"RELEASE_CHECKLIST": "Release checklist content",
@@ -223,12 +223,12 @@ async def announce_release_subject_and_body(
values: _AnnounceValues = {
"BUG_DATABASE": project.bug_database or "",
"COMMITTEE": committee.display_name,
- "DISCLAIMER": _podling_disclaimer(project, committee),
"DOWNLOAD_PAGE": project.download_page or "",
"DOWNLOAD_URL": download_url,
"HOMEPAGE": project.homepage or "",
"LIFECYCLE_PAGE": project.lifecycle_page or "",
"MAILING_LISTS": project.mailing_lists or "",
+ "PODLING_DISCLAIMER": _podling_disclaimer(project, committee),
"PROJECT_NAME": project_display_name,
"PROJECT_KEY": project.key,
"REPOSITORY": "\n".join(project.repositories),
diff --git a/atr/models/sql.py b/atr/models/sql.py
index 1c2d19b8..70b56dd4 100644
--- a/atr/models/sql.py
+++ b/atr/models/sql.py
@@ -1102,7 +1102,7 @@ class Project(sqlmodel.SQLModel, table=True):
@property
def policy_announce_release_default(self) -> str:
- return """\
+ template = """\
The Apache {{COMMITTEE}} project team is pleased to announce the
release of {{PROJECT_NAME}} {{VERSION}}.
@@ -1111,11 +1111,14 @@ This is a stable release available for production use.
Downloads are available from the following URL:
{{DOWNLOAD_URL}}
-{{DISCLAIMER}}
+{{PODLING_DISCLAIMER}}
On behalf of the Apache {{COMMITTEE}} project team,
{{YOUR_FULL_NAME}} ({{YOUR_ASF_ID}})
"""
+ if self.committee and self.committee.is_podling:
+ return template
+ return template.replace("{{PODLING_DISCLAIMER}}\n", "\n")
@property
def policy_announce_release_subject_default(self) -> str:
diff --git a/migrations/versions/0112_2026.07.22_d374db02.py b/migrations/versions/0112_2026.07.22_d374db02.py
new file mode 100644
index 00000000..a5806aff
--- /dev/null
+++ b/migrations/versions/0112_2026.07.22_d374db02.py
@@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Rename the DISCLAIMER announce template variable
+
+Revision ID: 0112_2026.07.22_d374db02
+Revises: 0111_2026.07.22_f67fc10f
+Create Date: 2026-07-22 20:01:34.682465+00:00
+"""
+
+from collections.abc import Sequence
+
+from alembic import op
+
+# Revision identifiers, used by Alembic
+revision: str = "0112_2026.07.22_d374db02"
+down_revision: str | None = "0111_2026.07.22_f67fc10f"
+branch_labels: str | Sequence[str] | None = None
+depends_on: str | Sequence[str] | None = None
+
+
+def upgrade() -> None:
+ op.execute(
+ "UPDATE releasepolicy SET announce_release_template ="
+ " REPLACE(announce_release_template, '{{DISCLAIMER}}', '{{PODLING_DISCLAIMER}}')"
+ )
+
+
+def downgrade() -> None:
+ op.execute(
+ "UPDATE releasepolicy SET announce_release_template ="
+ " REPLACE(announce_release_template, '{{PODLING_DISCLAIMER}}', '{{DISCLAIMER}}')"
+ )
diff --git a/tests/unit/test_policy_announce_default.py b/tests/unit/test_policy_announce_default.py
new file mode 100644
index 00000000..08a01128
--- /dev/null
+++ b/tests/unit/test_policy_announce_default.py
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import atr.models.sql as sql
+
+
+def test_policy_announce_release_default_includes_disclaimer_for_podlings() -> None:
+ project = sql.Project(key="p", status=sql.ProjectStatus.ACTIVE)
+ project.committee = sql.Committee(key="p", is_podling=True)
+ assert "{{PODLING_DISCLAIMER}}" in project.policy_announce_release_default
+
+
+def test_policy_announce_release_default_omits_disclaimer_for_non_podlings() -> None:
+ project = sql.Project(key="p", status=sql.ProjectStatus.ACTIVE)
+ project.committee = sql.Committee(key="p", is_podling=False)
+ template = project.policy_announce_release_default
+ assert "{{PODLING_DISCLAIMER}}" not in template
+ assert "{{DOWNLOAD_URL}}\n\nOn behalf" in template
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org