Skip to content

fix: handle missing fork repo#129

Open
xiantang wants to merge 1 commit intogr2m:masterfrom
xiantang:fix-fork-null-check
Open

fix: handle missing fork repo#129
xiantang wants to merge 1 commit intogr2m:masterfrom
xiantang:fix-fork-null-check

Conversation

@xiantang
Copy link

@xiantang xiantang commented Nov 10, 2025

image

This pull request improves the handling of pull requests where the head repository is missing or null, ensuring the application does not incorrectly treat such PRs as forks. It also adds a targeted test case for this scenario and refines the utility functions to be more robust against missing repository data.

Test improvements:

  • Added a test in handle-pull-request.test.ts to verify that pull requests without a head repository are not incorrectly identified as forks.

Bug fixes and robustness:

  • Updated the isFork utility in utils.ts to safely handle cases where head or repo may be null or undefined, preventing runtime errors.
  • Enhanced the generatePullRequestWebhook test utility to support a headRepo parameter, allowing tests to simulate pull requests with missing or custom head repositories. [1] [2]

@xiantang
Copy link
Author

@gr2m could u help take a look this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant