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 58dc373  Add API endpoints for committees and project releases
58dc373 is described below

commit 58dc37300758ba8d08d182fd424e9f3000382280
Author: Sean B. Palmer <[email protected]>
AuthorDate: Wed Jul 2 17:21:19 2025 +0100

    Add API endpoints for committees and project releases
---
 atr/blueprints/api/api.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/atr/blueprints/api/api.py b/atr/blueprints/api/api.py
index b874b89..b2d775b 100644
--- a/atr/blueprints/api/api.py
+++ b/atr/blueprints/api/api.py
@@ -44,6 +44,15 @@ class Pagination:
 # We implicitly have /api/openapi.json
 
 
[email protected]("/committees")
+@quart_schema.validate_response(list[models.Committee], 200)
+async def committees() -> tuple[list[Mapping], int]:
+    """List all committees in the database."""
+    async with db.session() as data:
+        committees = await data.committee().all()
+        return [committee.model_dump() for committee in committees], 200
+
+
 @api.BLUEPRINT.route("/projects")
 @quart_schema.validate_response(list[models.Committee], 200)
 async def projects() -> tuple[list[Mapping], int]:
@@ -61,6 +70,14 @@ async def projects_name(name: str) -> tuple[Mapping, int]:
         return committee.model_dump(), 200
 
 
[email protected]("/projects/<name>/releases")
+@quart_schema.validate_response(list[models.Release], 200)
+async def projects_name_releases(name: str) -> tuple[list[Mapping], int]:
+    async with db.session() as data:
+        releases = await data.release(project_name=name).all()
+        return [release.model_dump() for release in releases], 200
+
+
 @api.BLUEPRINT.route("/tasks")
 @quart_schema.validate_querystring(Pagination)
 async def tasks(query_args: Pagination) -> quart.Response:


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to