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 d3e07f8  Promote candidate release files as well as metadata
d3e07f8 is described below

commit d3e07f811092759c7fd9669c0ef4783d7a469406
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Mar 28 14:50:38 2025 +0200

    Promote candidate release files as well as metadata
---
 atr/routes/candidate.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/atr/routes/candidate.py b/atr/routes/candidate.py
index f83e14b..2c6f714 100644
--- a/atr/routes/candidate.py
+++ b/atr/routes/candidate.py
@@ -17,6 +17,8 @@
 
 """candidate.py"""
 
+import aiofiles.os
+import aioshutil
 import asfquart
 import asfquart.base as base
 import quart
@@ -285,4 +287,11 @@ async def _resolve_post(session: routes.CommitterSession) 
-> response.Response:
 
             await data.commit()
 
+    # TODO: Obtain a lock for this
+    source = str(util.get_release_candidate_dir() / project_name / 
release.version)
+    target = str(util.get_release_preview_dir() / project_name / 
release.version)
+    if await aiofiles.os.path.exists(target):
+        return await session.redirect(resolve, error="Release already exists")
+    await aioshutil.move(source, target)
+
     return await session.redirect(resolve, success=success_message)


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

Reply via email to