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-releases-client.git
The following commit(s) were added to refs/heads/main by this push:
new d6e1d02 Add a command to announce a release
d6e1d02 is described below
commit d6e1d02d2740c19f04bbe6e80678b42ee186d6b1
Author: Sean B. Palmer <[email protected]>
AuthorDate: Mon Jul 14 20:45:54 2025 +0100
Add a command to announce a release
---
pyproject.toml | 4 ++--
src/atrclient/client.py | 27 +++++++++++++++++++++++++++
src/atrclient/models/api.py | 10 ++++++++++
tests/cli_workflow.t | 3 +++
uv.lock | 4 ++--
5 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 44941fa..af53adf 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,7 +11,7 @@ build-backend = "hatchling.build"
[project]
name = "apache-trusted-releases"
-version = "0.20250714.1914"
+version = "0.20250714.1944"
description = "ATR CLI and Python API"
readme = "README.md"
requires-python = ">=3.13"
@@ -72,4 +72,4 @@ select = [
]
[tool.uv]
-exclude-newer = "2025-07-14T19:14:00Z"
+exclude-newer = "2025-07-14T19:44:00Z"
diff --git a/src/atrclient/client.py b/src/atrclient/client.py
index 5615c34..889d907 100755
--- a/src/atrclient/client.py
+++ b/src/atrclient/client.py
@@ -74,6 +74,33 @@ YAML_SCHEMA: strictyaml.Map = strictyaml.Map(
JSON = dict[str, Any] | list[Any] | str | int | float | bool | None
[email protected](name="announce", help="Announce a release.")
+def app_announce(
+ project: str,
+ version: str,
+ revision: str,
+ /,
+ mailing_list: Annotated[str, cyclopts.Parameter(alias="-m",
name="--mailing-list")],
+ subject: Annotated[str | None, cyclopts.Parameter(alias="-s",
name="--subject")] = None,
+ body: Annotated[str | None, cyclopts.Parameter(alias="-b", name="--body")]
= None,
+ path_suffix: Annotated[str | None, cyclopts.Parameter(alias="-p",
name="--path-suffix")] = None,
+) -> None:
+ jwt_value = config_jwt_usable()
+ host, verify_ssl = config_host_get()
+ announce = models.api.Announce(
+ project=project,
+ version=version,
+ revision=revision,
+ email_to=mailing_list,
+ subject=subject or f"[ANNOUNCE] Release {project} {version}",
+ body=body or f"Release {project} {version} has been announced.",
+ path_suffix=path_suffix or "",
+ )
+ url = f"https://{host}/api/announce"
+ result = asyncio.run(web_post(url, announce, jwt_value, verify_ssl))
+ print_json(result)
+
+
@APP_CHECKS.command(name="exceptions", help="Get check exceptions for a
release revision.")
def app_checks_exceptions(
project: str,
diff --git a/src/atrclient/models/api.py b/src/atrclient/models/api.py
index 2a41445..76fb7c8 100644
--- a/src/atrclient/models/api.py
+++ b/src/atrclient/models/api.py
@@ -45,6 +45,16 @@ class Task(Pagination):
status: str | None = None
+class Announce(schema.Strict):
+ project: str
+ version: str
+ revision: str
+ email_to: str
+ subject: str
+ body: str
+ path_suffix: str
+
+
class AsfuidPat(schema.Strict):
asfuid: str
pat: str
diff --git a/tests/cli_workflow.t b/tests/cli_workflow.t
index afb9047..4b8d2ee 100644
--- a/tests/cli_workflow.t
+++ b/tests/cli_workflow.t
@@ -45,6 +45,9 @@ $ atr vote start tooling-test-example 0.3+cli 00002 -m
"<!user!>@apache.org"
$ atr vote resolve tooling-test-example 0.3+cli passed
{"success": "Vote marked as passed"}
+$ atr announce tooling-test-example 0.3+cli 00003 -m "<!user!>@apache.org" -s
"[ANNOUNCE] Release tooling-test-example 0.3+cli" -b "Release
tooling-test-example 0.3+cli has been announced."
+{"success": "Announcement sent"}
+
<# Tidy up. #>
* atr dev delete tooling-test-example 0.3+cli
<.etc.>
diff --git a/uv.lock b/uv.lock
index cf275be..5bf204f 100644
--- a/uv.lock
+++ b/uv.lock
@@ -2,7 +2,7 @@ version = 1
requires-python = ">=3.13"
[options]
-exclude-newer = "2025-07-14T19:14:00Z"
+exclude-newer = "2025-07-14T19:44:00Z"
[[package]]
name = "aiohappyeyeballs"
@@ -83,7 +83,7 @@ wheels = [
[[package]]
name = "apache-trusted-releases"
-version = "0.20250714.1914"
+version = "0.20250714.1944"
source = { editable = "." }
dependencies = [
{ name = "aiohttp" },
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]