Skip to content

fix: CI file change detector to handle large PRs - #33092

Merged
mistercrunch merged 1 commit into
masterfrom
fix_change_detector
Apr 12, 2025
Merged

mistercrunch merged 1 commit into
masterfrom
fix_change_detector

Conversation

@mistercrunch

Copy link
Copy Markdown
Member

Improve our change detector. The way it works currently, we do a simple call to the github API to fetch the list of files that have changed in the PR, so that we can see if we should trigger cetain jobs. Now it appears that the particular endpoint we use returns a max of 30 results by call, unless we specify the ?per_page=100 argument.

Now I'm a bit lazy and didn't want to implement paging, so instead I'm resorting to fetching 100, and if/when we see 100, we assume that we should trigger all checks.

Why not paging?

  • i'm lazy, and we should probably use a proper github client instead of re-implementing paging, and that'd require a bit more time/effort
  • triggering everything if we have 100 files is fine, maybe super occasionally we'll trigger a bit more work than necessary (large frontend-only refactor, large backend-only refactor, ...) but I think that's fine

@korbit-ai korbit-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Performance Inefficient CI Check Triggering ▹ view 🧠 Not in standard
Files scanned ​
File Path Reviewed
scripts/change_detector.py ✅

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • On any given comment that Korbit raises on your pull request, you can have a discussion with Korbit by replying to the comment.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Feedback and Support

# NOTE: as noted above, we assume that if 100 files are touched, we should
# trigger all checks. This is a workaround for the GitHub API limit of 100
# files. Using >= 99 because off-by-one errors are not uncommon
if changed or len(files) >= 99:

This comment was marked as resolved.

@mistercrunch

Copy link
Copy Markdown
Member Author

Blocked by errors in master, might try to tackle if no one else is on it already...

Improve our change detector. The way it works currently, we do a simple call to the github API to fetch the list of files that have changed in the PR, so that we can see if we should trigger cetain jobs. Now it appears that the particular endpoint we use returns a max of 30 results by call, unless we specify the `?per_page=100` argument.

Now I'm a bit lazy and didn't want to implement paging, so instead I'm resorting to fetching 100, and if/when we see 100, we assume that we should trigger all checks.

Why not paging?
- i'm lazy, and we should probably use a proper github client instead of re-implementing paging, and that'd require a bit more time/effort
- triggering everything if we have 100 files is fine, maybe super occasionally we'll trigger a bit more work than necessary (large frontend-only refactor, large backend-only refactor, ...) but I think that's fine
@mistercrunch
mistercrunch merged commit ac4df8d into master Apr 12, 2025
@mistercrunch
mistercrunch deleted the fix_change_detector branch April 12, 2025 19:08
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants