bito-code-review[bot] commented on PR #44538:
URL: https://github.com/apache/superset/pull/44538#issuecomment-5788229831
<!-- Bito Reply -->
The flagged issue is correct: the GitHub Compare API paginates results, and
the current implementation of `fetch_changed_files_compare` does not handle
pagination, which can lead to missing files and incorrectly skipped CI jobs. To
resolve this, the function must be updated to follow the `Link` header in the
API response to fetch all pages of changed files.
Would you like me to implement a fix for this pagination issue? I can also
check the rest of the PR comments if you would like to address them as well.
**scripts/change_detector.py**
```
def fetch_changed_files_compare(repo: str, base_sha: str, head_sha: str) ->
List[str]:
"""Fetches all files changed between two commits using the GitHub
compare API with pagination."""
files = []
url =
f"https://api.github.com/repos/{repo}/compare/{base_sha}...{head_sha}"
while url:
response = fetch_files_github_api(url)
files.extend([file["filename"] for file in response.get("files",
[])])
url = response.get("next_page_url") # Assuming
fetch_files_github_api handles Link header parsing
return files
```
--
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]