github / github/codespaces-react

## Pull request overview

Offen
#219 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
547
Forks
1.2k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Pull request overview

This pull request adds a clear signal for extension authors to detect when their program is being invoked by `gh` (vs executed directly), by setting `GH_EXTENSION=1` for all extension dispatch paths. It also documents the new environment variable and adds both unit and acceptance coverage to prevent regressions across OS-specific dispatch logic.

**Changes:**
- Set `GH_EXTENSION=1` in the environment for extension processes launched via `Manager.Dispatch`.
- Document `GH_EXTENSION` in `gh help environment`.
- Add unit tests for environment propagation/override and a new end-to-end acceptance script covering the required scenarios.

Show a summary per file

| File | Description |
| ---- | ----------- |
| pkg/cmd/root/help_topic.go | Documents the new `GH_EXTENSION` environment variable in `gh help environment`. |
| pkg/cmd/extension/manager.go | Appends `GH_EXTENSION=1` to the dispatched extension command’s environment. |
| pkg/cmd/extension/manager_test.go | Adds regression tests verifying `GH_EXTENSION` is set, overrides inherited values, and preserves other env entries. |
| acceptance/testdata/extension/extension-env.txtar | Adds an end-to-end acceptance script verifying `GH_EXTENSION` behavior for `gh `, `gh extension exec`, standalone execution, and documentation. |

## Review details

> [!TIP]
> Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- **Files reviewed:** 4/4 changed files
- **Comments generated:** 0
- **Review effort level:** Lite

_Originally posted by @copilot-pull-request-reviewer in https://github.com/cli/cli/pull/14072#pullrequestreview-4862899623_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with pkg/cmd/extension/manager.go and its tests in pkg/cmd/extension/manager_test.go, then review the environment documentation in pkg/cmd/root/help_topic.go. Run the acceptance coverage in acceptance/testdata/extension/extension-env.txtar and confirm the documented dispatch behavior and environment handling across the listed invocation paths.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
github
Bereich
cli, documentation, testing
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
15/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.