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/10/14 18:41:46 UTC
(tooling-releases-client) branch main updated: Make the staging argument optional in the distribution command
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 6510448 Make the staging argument optional in the distribution command
6510448 is described below
commit 651044889b9ca35b9e2ba916cb8102e418118741
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Wed Oct 14 19:41:21 2026 +0100
Make the staging argument optional in the distribution command
---
COMMANDS.md | 5 ++---
pyproject.toml | 4 ++--
src/atrclient/client.py | 5 ++---
src/atrclient/models/api.py | 8 ++++++++
tests/cli_workflow.t | 2 +-
tests/test_all.py | 30 ++++++++++++++++++++++++++++++
uv.lock | 10 +++++-----
7 files changed, 50 insertions(+), 14 deletions(-)
diff --git a/COMMANDS.md b/COMMANDS.md
index 8d66e59..d5012c2 100644
--- a/COMMANDS.md
+++ b/COMMANDS.md
@@ -382,7 +382,7 @@ List recorded distributions for a release.
```
Usage: atr distribution record PROJECT VERSION PLATFORM DISTRIBUTION-OWNER-NAMESPACE DISTRIBUTION-PACKAGE
-DISTRIBUTION-VERSION STAGING DETAILS
+DISTRIBUTION-VERSION [ARGS]
Record a distribution.
@@ -396,8 +396,7 @@ Record a distribution.
│ --distribution-package │
│ * DISTRIBUTION-VERSION [required] │
│ --distribution-version │
-│ * STAGING --staging --no-staging [required] │
-│ * DETAILS --details --no-details [required] │
+│ STAGING --staging --no-staging [default: False] │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```
diff --git a/pyproject.toml b/pyproject.toml
index bb1c153..12f10ba 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,7 +11,7 @@ build-backend = "hatchling.build"
[project]
name = "apache-trusted-releases"
-version = "0.20261013.1330"
+version = "0.20261014.1840"
description = "ATR CLI and Python API"
readme = "README.md"
requires-python = ">=3.12"
@@ -91,4 +91,4 @@ filterwarnings = [
]
[tool.uv]
-exclude-newer = "2026-10-13T13:30:00Z"
+exclude-newer = "2026-10-14T18:40:00Z"
diff --git a/src/atrclient/client.py b/src/atrclient/client.py
index ac055af..73e9461 100755
--- a/src/atrclient/client.py
+++ b/src/atrclient/client.py
@@ -517,8 +517,7 @@ def app_distribution_record(
distribution_owner_namespace: str | None,
distribution_package: str,
distribution_version: str,
- staging: bool,
- details: bool,
+ staging: bool = False,
) -> None:
if not distribution_owner_namespace or distribution_owner_namespace == "None":
distribution_owner_namespace = None
@@ -535,7 +534,7 @@ def app_distribution_record(
distribution_package=models.safe.Alphanumeric(distribution_package),
distribution_version=models.safe.VersionKey(distribution_version),
staging=staging,
- details=details,
+ details=False,
)
distribution_record = api.distribution_record(distribution_record_args)
if not distribution_record.success:
diff --git a/src/atrclient/models/api.py b/src/atrclient/models/api.py
index e833b47..8ac25d6 100644
--- a/src/atrclient/models/api.py
+++ b/src/atrclient/models/api.py
@@ -1021,6 +1021,7 @@ class VoteResolveArgs(schema.Strict):
project: safe.ProjectKey = schema.example("example")
version: safe.VersionKey = schema.example("0.0.1")
resolution: Literal["passed", "failed", "cancelled"] = schema.example("passed")
+ early_reason: str = schema.default_example("", "Fix for a publicly known security issue")
class VoteResolveResults(schema.Strict):
@@ -1046,6 +1047,13 @@ class VoteStartArgs(schema.Strict):
automatic_publish_when_resolved: bool = schema.default_example(False, False)
concerns_noted: list[str] = schema.default_example([], ["atr.tasks.checks.license.headers"])
+ @pydantic.field_validator("vote_duration")
+ @classmethod
+ def validate_vote_duration(cls, v: int | None) -> int | None:
+ if v is not None:
+ validation.validate_policy_min_hours(v)
+ return v
+
class VoteStartResults(schema.Strict):
endpoint: Literal["/vote/start"] = schema.alias("endpoint")
diff --git a/tests/cli_workflow.t b/tests/cli_workflow.t
index ce9eb94..a0bc4fd 100644
--- a/tests/cli_workflow.t
+++ b/tests/cli_workflow.t
@@ -64,7 +64,7 @@ $ atr vote start test-client 0.3+cli 00004 -m "<!user!>@apache.org" --auto-publi
$ atr vote resolve test-client 0.3+cli passed
Vote marked as passed.
-$ atr distribution record test-client 0.3+cli NPM None react 18.2.0 False False
+$ atr distribution record test-client 0.3+cli NPM None react 18.2.0
Distribution recorded.
$ atr distribution list test-client 0.3+cli
diff --git a/tests/test_all.py b/tests/test_all.py
index bec2eea..b7ddd88 100644
--- a/tests/test_all.py
+++ b/tests/test_all.py
@@ -1129,6 +1129,36 @@ def test_app_distribution_list_empty(capsys: pytest.CaptureFixture[str], fixture
assert capsys.readouterr().out == ""
+@pytest.mark.parametrize(
+ ("staging_args", "staging"), [([], False), (["true"], True), (["false"], False), (["--staging"], True)]
+)
+def test_app_distribution_record_staging(
+ staging_args: list[str], staging: bool, fixture_config_env: pathlib.Path
+) -> None:
+ config.write({"atr": {"host": "example.invalid"}, "tokens": {"jwt": "dummy_jwt_token"}})
+ record_url = "https://example.invalid/api/distribution/record"
+ args = ["record", "test-project", "2.3.1", "NPM", "None", "react", "18.2.0", *staging_args]
+
+ with aioresponses.aioresponses() as mock:
+ mock.post(record_url, payload={"endpoint": "/distribution/record", "success": True})
+ client.APP_DISTRIBUTION(args, result_action="return_value")
+ mock.assert_called_once_with(
+ record_url,
+ method="POST",
+ args_to_match=["json"],
+ json={
+ "project": "test-project",
+ "version": "2.3.1",
+ "platform": "NPM",
+ "distribution_owner_namespace": None,
+ "distribution_package": "react",
+ "distribution_version": "18.2.0",
+ "staging": staging,
+ "details": False,
+ },
+ )
+
+
def test_app_set_show(capsys: pytest.CaptureFixture[str], fixture_config_env: pathlib.Path) -> None:
client.app_set("atr.host", "example.invalid")
client.app_show("atr.host")
diff --git a/uv.lock b/uv.lock
index 4b6410d..5d055a0 100644
--- a/uv.lock
+++ b/uv.lock
@@ -3,7 +3,7 @@ revision = 3
requires-python = ">=3.12"
[options]
-exclude-newer = "2026-10-13T13:30:00Z"
+exclude-newer = "2026-10-14T18:40:00Z"
[[package]]
name = "aiohappyeyeballs"
@@ -193,7 +193,7 @@ wheels = [
[[package]]
name = "apache-trusted-releases"
-version = "0.20261013.1330"
+version = "0.20261014.1840"
source = { editable = "." }
dependencies = [
{ name = "aiohttp" },
@@ -483,11 +483,11 @@ wheels = [
[[package]]
name = "filelock"
-version = "4.1.1"
+version = "4.1.2"
source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/35/c8/1d457d9150ff948f2ce6ada7715e0eeebbe5d3b58a45271a1e222474bcd3/filelock-4.1.1.tar.gz", hash = "sha256:7ba0927482c5a814b0a7f391d029ccdb8010f576f0a74c0dcde1811e8bc4c1b6", size = 563430, upload-time = "2026-10-11T16:11:54.373Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/8c/32/5f1e1408eda63bdecdb814dfd18b1109d239fb9695d51780c2e8a2816e76/filelock-4.1.2.tar.gz", hash = "sha256:c541dd91878706be3ff20e934a0b913972d4eff7a20ddfc17defd2b7328d006c", size = 565129, upload-time = "2026-10-14T14:47:34.513Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/d7/8b/f837f52905395ba4510fe61f753c24833fb0a9c76e21267bb9f828b664a9/filelock-4.1.1-py3-none-any.whl", hash = "sha256:3f4a557945a7b0f95efeb1f432267affe5d45ac8ddde2aed1b97ebb62382c089", size = 132460, upload-time = "2026-10-11T16:11:52.753Z" },
+ { url = "https://files.pythonhosted.org/packages/1b/84/16cbc2a5a102edf4b745ca43d7b9aaa8e26d46686c8e54d70d3d1225659e/filelock-4.1.2-py3-none-any.whl", hash = "sha256:4d5dc2a1d64d6b48a5f0540814000986fd62ebd3ac9ccbb1d07d669e075db9bb", size = 132861, upload-time = "2026-10-14T14:47:33Z" },
]
[[package]]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org