fix(bin): read cross-repo PR checks from the head repository - #27
Closed
mehulbhagwani wants to merge 1 commit into
Closed
mehulbhagwani wants to merge 1 commit into
mehulbhagwani wants to merge 1 commit into
Conversation
fm-contributions.sh queried check-runs and commit statuses against the PR's base repository, even when the head commit only exists on a fork. GitHub's commits API silently returns zero results for a SHA it cannot resolve in that repository, so a cross-repo PR was observed as having no checks at all. Read .head.repo.full_name from the PR core response and query check-runs and statuses there instead, falling back to the base repository when the head repo is absent (a deleted fork).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Upstream PR kunchenguid#5919 (fix(bin): read cross-repo PR checks from the head repository; routes fm-contributions check-run and status lookups to the PR's head repo with a base-repo fallback) was reviewed by Kun's firstmate as restore-class, aligned with every VISION.md rule, and approved to merge once CI was green. CI is now fully green, but Kun's main moved and the PR is now CONFLICTING. The older sibling PR kunchenguid#5796 is already closed.
Rebase and close
Validate them via no mistakes and end it at that stage where we are waiting for him to merge while we get approval by him bot that it is accepted, there are more messages
What Changed
bin/fm-contributions.shnow routes check-run and commit-status lookups to the PR's head repository, with a fallback to the base repository. Checks for cross-repo (fork) PRs are no longer read from the wrong repo.tests/fm-contributions.test.shadds coverage for the head-repository routing, including the base-repo fallback.Risk Assessment
✅ Low: The change is a small, well-bounded routing fix in fm-contributions.sh with a safe base-repo fallback and matching tests; I found no defects.
Testing
I ran the fm-contributions test suite, which drives bin/fm-contributions.sh against a stubbed forge. It passed with no failures, including the new cross-repo head-repository case. I did not exercise a real GitHub fork PR, so no live result was established.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
tests/fm-contributions.test.sh- merge conflict rebasing onto refs/remotes/no-mistakes-push/fm/fm-5796-cross-repo-checks✅ **Review** - passed
✅ No issues found.
bash tests/fm-contributions.test.sh(full file, exit 0, no 'not ok' lines, including the head-repo routing case), run against a stubbed forge✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.