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-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new f177e1b  Ensure that files are moved before announcements are sent
f177e1b is described below

commit f177e1b34e2d85adeaa8ed3ed9929bb49167f9cf
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Nov 7 15:25:14 2025 +0000

    Ensure that files are moved before announcements are sent
---
 atr/storage/writers/announce.py | 52 +++++++++++++++++++++--------------------
 1 file changed, 27 insertions(+), 25 deletions(-)

diff --git a/atr/storage/writers/announce.py b/atr/storage/writers/announce.py
index 9506aef..fb6c72a 100644
--- a/atr/storage/writers/announce.py
+++ b/atr/storage/writers/announce.py
@@ -160,30 +160,6 @@ class CommitteeMember(CommitteeParticipant):
         if preserve is True:
             await self.__hard_link_downloads(committee, unfinished_path, 
download_path_suffix, dry_run=True)
 
-        try:
-            task = sql.Task(
-                status=sql.TaskStatus.QUEUED,
-                task_type=sql.TaskType.MESSAGE_SEND,
-                task_args=message.Send(
-                    email_sender=f"{asf_uid}@apache.org",
-                    email_recipient=recipient,
-                    subject=subject,
-                    body=body,
-                    in_reply_to=None,
-                ).model_dump(),
-                asf_uid=asf_uid,
-                project_name=project_name,
-                version_name=version_name,
-            )
-            self.__data.add(task)
-
-            await self.__promote_in_database(release, preview_revision_number, 
release_date)
-            await self.__data.commit()
-        except storage.AccessError as e:
-            raise e
-        except Exception as e:
-            raise storage.AccessError(f"Error announcing preview: {e!s}")
-
         # Ensure that the permissions of every directory are 755
         await asyncio.to_thread(util.chmod_directories, unfinished_path)
 
@@ -205,7 +181,7 @@ class CommitteeMember(CommitteeParticipant):
                 # This removes all of the prior revisions
                 await aioshutil.rmtree(str(unfinished_revisions_path))  # 
type: ignore[call-arg]
         except Exception as e:
-            raise storage.AccessError(f"Database updated, but error moving 
files: {e!s}. Manual cleanup needed.")
+            raise storage.AccessError(f"Error moving files: {e!s}")
 
         # TODO: Add an audit log entry here
         # TODO: We should consider copying the files instead of hard linking
@@ -217,6 +193,32 @@ class CommitteeMember(CommitteeParticipant):
             preserve=preserve,
         )
 
+        try:
+            task = sql.Task(
+                status=sql.TaskStatus.QUEUED,
+                task_type=sql.TaskType.MESSAGE_SEND,
+                task_args=message.Send(
+                    email_sender=f"{asf_uid}@apache.org",
+                    email_recipient=recipient,
+                    subject=subject,
+                    body=body,
+                    in_reply_to=None,
+                ).model_dump(),
+                asf_uid=asf_uid,
+                project_name=project_name,
+                version_name=version_name,
+            )
+            self.__data.add(task)
+
+            await self.__promote_in_database(release, preview_revision_number, 
release_date)
+            await self.__data.commit()
+        except storage.AccessError as e:
+            raise e
+        except Exception as e:
+            raise storage.AccessError(
+                f"Files moved successfully, but error queuing announcement: 
{e!s}. Manual cleanup needed."
+            )
+
     async def __hard_link_downloads(
         self,
         committee: sql.Committee,


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

Reply via email to