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-trusted-release.git
The following commit(s) were added to refs/heads/main by this push:
new 32885ba Add documentation for all of the checks API endpoints
32885ba is described below
commit 32885ba37877696cb880bee1765f86cad17b1b89
Author: Sean B. Palmer <[email protected]>
AuthorDate: Mon Jul 28 19:35:02 2025 +0100
Add documentation for all of the checks API endpoints
---
atr/blueprints/api/api.py | 25 +++++++++++++++++++++----
atr/models/sql.py | 6 +++---
2 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/atr/blueprints/api/api.py b/atr/blueprints/api/api.py
index 6032cbb..3aaf4f8 100644
--- a/atr/blueprints/api/api.py
+++ b/atr/blueprints/api/api.py
@@ -105,7 +105,7 @@ async def announce_post(data: models.api.AnnounceArgs) ->
DictResponse:
@quart_schema.validate_response(models.api.ChecksListResults, 200)
async def checks_list(project: str, version: str) -> DictResponse:
"""
- List all of the check results for a release.
+ List all of the check results for the latest revision of a release.
Checks are only conducted during the compose a draft phase. This endpoint
only returns the checks for the most recent draft revision. Once a release
@@ -144,7 +144,17 @@ async def checks_list(project: str, version: str) ->
DictResponse:
@api.BLUEPRINT.route("/checks/list/<project>/<version>/<revision>")
@quart_schema.validate_response(models.api.ChecksListResults, 200)
async def checks_list_revision(project: str, version: str, revision: str) ->
DictResponse:
- """List all check results for a specific revision of a release."""
+ """
+ List all of the check results for a specific revision of a release.
+
+ Checks are only conducted during the compose a draft phase. This endpoint
+ only returns the checks for the specified draft revision. Once a release
+ has been promoted to the vote phase or beyond, the checks returned are
+ still those for the specified revision from the compose phase.
+
+ Warning: the check results include results for archive members, so there
+ may potentially be thousands or results or more.
+ """
_simple_check(project, version, revision)
async with db.session() as data:
project_result = await data.project(name=project).get()
@@ -169,7 +179,7 @@ async def checks_list_revision(project: str, version: str,
revision: str) -> Dic
).model_dump(), 200
[email protected]("/checks/ongoing/<project>/<version>")
[email protected]("/checks/ongoing/<project>/<version>",
defaults={"revision": None})
@api.BLUEPRINT.route("/checks/ongoing/<project>/<version>/<revision>")
@quart_schema.validate_response(models.api.ChecksOngoingResults, 200)
async def checks_ongoing(
@@ -177,7 +187,14 @@ async def checks_ongoing(
version: str,
revision: str | None = None,
) -> DictResponse:
- """Return a count of all unfinished check results for a given release."""
+ """
+ Count the unfinished check results for a specifed or latest revision of a
release.
+
+ Checks are only conducted during the compose a draft phase. This endpoint
+ returns the number of ongoing checks for the specified draft revision if
+ present, or the most recent draft revision otherwise. A draft release
+ cannot be promoted to the vote phase if checks are still ongoing.
+ """
_simple_check(project, version, revision)
ongoing_tasks_count, _latest_revision = await
interaction.tasks_ongoing_revision(project, version, revision)
# TODO: Is there a way to return just an int?
diff --git a/atr/models/sql.py b/atr/models/sql.py
index b224a5e..eb2548c 100644
--- a/atr/models/sql.py
+++ b/atr/models/sql.py
@@ -657,19 +657,19 @@ class CheckResult(sqlmodel.SQLModel, table=True):
# M-1: CheckResult -> Release
# 1-M: Release -C-> [CheckResult]
- release_name: str = sqlmodel.Field(foreign_key="release.name",
ondelete="CASCADE")
+ release_name: str = sqlmodel.Field(foreign_key="release.name",
ondelete="CASCADE", **example("example-0.0.1"))
release: Release = sqlmodel.Relationship(back_populates="check_results")
# We don't call this latest_revision_number, because it might not be the
latest
revision_number: str | None = sqlmodel.Field(default=None, index=True,
**example("00005"))
- checker: str =
sqlmodel.Field(**example("atr.tasks.checks.hashing.HashingCheck"))
+ checker: str = sqlmodel.Field(**example("atr.tasks.checks.license.files"))
primary_rel_path: str | None = sqlmodel.Field(
default=None, index=True,
**example("apache-example-0.0.1-source.tar.gz")
)
member_rel_path: str | None = sqlmodel.Field(default=None, index=True,
**example("apache-example-0.0.1/pom.xml"))
created: datetime.datetime = sqlmodel.Field(
sa_column=sqlalchemy.Column(UTCDateTime),
- **example(datetime.datetime(2025, 1, 1, 12, 0, 0,
tzinfo=datetime.UTC)),
+ **example(datetime.datetime(2025, 5, 1, 1, 2, 3, tzinfo=datetime.UTC)),
)
status: CheckResultStatus =
sqlmodel.Field(default=CheckResultStatus.SUCCESS,
**example(CheckResultStatus.SUCCESS))
message: str = sqlmodel.Field(**example("sha512 matches for
apache-example-0.0.1/pom.xml"))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]