Commit graph

244 commits

Author SHA1 Message Date
William Martin
6b811db467 Add telemetry command 2026-04-21 17:13:27 +02:00
William Martin
c50fb793ea Record official extension telemetry 2026-04-21 11:48:32 +02:00
William Martin
998b6212b3
Add skills specific telemetry
* Add skills specific telemetry

* Remove VisibilityFuture, inline goroutine at call sites

The VisibilityFuture/FetchRepoVisibilityAsync/Wait wrapper was an
unidiomatic async abstraction built for a single pattern used in
exactly two call sites. In Go the channel is already the future;
wrapping it in a struct with a Wait(timeout) method adds no value.

Delete the abstraction and inline a local visResult struct,
buffered channel, goroutine, and select at each call site. Behavior
is preserved exactly: err -> "unknown", timeout -> "unknown",
success+public -> include skill_names.

FetchRepoVisibility (synchronous) is kept as-is.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix nonsense copilot tests

* Update telemetry tests for public-only dims and search event removal

Production telemetry emission changed:
- preview: skill_owner/skill_repo/skill_name (renamed from skill_names)
  are now emitted only when repo_visibility=public.
- install: skill_owner/skill_repo/skill_names are now emitted only
  when repo_visibility=public.
- search: the initial skill_search event was removed entirely; the
  skill_search_install event no longer carries query/owner dims.

Update tests to match: rename skill_names -> skill_name in preview,
make owner/repo assertions conditional on public visibility in both
preview and install, and reduce the search test to a single event
with explicit Empty assertions for the removed query/owner dims so a
privacy regression cannot pass silently.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Test CategorizeHost and switch telemetry to skill_host_type

Add TestCategorizeHost covering all four classification branches
(github.com, ghes, tenancy, uncategorized) with cases verified
against the real ghauth implementation rather than guessed.

Update install and preview unit tests to assert the new
skill_host_type dimension name, and fix a typo in the preview
acceptance txtar (skill_hos_type -> skill_host_type).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Shrink visibility wait and test unknown visibility

The 2s visibilityWaitTimeout was wildly overprovisioned: by the time
telemetry emission reaches the select, the command has already done
several serial GitHub REST calls (and for install, a git sparse-checkout
plus possibly interactive prompts), so the one-call visibility fetch
has almost always completed. Drop the timeout to 200ms — a short safety
net for a stalled REST call, not a wait budget for a healthy one.

Also adds a table-driven case to TestFetchRepoVisibility covering an
unknown/future visibility value from the API, addressing @babakks'
review nitpick.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 19:58:59 +02:00
William Martin
6709e315df Do not send telemetry for aliases 2026-04-17 14:28:49 +02:00
William Martin
17776cafc1 Apply review feedback
- Harden SpawnSendTelemetry against relative executable paths
- Use io.Copy for telemetry subprocess stdin write
- Clean up GH_TELEMETRY/DO_NOT_TRACK help text
- Fall back to built-in defaults (NoOp telemetry) on config load failure

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 12:28:52 +02:00
William Martin
18dc5e77f0 Add sampled command telemetry 2026-04-16 21:42:46 +02:00
Kynan Ware
3265170df9
Merge pull request #13175 from cli/kw/first-party-extension-suggestions
Suggest and install official extensions for unknown commands
2026-04-16 10:48:28 -06:00
Kynan Ware
32b8af1017 Remove dispatch after install, install only
Removes post-install extension dispatch to keep the stub focused on
installation. Also removes unused args parameter from the run function.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-16 10:38:33 -06:00
Kynan Ware
b8d504cbd9 Rename official extension files and types to stubs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-16 10:34:48 -06:00
Kynan Ware
1d59334964 Replace em-dashes with regular dashes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-16 10:32:00 -06:00
William Martin
abc2a50b4c Address PR review feedback
- Use cmdutil.DisableAuthCheck instead of raw annotation map
- Convert tests to table-driven format
- Use generic extension name in tests (gh-cool)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-16 18:11:28 +02:00
William Martin
7ad1d7c0a1 Suggest and install official extensions via stub commands
Register hidden stub commands for official GitHub extensions (gh-aw,
gh-stack) that offer to install the extension when invoked. This
replaces the error-string-matching approach from the original PR with
proper cobra commands that:

