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 25f9c4f Add a command to resolve a vote
25f9c4f is described below
commit 25f9c4fbb91ac49bebdb2204196699a904a45369
Author: Sean B. Palmer <[email protected]>
AuthorDate: Mon Jul 14 20:06:13 2025 +0100
Add a command to resolve a vote
---
pyproject.toml | 4 ++--
src/atrclient/client.py | 20 +++++++++++++++++++-
src/atrclient/models/api.py | 6 ++++++
tests/cli_workflow.t | 6 ++++++
uv.lock | 4 ++--
5 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 1304f54..01c6070 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,7 +11,7 @@ build-backend = "hatchling.build"
[project]
name = "apache-trusted-releases"
-version = "0.20250714.1852"
+version = "0.20250714.1904"
description = "ATR CLI and Python API"
readme = "README.md"
requires-python = ">=3.13"
@@ -72,4 +72,4 @@ select = [
]
[tool.uv]
-exclude-newer = "2025-07-14T18:52:00Z"
+exclude-newer = "2025-07-14T19:04:00Z"
diff --git a/src/atrclient/client.py b/src/atrclient/client.py
index 4a2019f..1d02f47 100755
--- a/src/atrclient/client.py
+++ b/src/atrclient/client.py
@@ -470,13 +470,31 @@ def app_upload(project: str, version: str, path: str,
filepath: str, /) -> None:
print_json(result)
+@APP_VOTE.command(name="resolve", help="Resolve a vote.")
+def app_vote_resolve(
+ project: str,
+ version: str,
+ resolution: Literal["passed", "failed"],
+) -> None:
+ jwt_value = config_jwt_usable()
+ host, verify_ssl = config_host_get()
+ url = f"https://{host}/api/vote/resolve"
+ args = models.api.ProjectVersionResolution(
+ project=project,
+ version=version,
+ resolution=resolution,
+ )
+ result = asyncio.run(web_post(url, args, jwt_value, verify_ssl))
+ print_json(result)
+
+
@APP_VOTE.command(name="start", help="Start a vote.")
def app_vote_start(
project: str,
version: str,
revision: str,
/,
- mailing_list: str,
+ mailing_list: Annotated[str, cyclopts.Parameter(alias="-m",
name="--mailing-list")],
duration: Annotated[int, cyclopts.Parameter(alias="-d",
name="--duration")] = 72,
subject: Annotated[str | None, cyclopts.Parameter(alias="-s",
name="--subject")] = None,
body: Annotated[str | None, cyclopts.Parameter(alias="-b", name="--body")]
= None,
diff --git a/src/atrclient/models/api.py b/src/atrclient/models/api.py
index 1662806..2a41445 100644
--- a/src/atrclient/models/api.py
+++ b/src/atrclient/models/api.py
@@ -67,6 +67,12 @@ class ProjectVersionRelpathContent(schema.Strict):
content: str
+class ProjectVersionResolution(schema.Strict):
+ project: str
+ version: str
+ resolution: Literal["passed", "failed"]
+
+
class VoteStart(schema.Strict):
project: str
version: str
diff --git a/tests/cli_workflow.t b/tests/cli_workflow.t
index a4fc744..4365f61 100644
--- a/tests/cli_workflow.t
+++ b/tests/cli_workflow.t
@@ -33,6 +33,12 @@ $ atr checks status tooling-test-example 0.3+cli
Total checks: 1
warning: 1
+$ atr vote start tooling-test-example 0.3+cli 00002 -m "<!user!>@apache.org"
+<.skip.>"email_to": "<!user!>@apache.org"<.skip.>
+
+$ atr vote resolve tooling-test-example 0.3+cli failed
+{"success": "Vote marked as failed"}
+
<# Tidy up. #>
* atr draft delete tooling-test-example 0.3+cli
<.etc.>
diff --git a/uv.lock b/uv.lock
index a109ab4..55a918e 100644
--- a/uv.lock
+++ b/uv.lock
@@ -2,7 +2,7 @@ version = 1
requires-python = ">=3.13"
[options]
-exclude-newer = "2025-07-14T18:52:00Z"
+exclude-newer = "2025-07-14T19:04:00Z"
[[package]]
name = "aiohappyeyeballs"
@@ -83,7 +83,7 @@ wheels = [
[[package]]
name = "apache-trusted-releases"
-version = "0.20250714.1852"
+version = "0.20250714.1904"
source = { editable = "." }
dependencies = [
{ name = "aiohttp" },
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]