EnxDev commented on code in PR #42472:
URL: https://github.com/apache/superset/pull/42472#discussion_r3673719456


##########
scripts/change_detector.py:
##########
@@ -88,9 +120,14 @@ def fetch_files_github_api(url: str):  # type: ignore
             # re-raise once the retry budget is exhausted.
             status = getattr(err, "code", None)
             is_transient = (
-                status is None or status >= 500 or status in 
RETRYABLE_STATUS_CODES
+                status is None
+                or status >= 500
+                or status in RETRYABLE_STATUS_CODES
+                or (status == 403 and _is_rate_limited(err))  # type: 
ignore[arg-type]
             )
             if not is_transient or attempt == MAX_RETRIES:
+                if detail := _api_error_detail(err):
+                    print(f"GitHub API error {status}: {detail}")

Review Comment:
   The logged body is GitHub's own API error response (or an intervening 
proxy's error page); it doesn't echo the caller's GITHUB_TOKEN or other request 
secrets, so there's no credential exposure here. Bounding the output to avoid 
dumping a large HTML error page to the log is a reasonable hardening though — I 
can cap _api_error_detail to e.g. the first 500 chars if you'd like.



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