alitheg commented on code in PR #1561:
URL: 
https://github.com/apache/tooling-trusted-releases/pull/1561#discussion_r3915919966


##########
atr/storage/writers/release.py:
##########
@@ -1773,6 +1820,119 @@ async def finalise_published_release(self, task_args: 
args.ReleaseFinalise) -> r
             message=message,
         )
 
+    async def unpublish_from_svn_execute(self, task_args: args.SvnUnpublish) 
-> results.SvnUnpublish:
+        # A None suffix means the release published to the committee dist 
root, not
+        # that there's nothing to do - the files to remove come from the 
artifact
+        # records, and the suffix only fixes the fallback directory.
+        suffix = task_args.download_path_suffix
+        publish_url = config.get().SVN_PUBLISH_URL
+        if not publish_url:
+            # The publish target went away between queuing and running, so fail
+            # cleanly rather than let the URL builder raise a bare ValueError.
+            raise datatypes.FailedError("SVN_PUBLISH_URL is not configured")
+        release = await self.__data.release(
+            project_key=str(task_args.project_key),
+            version=str(task_args.version_key),
+            _committee=True,
+        ).demand(datatypes.FailedError("Archived release not found for 
removal"))
+        committee = release.committee
+        if committee is None:
+            raise datatypes.FailedError("Release has no committee - Invalid 
state")
+
+        # The removal undoes the publish: take out only the files ATR recorded 
for this
+        # release - the artifact, its signature, checksum and SBOM - grouped 
under the
+        # directory each lives in. A directory the release owns outright is 
taken whole,
+        # which clears its files, any subdirectories and the emptied directory 
in one
+        # action; the committee's shared dist root only ever gives up our own 
files.

Review Comment:
   Aha I didn't think of files that aren't artifacts. I'll use the attestable 
data's snapshot of the paths



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to