Skip to content

fix(bin): read cross-repo PR checks from the head repository - #27

Closed
mehulbhagwani wants to merge 1 commit into
upstream-mainfrom
fm/fm-5796-cross-repo-checks
Closed

mehulbhagwani wants to merge 1 commit into
upstream-mainfrom
fm/fm-5796-cross-repo-checks

Conversation

@mehulbhagwani

Copy link
Copy Markdown
Owner

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.sh now 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.sh adds 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.

  • Live validation: ⚠️ inconclusive - 0 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Cross-repo PR: check-runs and statuses are read from the head repo, not the base ⏸️ untested no The prior payload only ran the script against a forge stub (tests/fm-contributions.test.sh), not a live GitHub fork PR, so it did not establish a live result. Running it live needs access to a real Gi…
Existing contribution observation behaviors (budget, dedupe, settle, failure episodes) still work after the rebase ⏸️ untested no The prior payload only ran the test suite against a forge stub, not the real forge, so it did not establish a live result. Running it live needs a real forge to observe.
  • Outcome: ⚠️ 1 warning across 1 run (9m49s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⚠️ **Rebase** - 1 warning
  • ⚠️ 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.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (0 of 2 scenarios were driven live against the product); untested: Cross-repo PR: check-runs and statuses are read from the head repo, not the base, Existing contribution observation behaviors (budget, dedupe, settle, failure episodes) still work after the rebase
  • Live validation: ⚠️ inconclusive - 0 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Cross-repo PR: check-runs and statuses are read from the head repo, not the base ⏸️ untested no The prior payload only ran the script against a forge stub (tests/fm-contributions.test.sh), not a live GitHub fork PR, so it did not establish a live result. Running it live needs access to a real Gi…
Existing contribution observation behaviors (budget, dedupe, settle, failure episodes) still work after the rebase ⏸️ untested no The prior payload only ran the test suite against a forge stub, not the real forge, so it did not establish a live result. Running it live needs a real forge to observe.
  • 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.

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