{{ message }}
Disable telemetry for unauthenticated GHES gh api requests using absolute hostnames - #14337
Merged
Merged
Conversation
gh api requests
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The exported HTTP client injection contract must be preserved before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
pkg/cmd/api/api.go — 🛑 Requirement: Preserve the exported HTTP client injection contract. Changing this field from a… |
What changed in this PR
Routes telemetry suppression into gh api’s specialized HTTP client for GHES requests.
Changes:
- Propagates the telemetry disabler through command factories.
- Configures API clients to suppress GHES telemetry.
- Adds GHES and GitHub.com regression tests.
Blocking issue: 🛑 Critical (2 votes) — Preserve the exported HttpClient injection signature in ApiOptions; changing it breaks existing consumers. Capture TelemetryDisabler in the default closure or use a separate unexported factory.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
williammartin
marked this pull request as ready for review
September 3, 2026 14:15
gh api requestsgh api requests using absolute hostnames
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
williammartin
force-pushed
the
williammartin-ghes-api-telemetry
branch
from
September 3, 2026 15:14
6b30ab7 to
4a75987
Compare
williammartin
enabled auto-merge
September 3, 2026 15:18
BagToad
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
gh apibuilds a specialized HTTP client to support command-specific cache and verbose behavior. This API Client was not provided with aTelemetryDisablerat construction time. It was therefore possible forgh api --hostnameorgh api <absolute url>to emit telemetry unexpectedly under extremely narrow conditions:mightBeGHESUserdisables telemetry:cli/internal/ghcmd/cmd.go
Lines 504 to 506 in 6e82bc5
mightBeGHESUserdisables telemetry:cli/internal/ghcmd/cmd.go
Lines 495 to 497 in 6e82bc5
Under these circumstances, an unauthenticated request using
gh apicould send telemetry if sampled at a 1% chance:How did you test this change?
Before
See above
After
Authorship and follow-up
Who wrote this:
Who answers review comments: