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 cae3ce3 Update models
cae3ce3 is described below
commit cae3ce31633038e063815e5ca8f0434741c0f41b
Author: Sean B. Palmer <[email protected]>
AuthorDate: Mon Sep 8 16:38:21 2025 +0100
Update models
---
pyproject.toml | 4 +-
src/atrclient/models/__init__.py | 4 +-
src/atrclient/models/api.py | 76 +++++++++++++++++----
src/atrclient/models/distribution.py | 126 +++++++++++++++++++++++++++++++++++
src/atrclient/models/sql.py | 20 +++++-
uv.lock | 10 +--
6 files changed, 216 insertions(+), 24 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 3a80815..6053cd3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,7 +11,7 @@ build-backend = "hatchling.build"
[project]
name = "apache-trusted-releases"
-version = "0.20250904.1446"
+version = "0.20250908.1538"
description = "ATR CLI and Python API"
readme = "README.md"
requires-python = ">=3.13"
@@ -79,4 +79,4 @@ filterwarnings = [
]
[tool.uv]
-exclude-newer = "2025-09-04T14:46:00Z"
+exclude-newer = "2025-09-08T15:38:00Z"
diff --git a/src/atrclient/models/__init__.py b/src/atrclient/models/__init__.py
index 559a7d2..a9cb122 100644
--- a/src/atrclient/models/__init__.py
+++ b/src/atrclient/models/__init__.py
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-from . import api, helpers, results, schema, sql, tabulate
+from . import api, distribution, helpers, results, schema, sql, tabulate
# If we use .__name__, pyright gives a warning
-__all__ = ["api", "helpers", "results", "schema", "sql", "tabulate"]
+__all__ = ["api", "distribution", "helpers", "results", "schema", "sql",
"tabulate"]
diff --git a/src/atrclient/models/api.py b/src/atrclient/models/api.py
index 74f0095..eba2c52 100644
--- a/src/atrclient/models/api.py
+++ b/src/atrclient/models/api.py
@@ -71,18 +71,20 @@ class CommitteesListResults(schema.Strict):
committees: Sequence[sql.Committee]
-class GithubSshRegisterArgs(schema.Strict):
- jwt: str = schema.Field(...,
**example("eyJhbGciOiJIUzI1[...]mMjLiuyu5CSpyHI="))
- ssh_key: str = schema.Field(
- ..., **example("ssh-ed25519
AAAAC3NzaC1lZDI1NTEgH5C9okWi0dh25AAAAIOMqqnkVzrm0SdG6UOoqKLsabl9GKJl")
- )
+class DistributionRecordArgs(schema.Strict):
+ project: str = schema.Field(..., **example("example"))
+ version: str = schema.Field(..., **example("0.0.1"))
+ platform: sql.DistributionPlatform = schema.Field(...,
**example(sql.DistributionPlatform.ARTIFACT_HUB))
+ distribution_owner_namespace: str | None = schema.Field(default=None,
**example("example"))
+ distribution_package: str = schema.Field(..., **example("example"))
+ distribution_version: str = schema.Field(..., **example("0.0.1"))
+ staging: bool = schema.Field(..., **example(False))
+ details: bool = schema.Field(..., **example(False))
-class GithubSshRegisterResults(schema.Strict):
- endpoint: Literal["/github/ssh/register"] = schema.Field(alias="endpoint")
- fingerprint: str = schema.Field(...,
**example("SHA256:0123456789abcdef0123456789abcdef01234567"))
- project: str = schema.Field(..., **example("example"))
- expires: int = schema.Field(..., **example(1713547200))
+class DistributionRecordResults(schema.Strict):
+ endpoint: Literal["/distribution/record"] = schema.Field(alias="endpoint")
+ success: Literal[True] = schema.Field(..., **example(True))
class IgnoreAddArgs(schema.Strict):
@@ -211,6 +213,52 @@ class ProjectsListResults(schema.Strict):
projects: Sequence[sql.Project]
+class PublisherReleaseAnnounceArgs(schema.Strict):
+ publisher: str = schema.Field(..., **example("user"))
+ jwt: str = schema.Field(...,
**example("eyJhbGciOiJIUzI1[...]mMjLiuyu5CSpyHI="))
+ version: str = schema.Field(..., **example("0.0.1"))
+ revision: str = schema.Field(..., **example("00005"))
+ email_to: str = schema.Field(..., **example("[email protected]"))
+ subject: str = schema.Field(..., **example("[ANNOUNCE] Apache Example
1.0.0 release"))
+ body: str = schema.Field(
+ ...,
+ **example("The Apache Example team is pleased to announce the release
of Example 1.0.0..."),
+ )
+ path_suffix: str = schema.Field(..., **example("example/1.0.0"))
+
+
+class PublisherReleaseAnnounceResults(schema.Strict):
+ endpoint: Literal["/publisher/release/announce"] =
schema.Field(alias="endpoint")
+ success: Literal[True] = schema.Field(..., **example(True))
+
+
+class PublisherSshRegisterArgs(schema.Strict):
+ publisher: str = schema.Field(..., **example("user"))
+ jwt: str = schema.Field(...,
**example("eyJhbGciOiJIUzI1[...]mMjLiuyu5CSpyHI="))
+ ssh_key: str = schema.Field(
+ ..., **example("ssh-ed25519
AAAAC3NzaC1lZDI1NTEgH5C9okWi0dh25AAAAIOMqqnkVzrm0SdG6UOoqKLsabl9GKJl")
+ )
+
+
+class PublisherSshRegisterResults(schema.Strict):
+ endpoint: Literal["/publisher/ssh/register"] =
schema.Field(alias="endpoint")
+ fingerprint: str = schema.Field(...,
**example("SHA256:0123456789abcdef0123456789abcdef01234567"))
+ project: str = schema.Field(..., **example("example"))
+ expires: int = schema.Field(..., **example(1713547200))
+
+
+class PublisherVoteResolveArgs(schema.Strict):
+ publisher: str = schema.Field(..., **example("user"))
+ jwt: str = schema.Field(...,
**example("eyJhbGciOiJIUzI1[...]mMjLiuyu5CSpyHI="))
+ version: str = schema.Field(..., **example("0.0.1"))
+ resolution: Literal["passed", "failed"] = schema.Field(...,
**example("passed"))
+
+
+class PublisherVoteResolveResults(schema.Strict):
+ endpoint: Literal["/publisher/vote/resolve"] =
schema.Field(alias="endpoint")
+ success: Literal[True] = schema.Field(..., **example(True))
+
+
class ReleaseAnnounceArgs(schema.Strict):
project: str = schema.Field(..., **example("example"))
version: str = schema.Field(..., **example("1.0.0"))
@@ -434,7 +482,6 @@ Results = Annotated[
| CommitteeKeysResults
| CommitteeProjectsResults
| CommitteesListResults
- | GithubSshRegisterResults
| IgnoreAddResults
| IgnoreDeleteResults
| IgnoreListResults
@@ -447,6 +494,9 @@ Results = Annotated[
| ProjectGetResults
| ProjectReleasesResults
| ProjectsListResults
+ | PublisherReleaseAnnounceResults
+ | PublisherSshRegisterResults
+ | PublisherVoteResolveResults
| ReleaseAnnounceResults
| ReleaseCreateResults
| ReleaseDeleteResults
@@ -487,7 +537,6 @@ validate_committee_get = validator(CommitteeGetResults)
validate_committee_keys = validator(CommitteeKeysResults)
validate_committee_projects = validator(CommitteeProjectsResults)
validate_committees_list = validator(CommitteesListResults)
-validate_github_ssh_register = validator(GithubSshRegisterResults)
validate_ignore_add = validator(IgnoreAddResults)
validate_ignore_delete = validator(IgnoreDeleteResults)
validate_ignore_list = validator(IgnoreListResults)
@@ -500,6 +549,9 @@ validate_keys_user = validator(KeysUserResults)
validate_project_get = validator(ProjectGetResults)
validate_project_releases = validator(ProjectReleasesResults)
validate_projects_list = validator(ProjectsListResults)
+validate_publisher_release_announce =
validator(PublisherReleaseAnnounceResults)
+validate_publisher_ssh_register = validator(PublisherSshRegisterResults)
+validate_publisher_vote_resolve = validator(PublisherVoteResolveResults)
validate_release_announce = validator(ReleaseAnnounceResults)
validate_release_create = validator(ReleaseCreateResults)
validate_release_delete = validator(ReleaseDeleteResults)
diff --git a/src/atrclient/models/distribution.py
b/src/atrclient/models/distribution.py
new file mode 100644
index 0000000..2c54216
--- /dev/null
+++ b/src/atrclient/models/distribution.py
@@ -0,0 +1,126 @@
+# 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 datetime
+
+import pydantic
+
+from . import basic, schema, sql
+
+
+class ArtifactHubAvailableVersion(schema.Lax):
+ ts: int
+
+
+class ArtifactHubLink(schema.Lax):
+ url: str | None = None
+ name: str | None = None
+
+
+class ArtifactHubRepository(schema.Lax):
+ name: str | None = None
+
+
+class ArtifactHubResponse(schema.Lax):
+ available_versions: list[ArtifactHubAvailableVersion] =
pydantic.Field(default_factory=list)
+ home_url: str | None = None
+ links: list[ArtifactHubLink] = pydantic.Field(default_factory=list)
+ name: str | None = None
+ version: str | None = None
+ repository: ArtifactHubRepository | None = None
+
+
+class DockerResponse(schema.Lax):
+ tag_last_pushed: str | None = None
+
+
+class GitHubResponse(schema.Lax):
+ published_at: str | None = None
+ html_url: str | None = None
+
+
+class MavenDoc(schema.Lax):
+ timestamp: int | None = None
+
+
+class MavenResponseBody(schema.Lax):
+ start: int | None = None
+ docs: list[MavenDoc] = pydantic.Field(default_factory=list)
+
+
+class MavenResponse(schema.Lax):
+ response: MavenResponseBody =
pydantic.Field(default_factory=MavenResponseBody)
+
+
+class NpmResponse(schema.Lax):
+ name: str | None = None
+ time: dict[str, str] = pydantic.Field(default_factory=dict)
+ homepage: str | None = None
+
+
+class PyPIUrl(schema.Lax):
+ upload_time_iso_8601: str | None = None
+ url: str | None = None
+
+
+class PyPIInfo(schema.Lax):
+ release_url: str | None = None
+ project_url: str | None = None
+
+
+class PyPIResponse(schema.Lax):
+ urls: list[PyPIUrl] = pydantic.Field(default_factory=list)
+ info: PyPIInfo = pydantic.Field(default_factory=PyPIInfo)
+
+
+class DeleteData(schema.Lax):
+ release_name: str
+ platform: sql.DistributionPlatform
+ owner_namespace: str
+ package: str
+ version: str
+
+ @pydantic.field_validator("platform", mode="before")
+ @classmethod
+ def coerce_platform(cls, v: object) -> object:
+ if isinstance(v, str):
+ return sql.DistributionPlatform[v]
+ return v
+
+
+# Lax to ignore csrf_token and submit
+# WTForms types platform as Any, which is insufficient
+# And this way we also get nice JSON from the Pydantic model dump
+# Including all of the enum properties
+class Data(schema.Lax):
+ platform: sql.DistributionPlatform
+ owner_namespace: str | None = None
+ package: str
+ version: str
+ details: bool
+
+ @pydantic.field_validator("owner_namespace", mode="before")
+ @classmethod
+ def empty_to_none(cls, v):
+ return None if v is None or (isinstance(v, str) and v.strip() == "")
else v
+
+
+class Metadata(schema.Strict):
+ api_url: str
+ result: basic.JSON
+ upload_date: datetime.datetime
+ web_url: str | None
diff --git a/src/atrclient/models/sql.py b/src/atrclient/models/sql.py
index 7b79311..b178e62 100644
--- a/src/atrclient/models/sql.py
+++ b/src/atrclient/models/sql.py
@@ -659,10 +659,22 @@ Thanks,
return policy.github_repository_name
@property
- def policy_github_workflow_path(self) -> str:
+ def policy_github_compose_workflow_path(self) -> str:
if (policy := self.release_policy) is None:
return ""
- return policy.github_workflow_path
+ return policy.github_compose_workflow_path
+
+ @property
+ def policy_github_vote_workflow_path(self) -> str:
+ if (policy := self.release_policy) is None:
+ return ""
+ return policy.github_vote_workflow_path
+
+ @property
+ def policy_github_finish_workflow_path(self) -> str:
+ if (policy := self.release_policy) is None:
+ return ""
+ return policy.github_finish_workflow_path
# Release: Project ReleasePolicy Revision CheckResult
@@ -969,7 +981,9 @@ class ReleasePolicy(sqlmodel.SQLModel, table=True):
)
strict_checking: bool = sqlmodel.Field(default=False)
github_repository_name: str = sqlmodel.Field(default="")
- github_workflow_path: str = sqlmodel.Field(default="")
+ github_compose_workflow_path: str = sqlmodel.Field(default="")
+ github_vote_workflow_path: str = sqlmodel.Field(default="")
+ github_finish_workflow_path: str = sqlmodel.Field(default="")
# 1-1: ReleasePolicy -> Project
# 1-1: Project -C-> ReleasePolicy
diff --git a/uv.lock b/uv.lock
index 4834c61..84348b3 100644
--- a/uv.lock
+++ b/uv.lock
@@ -3,7 +3,7 @@ revision = 3
requires-python = ">=3.13"
[options]
-exclude-newer = "2025-09-04T14:46:00Z"
+exclude-newer = "2025-09-08T15:38:00Z"
[[package]]
name = "aiohappyeyeballs"
@@ -84,7 +84,7 @@ wheels = [
[[package]]
name = "apache-trusted-releases"
-version = "0.20250904.1446"
+version = "0.20250908.1538"
source = { editable = "." }
dependencies = [
{ name = "aiohttp" },
@@ -337,11 +337,11 @@ wheels = [
[[package]]
name = "identify"
-version = "2.6.13"
+version = "2.6.14"
source = { registry = "https://pypi.org/simple" }
-sdist = { url =
"https://files.pythonhosted.org/packages/82/ca/ffbabe3635bb839aa36b3a893c91a9b0d368cb4d8073e03a12896970af82/identify-2.6.13.tar.gz",
hash =
"sha256:da8d6c828e773620e13bfa86ea601c5a5310ba4bcd65edf378198b56a1f9fb32", size
= 99243, upload-time = "2025-08-09T19:35:00.6Z" }
+sdist = { url =
"https://files.pythonhosted.org/packages/52/c4/62963f25a678f6a050fb0505a65e9e726996171e6dbe1547f79619eefb15/identify-2.6.14.tar.gz",
hash =
"sha256:663494103b4f717cb26921c52f8751363dc89db64364cd836a9bf1535f53cd6a", size
= 99283, upload-time = "2025-09-06T19:30:52.938Z" }
wheels = [
- { url =
"https://files.pythonhosted.org/packages/e7/ce/461b60a3ee109518c055953729bf9ed089a04db895d47e95444071dcdef2/identify-2.6.13-py2.py3-none-any.whl",
hash =
"sha256:60381139b3ae39447482ecc406944190f690d4a2997f2584062089848361b33b", size
= 99153, upload-time = "2025-08-09T19:34:59.1Z" },
+ { url =
"https://files.pythonhosted.org/packages/e5/ae/2ad30f4652712c82f1c23423d79136fbce338932ad166d70c1efb86a5998/identify-2.6.14-py2.py3-none-any.whl",
hash =
"sha256:11a073da82212c6646b1f39bb20d4483bfb9543bd5566fec60053c4bb309bf2e", size
= 99172, upload-time = "2025-09-06T19:30:51.759Z" },
]
[[package]]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]