ci: match paired branch by fork account, fall back to Postgres-Extensions master only#25
Conversation
The resolve step and run-tests.yml checkouts hardcoded github.repository_owner (Postgres-Extensions) when locating the sibling pgxntool branch. For a fork PR the paired branch lives on the fork, so resolve never found it and tested against the wrong (unpaired) pgxntool — which is why fix-38's CI failed. Now: - resolve looks for the paired pgxntool branch ONLY on the PR head's account (github.event.pull_request.head.repo.owner.login) — never cross-account. - No paired branch -> fall back to Postgres-Extensions/master ONLY, never a fork's master (possibly stale/modified). master is the sole cross-account ref. - run-tests.yml gains pgxntool-owner / pgxntool-test-owner inputs (default to the repo owner) so each repo is checked out from the correct account. - Document the pairing + never-cross-account rules in workflows/CLAUDE.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughCI now pairs repositories using both branch name and GitHub account. The resolve job emits the selected Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PullRequest
participant ResolveJob
participant TestJob
participant RunTests
participant GitHub
PullRequest->>ResolveJob: Provide branch and head owner
ResolveJob->>GitHub: Check branch within head owner
GitHub-->>ResolveJob: Matching branch or master fallback
ResolveJob->>TestJob: Pass pgxntool ref and owner
TestJob->>RunTests: Pass pgxntool and pgxntool-test owners
RunTests->>GitHub: Checkout both repositories
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The CI now pairs branches by name AND account (never cross-account). Update the "CI and Contributing" section accordingly: paired branches must share a name and live on the same account (your fork), and add a fork-contributor security note — no paired branch means the other repo comes from Postgres-Extensions/master only, never a fork's master. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This reverts commit 0207c65.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 56-65: Update the branch status messages in the resolve step to
match run-tests.yml’s `pgxntool=… pgxntool-test=…` ordering and values. Report
pgxntool using the resolved owner/ref, while identifying pgxntool-test as `${{
github.repository_owner }}` at `${{ github.sha }}` in both the paired-branch and
fallback cases.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 42344fd8-06c3-49d3-b308-00e280129959
📒 Files selected for processing (4)
.github/workflows/CLAUDE.md.github/workflows/ci.yml.github/workflows/run-tests.ymlREADME.md
Address CodeRabbit review on Postgres-Extensions#25: the resolve step's `=== BRANCHES:` line flipped the field order vs run-tests.yml and reported pgxntool-test as ${HEAD_OWNER}/${BRANCH}, though the test checkout is actually the base repo at the merge SHA. Both lines now use the same shape — `pgxntool=<owner>/<ref> pgxntool-test=<owner>/<ref>`, pgxntool first — with accurate values on each side. (monitor-ci.sh reads the resolve job's line, so accuracy matters.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The "CI and Contributing" section called pgxntool-test-only commits "normal and common" and framed both-repo changes as conditional. Reframe: a paired change (matching branch + account in both repos) is the norm; pgxntool changes are effectively required to be paired; a pgxntool-test-only change is the occasional exception. Neither repo should be changed in isolation as a matter of routine. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pairs with pgxntool-test PR: Postgres-Extensions/pgxntool-test#25 ## Problem CI resolved the paired sibling branch using `github.repository_owner` (Postgres-Extensions), so a **fork PR** never found its paired branch (which lives on the fork) and tested against the wrong, unpaired code. This is what made the fix-38 PRs' CI fail: pgxntool-test's resolve looked for the pgxntool branch on Postgres-Extensions, didn't find it (it was on the fork), fell back to `pgxntool=master`, and master lacked the paired change. ## This PR (pgxntool side) When pgxntool runs its own tests (`commit-with-no-tests` or master-to-master), pass explicit owners to `run-tests.yml`: - `pgxntool-owner` = this PR's head account (the fork for fork PRs) - `pgxntool-test-owner` = `Postgres-Extensions` (canonical master only — never a fork's master) The matching resolve/owner logic and the `pgxntool-owner`/`pgxntool-test-owner` inputs on `run-tests.yml` are in the paired pgxntool-test PR. **Merge order:** pgxntool-test first (so `run-tests.yml@master` gains the owner inputs), then this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
f0fe443
into
Postgres-Extensions:master
Pairs with pgxntool PR: Postgres-Extensions/pgxntool#40
Problem
The
resolvestep (andrun-tests.ymlcheckouts) hardcodedgithub.repository_owner(Postgres-Extensions) when locating the siblingpgxntool branch. For a fork PR, the paired branch is on the fork, so resolve
never found it and tested against unpaired code. (This is why fix-38's CI failed
against
pgxntool=master.)Fix
resolvenow looks for the paired pgxntool branch only on the PR head'saccount (
head.repo.owner.login) — never cross-account.Postgres-Extensions/masteronly, never the fork's master (which may be stale or modified).
masteristhe sole ref ever taken cross-account.
run-tests.ymlgainspgxntool-owner/pgxntool-test-ownerinputs(default to the repo owner) so each repo is checked out from the right account.
workflows/CLAUDE.md.Pairing model (now enforced by account): a pgxntool change needs a paired
pgxntool-test branch (or the
commit-with-no-testsoverride); a pgxntool-testchange may stand alone and falls back to pgxntool master.
Merge order: merge this first (so
run-tests.yml@mastergains the ownerinputs), then the pgxntool PR.
🤖 Generated with Claude Code