- Avoid false-positive matches on flag values or post-'--' args
- Eliminate conflicting cobra 'Did you mean?' suggestions
- Properly propagate prompt/install errors for correct exit codes
- Are hidden from help output and shell completions
- Use GroupID "extension" so checkValidExtension allows installing over them
- Are registered after extensions and aliases so both take priority

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-16 17:58:37 +02:00
tommaso-moro
45d0ec0b51
address review comments
Co-authored-by: Sam Morrow <info@sam-morrow.com>
2026-04-15 16:01:26 +02:00
tommaso-moro
5d049cb897
register initial skills commands 2026-04-15 15:44:00 +02:00
William Martin
7ea88b1c4d
Bundle licenses at release time (#12625)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-02-18 17:59:27 +01:00
Babak K. Shandiz
10b4a1f427
fix(root): avoid command name collision when registering extensions
Signed-off-by: Babak K. Shandiz <babakks@github.com>

Co-authored-by: Kynan Ware <bagtoad@github.com>
Co-authored-by: Devraj Mehta <devm33@github.com>
2026-01-19 10:38:39 +00:00
Babak K. Shandiz
08a4413614
chore(root): register copilot command
Signed-off-by: Babak K. Shandiz <babakks@github.com>

Co-authored-by: Kynan Ware <bagtoad@github.com>
Co-authored-by: Devraj Mehta <devm33@github.com>
2026-01-19 10:38:35 +00:00
Babak K. Shandiz
f498f2e882
fix: resolve copyloopvar issues
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:26 +00:00
Kynan Ware
8840df2eb3 Fix agentTaskCmd to use repoResolvingCmdFactory
`agent-task` uses smart base repo func to fix bug with resolving upstream instead of local repo.
2025-10-10 10:39:52 -06:00
Kynan Ware
3573f61b86 Add agent-task command with OAuth token validation
Introduces a new `agent-task` command under pkg/cmd/agent with strict OAuth (device flow) token validation. Includes comprehensive tests for token source and host validation, and registers the command in the root command set.
2025-08-27 12:23:01 -06:00
Andy Feller
313d20ba83 Ensure hostnames are visible in CLI website
This commit changes <github.com> and <ghe.com> references to `github.com` and `ghe.com` so they are visible on the GitHub CLI marketing website.

GitHub Pages will render URLs with a protocol as clickable links, however hostnames are treated as HTML elements and not rendered.
2025-07-14 08:33:20 -04:00
Kynan Ware
ca46b56456
Merge pull request #11003 from cli/kw-bks/enclose-config-options-in-code-blocks
Fix formatting in allowed values for `gh config --help`
2025-05-22 10:14:14 -06:00
Babak K. Shandiz
960aadf2b9
test: improve test case naming
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-05-22 17:04:04 +01:00
Babak K. Shandiz
53d589223b
test: ensure proper usage of pipes in docs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-05-21 12:17:05 +01:00
Kynan Ware
4bc056fe20
Merge branch 'trunk' into kw/preview-prompter-command 2025-05-10 11:30:15 -06:00
Andy Feller
c20a4a2ae9
Merge pull request #10890 from cli/andyfeller/gh-accessibility-help-topic
Introduce `gh accessibility` help topic highlighting GitHub CLI accessibility experiences
2025-04-30 15:40:27 -04:00
Andy Feller
d7e2468286 Update a11y text based on draft feedback 2025-04-28 15:01:15 -04:00
Andy Feller
274a09bbc9 Initial gh accessibility command draft
This commit captures the initial command along with functionality and description.

There is an internal discussion about the appropriate place for some of this content.
2025-04-23 10:11:51 -04:00
Andy Feller
f61961907e Update configuration support for accessible colors
- added support for `accessible_colors` configuration setting in `gh config` commandset
- updated default configuration file to contain `accessible_colors: disabled`
- add `GH_ACCESSIBLE_COLORS` env var to `gh environment`
- generated mocks via `go generate ./...` including previously missed prompter changes
2025-04-17 15:57:49 -04:00
Kynan Ware
1dbb01a1d1 doc(help): add documentation for GH_SPINNER_DISABLED 2025-04-16 11:17:23 -06:00
Kynan Ware
a34c9ea799 doc(prompter env): accessible prompter includes braille reader
Co-authored-by: Andy Feller <andyfeller@github.com>
2025-04-09 08:20:07 -06:00
Kynan Ware
861563269a Merge branch 'trunk' into kw/first-pass-accessible-prompter 2025-04-09 08:07:56 -06:00
Kynan Ware
abd573ac66 feat(preview): add preview prompter command 2025-04-08 15:14:28 -06:00
Kynan Ware
fa03157beb doc(help): label GH_ACCESSIBLE_PROMPTER as preview 2025-04-08 13:04:04 -06:00
Kynan Ware
19387b8418 fix(prompter): rename GH_ACCESSIBLE_PROMPTER 2025-04-08 12:52:39 -06:00
Kynan Ware
5996f882fc doc(envs): speech synthesis prompter 2025-04-07 10:40:29 -06:00
Andy Feller
addbc6ac5c Add label color env var to help topic, unused fix
This commit adds the new environment variable to the `gh environment` help topic.

Additionally, there is a small fix for Go linter for an unused variable raised as a problem.
2025-04-04 11:02:44 -04:00
Kynan Ware
c6b4da8f20 doc(formatting): add line breaks for readability 2025-03-28 12:00:06 -06:00
Kynan Ware
89def92f04 doc(formatting): update sprig func descriptions 2025-03-28 09:58:48 -06:00
Kynan Ware
ffd42ea256 docs: add Sprig library functions to help topics 2025-03-26 10:21:41 -06:00
Azeem Sajid
33c30d5bd1 Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
Azeem Sajid
026f64ce6f Standardize URLs 2025-02-13 10:41:53 +05:00
William Martin
cc4bf0fc9f Add small wait to extension update tests 2025-01-16 14:10:42 +01:00
Andy Feller
243acaf579 Refactor test based on PR feedback 2025-01-16 00:08:45 -05:00
Andy Feller
bc8c46b0b1 Make extension update check non-blocking
Fixes #10235

This commit updates the Cobra command logic around extension upgrade checks to be non-blocking.

Previously, we were waiting for 1 second after the extension completed to allow the update checking logic complete, however users want the GitHub CLI to run as far as possible.
2025-01-13 20:38:03 -05:00
Andy Feller
3ada5af872 Enhance help docs on ext upgrade notices
- update `gh help environment` to include that upgrade notices only happen when gh or extensions are executed
- update `gh ext --help` to include reference to upgrade notices and points to `gh help environment` for info on disabling
2025-01-13 08:41:10 -05:00
Andy Feller
20062233c8 Separate logic for checking updates
During discussion in cli/cli#9934, we can to the conclusion that the logic around checking for core GitHub CLI updates would diverge from GitHub CLI
extension updates over time.  To that end, this commit splits that logic into a separate function with a new environment variable.
2025-01-10 14:16:46 -05:00
Andy Feller
bfc63a14cc Implement remaining PR feedback
After merging in upstream changes regarding local extensions, this commit addresses remaining PR feedback while also bringing the newly merged tests into alignment with other changes.
2024-12-13 23:09:18 -05:00
Andy Feller
5ad6ccf73a Merge branch 'trunk' into andyfeller/cli-cli-8183-timeout-pt2 2024-12-13 22:53:13 -05:00
Andy Feller
c12e3694e8 Implement partial feedback before trunk update 2024-12-13 22:52:03 -05:00