Skip to content

Pin every generated GitHub PR to an explicit base repository - #327

Merged
trillium merged 3 commits into
mainfrom
fm/fix-pr-base-repo-pin
Nov 5, 2026
Merged

trillium merged 3 commits into
mainfrom
fm/fix-pr-base-repo-pin

Conversation

@trillium

@trillium trillium commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

A fork clone with an upstream remote and no gh default repository made a bare gh pr create open its PR on the third-party upstream, because gh ranks upstream above origin.
Every generated brief that opens a GitHub PR now names the exact PR base repository and requires --repo <owner>/<repo> on every gh-axi pr command (create, list, view, checks, ready, edit, merge).

  • The target is the recorded upstream-consent repository when there is one, otherwise the project clone's origin.
  • A brief or promotion refuses when the target cannot be derived; local-only, gerrit, forgejo and external forges are untouched.
  • Scout promotion renders the same contract from the single owner in bin/fm-dod-lib.sh.
  • No git or gh configuration is written into project clones.
  • Builds on the one-line origin hint from the earlier direct-PR pin; this extends it to no-mistakes and promotion, makes the flag explicit, and adds the refusal.

Visual evidence

Behavior in plain words: before, a ship brief told the worker to open a PR with a bare command, so gh picked the upstream fork parent; after, the brief hands the worker the exact repository and the worker passes it on every PR command.

flowchart LR
  subgraph Before
    A1[ship brief] --> B1["gh pr create (no repo)"] --> C1[gh ranks upstream above origin] --> D1[PR opens on kcosr/herdr-web]
  end
  subgraph After
    A2[ship brief] --> B2{consent target?}
    B2 -- yes --> C2[consent repo]
    B2 -- no --> C3[clone origin repo]
    C2 --> E2["gh-axi pr create --repo owner/repo"]
    C3 --> E2
    B2 -- cannot derive --> F2[brief refuses]
  end
Loading

Testing

  • New tests: fork clone with an upstream remote names origin; upstream-consent task names the consent target; refusal without a derivable origin; promotion pins the same repository.
  • Existing fixtures now seed a clone with a GitHub origin.
  • bin/fm-lint.sh is clean.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: da43ccd7-91c8-409a-9521-29c6d49c5e57
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@trillium
trillium force-pushed the fm/fix-pr-base-repo-pin branch from 1178c9c to 171795e Compare November 5, 2026 03:31
@trillium
trillium force-pushed the fm/fix-pr-base-repo-pin branch from 171795e to 94f0097 Compare November 5, 2026 10:07
@trillium
trillium merged commit 1e42851 into main Nov 5, 2026
27 checks passed
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