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 479e581 Add a command to delete a draft release
479e581 is described below
commit 479e58116d51f25e90d0b14b1ca79c119bbbade2
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Jul 10 19:02:47 2025 +0100
Add a command to delete a draft release
---
pyproject.toml | 4 ++--
src/atrclient/client.py | 17 ++++++++++++++++-
tests/cli_version.t | 2 +-
uv.lock | 4 ++--
4 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index d7c8e27..5728a35 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,7 +11,7 @@ build-backend = "hatchling.build"
[project]
name = "apache-trusted-releases"
-version = "0.20250710.1620"
+version = "0.20250710.1756"
description = "ATR CLI and Python API"
readme = "README.md"
requires-python = ">=3.13"
@@ -48,4 +48,4 @@ atr = "atrclient.client:main"
packages = ["src/atrclient"]
[tool.uv]
-exclude-newer = "2025-07-10T16:20:00Z"
+exclude-newer = "2025-07-10T17:56:00Z"
diff --git a/src/atrclient/client.py b/src/atrclient/client.py
index f42e751..182acf7 100755
--- a/src/atrclient/client.py
+++ b/src/atrclient/client.py
@@ -49,6 +49,7 @@ APP: cyclopts.App = cyclopts.App()
CHECKS: cyclopts.App = cyclopts.App(name="checks", help="Check result
operations.")
CONFIG: cyclopts.App = cyclopts.App(name="config", help="Configuration
operations.")
DEV: cyclopts.App = cyclopts.App(name="dev", help="Developer operations.")
+DRAFT: cyclopts.App = cyclopts.App(name="draft", help="Draft operations.")
JWT: cyclopts.App = cyclopts.App(name="jwt", help="JWT operations.")
RELEASE: cyclopts.App = cyclopts.App(name="release", help="Release
operations.")
VERSION: str = metadata.version("apache-trusted-releases")
@@ -302,6 +303,7 @@ def app_release_info(project: str, version: str, /) -> None:
@RELEASE.command(name="list", help="List releases for a project.")
def app_release_list(project: str, /) -> None:
+ # TODO: Support showing all of a user's releases if no project is provided
host, verify_ssl = config_host_get()
url = f"https://{host}/api/releases/{project}"
result = asyncio.run(web_get_public(url, verify_ssl))
@@ -409,6 +411,16 @@ def app_vote_start(
print(result)
[email protected](name="delete", help="Delete a draft release.")
+def app_draft_delete(project: str, version: str, /) -> None:
+ jwt_value = config_jwt_usable()
+ host, verify_ssl = config_host_get()
+ payload: dict[str, str] = {"project_name": project, "version": version}
+ url = f"https://{host}/api/draft/delete"
+ result = asyncio.run(web_post(url, payload, jwt_value, verify_ssl))
+ print(result)
+
+
def checks_display(results: list[dict[str, Any]], verbose: bool = False) ->
None:
if not results:
print("No check results found for this revision.")
@@ -759,6 +771,7 @@ def subcommands_register(app: cyclopts.App) -> None:
app.command(CHECKS)
app.command(CONFIG)
app.command(DEV)
+ app.command(DRAFT)
app.command(JWT)
app.command(RELEASE)
app.command(VOTE)
@@ -838,7 +851,9 @@ async def web_post(
async with session.post(url, json=payload) as resp:
if resp.status not in (200, 201):
text = await resp.text()
- show_error_and_exit(f"Release add failed: {resp.status}
{text}")
+ show_error_and_exit(
+ f"Error message from the API:\n{resp.status} {url}\n{text}"
+ )
try:
return await resp.json()
diff --git a/tests/cli_version.t b/tests/cli_version.t
index 7ded9f4..efde72d 100644
--- a/tests/cli_version.t
+++ b/tests/cli_version.t
@@ -1,2 +1,2 @@
$ atr --version
-0.20250710.1620
+0.20250710.1756
diff --git a/uv.lock b/uv.lock
index 4097c4e..8f76a75 100644
--- a/uv.lock
+++ b/uv.lock
@@ -2,7 +2,7 @@ version = 1
requires-python = ">=3.13"
[options]
-exclude-newer = "2025-07-10T16:20:00Z"
+exclude-newer = "2025-07-10T17:56:00Z"
[[package]]
name = "aiohappyeyeballs"
@@ -74,7 +74,7 @@ wheels = [
[[package]]
name = "apache-trusted-releases"
-version = "0.20250710.1620"
+version = "0.20250710.1756"
source = { editable = "." }
dependencies = [
{ name = "aiohttp" },
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]