sbp commented on code in PR #337:
URL: 
https://github.com/apache/tooling-trusted-releases/pull/337#discussion_r2550446800


##########
atr/svn/pubsub.py:
##########
@@ -54,24 +55,49 @@ async def start(self) -> None:
         """Run forever, processing PubSub payloads as they arrive."""
         # TODO: Add reconnection logic here?
         # Or does asfpy.pubsub.listen() already do this?
-        log.info("SVNListener.start() called")
-        async for payload in asfpy.pubsub.listen(
-            # TODO: Upstream this change to BAT
-            urllib.parse.urljoin(self.url, self.topics),
-            username=self.username,
-            password=self.password,
-        ):
-            if (payload is None) or ("stillalive" in payload):
-                continue
+        if not self.url:
+            log.error("PubSub URL is not configured")
+            log.warning("SVNListener disabled: no URL provided")
+            return
 
-            pubsub_path = str(payload.get("pubsub_path", ""))
-            if not pubsub_path.startswith(_WATCHED_PREFIXES):
-                # Ignore commits outside dist/dev or dist/release
-                continue
+        if not self.username or not self.password:
+            log.error("PubSub credentials not configured")
+            log.warning("SVNListener disabled: missing credentials")
+            return
+
+        if not self.url.startswith(("http://";, "https://";)):
+            log.error(
+                "Invalid PubSub URL: %r. Expected full URL like 
'https://pubsub.apache.org:2069'",
+                self.url,
+            )
+            log.warning("SVNListener disabled due to invalid URL")
+            return
+
+        full_url = urllib.parse.urljoin(self.url, self.topics)
+        log.info("SVNListener starting with URL: %s", full_url)

Review Comment:
   I've [documented the f-string 
convention](https://github.com/apache/tooling-trusted-releases/commit/1406cebaaf3c075497441179884e40a3e4429949).



-- 
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]


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

Reply via email to