Use the tracked organization-owned fork as the pull request head
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend-api-design, cli
Direzione di ricerca
Look at the pr create command implementation, likely in pkg/cmd/pr/create/create.go. Understand how the --head flag is parsed and how the compare URL is built for the --web flow. The GitHub compare syntax OWNER:REPOSITORY:BRANCH needs to be integrated. Check existing tests for pr create to see how to add scenarios for organization-owned forks.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the feature or problem you’d like to solve
An organization can own more than one fork that could supply a pull request branch. An organization and branch alone are therefore not always enough to identify the contributor’s intended head repository.
As a contributor working in an organization with multiple forks, I want to identify the exact head repository, so that the pull request is created from the fork I intended.
Proposed solution
Allow gh pr create --head ORGANIZATION/REPOSITORY:BRANCH to identify the exact organization-owned head repository. When --web is used, translate that value into GitHub’s repository-qualified compare syntax so the pull request form opens with the intended head repository and branch selected.
Feature: Choose a specific organization-owned fork as the pull request head
Scenario: The selected fork belongs to another organization
Given the base repository is "org/upstream"
And "other-org/upstream-fork" is a fork of the base repository
When the contributor runs `gh pr create --head other-org/upstream-fork:feature-branch`
Then a pull request is created from "other-org/upstream-fork:feature-branch"
And the pull request targets "org/upstream"
Scenario: The selected fork belongs to the same organization as the base repository
Given the base repository is "org/upstream"
And "org/upstream-fork" is a fork of the base repository
When the contributor runs `gh pr create --head org/upstream-fork:feature-branch`
Then a pull request is created from "org/upstream-fork:feature-branch"
And the pull request targets "org/upstream"
Scenario: The organization owns multiple candidate forks
Given the base repository is "org/upstream"
And "org/upstream-fork" is a fork of the base repository
And "org/experimental-upstream-fork" is a fork of the base repository
When the contributor runs `gh pr create --head org/upstream-fork:feature-branch`
Then a pull request is created from "org/upstream-fork:feature-branch"
And the pull request targets "org/upstream"
Scenario: Repository-qualified head is used with web mode
Given the base repository is "org/upstream"
And "other-org/upstream-fork" is a fork of the base repository
When the contributor runs `gh pr create --head other-org/upstream-fork:feature-branch --web`
Then GitHub’s pull request form opens for "org/upstream"
And "other-org/upstream-fork" is selected as the head repository
And "feature-branch" is selected as the head branch
Additional context
This is a sub-issue of #10093.
GitHub’s compare flow represents an exact fork as OWNER:REPOSITORY:BRANCH. For example, other-org/upstream-fork:feature-branch can be rendered in the compare URL as other-org:upstream-fork:feature-branch.
Supporting evidence:
- GitHub Docs: comparing commits across forks
- GitHub Docs issue documenting the repository-qualified compare syntax
- GitHub Docs change adding the syntax
The syntax is documented for GHES 3.10 and newer. All currently supported GHES versions are newer than that; the exact implementation floor for older, unsupported GHES releases is unknown.
- Lingua principale
- Go
- Stelle
- 46.3k
- Fork
- 9.1k
- Merge medio
- 1g 7h
- PR unite (30g)
- 76
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cli/cli
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
more-info-needed needs-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
-
bug gh-pr priority-2
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
bug gh-pr priority-2
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
bug gh-auth priority-3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Issue simili
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
microsoft/agent-framework-go#1179 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
[Bug]: OLLAMA_KEEP_ALIVE="5m" / "24h" crashes Ollama embedding and vision models with ValueError Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
infiniflow/ragflow#20223 · 1 reazione ·
-
bug needs triage pkg/translator/faro
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
open-telemetry/opentelemetry-collector-contrib#51484 · 1 commento ·