Commit graph

15 commits

Author SHA1 Message Date
William Martin
c50fb793ea Record official extension telemetry 2026-04-21 11:48:32 +02:00
William Martin
18dc5e77f0 Add sampled command telemetry 2026-04-16 21:42:46 +02: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
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
c12e3694e8 Implement partial feedback before trunk update 2024-12-13 22:52:03 -05:00
Andrew Feller
97630fe73c Enhance extension manager and tests
- extension manager has been made responsible for extension update directory information
- extension manager has been enhanced to ensure that previously left extension update metadata is deleted before installing an extension
- extension manager has been enhanced to ensure that extension update metadata is deleted when extension is being removed
- refactored extension command tests for manager change, ensuring previous and expected states along with returned release info
- refactored extension manager tests for ensuring previous extension update entries are removed before installing extension
- created extension manager test for installing local extension
- centralized logic for checking and ensuring extension name is "gh-" prefixed
2024-12-08 19:40:24 -05:00
Andrew Feller
6bd01d52dd Initial extension update check testing
First pass at implementing basic test around extension state checking behavior, wanting to discus with team about level of testing to perform and whether this is really the right place.
2024-12-01 18:20:55 -05:00
Andy Feller
7b91b17395 Refactor extension command testing
This commit allows for stubbing/mocking the function used for checking update release info.  Additionally, this does a minor refactor moving from non-blocking to blocking channel.
2024-11-17 21:59:06 -05:00
Andy Feller
0d3f7cae4e Bring extension update check in line with gh check
This commit is a bit of refactoring to bring the extension update checking logic up to par with what is done with `gh` including creation of state file per extension and listening to env vars for disabling version checking.

This work is not complete as it does not address necessary test changes.
2024-11-17 16:10:58 -05:00
Andy Feller
b8ef951de1 Shorten extension release checking from 3s to 1s
Addressing feedback from extension author demonstration about a noticable pause waiting for extension execution to complete due to amount of time waiting on channel.
2024-11-13 13:04:01 -05:00
Andy Feller
ddf7287ab8 Test extension command update behaviors
This commit expands upon the previous work by creating tests around extension command execution and how various extension update scenarios are handled.

Along the way, the logic handling formatting update messaging has been switched to use `ColorScheme` in order to honor color behavior flags.
2024-11-06 22:49:02 -05:00
Andrew Feller
47d77bd51b Add version checking when executing extensions
Building on logic from the `gh ext list` for retrieving and assessing extension release information, this commit enhances the logic around invoking extensions to check for new releases.

Using the same user experience from checking `gh` version, this should only output information when the extension is used and gives the user information on how to upgrade depending on the type of extension and whether it is pinned or not.

```shell
andrewfeller@Andrews-MacBook-Pro cli % gh ext install dlvhdr/gh-dash --pin v4.6.0
✓ Installed extension dlvhdr/gh-dash
✓ Pinned extension at v4.6.0
andrewfeller@Andrews-MacBook-Pro cli % ./bin/gh dash

A new release of dash is available: 4.6.0 → 4.7.0
To upgrade, run: gh extension upgrade dash --force
https://github.com/dlvhdr/gh-dash
```
2024-11-02 13:14:05 -04:00
Sam Coe
9be9dc22e9
Fix error handling for extension and shell alias commands (#7567) 2023-06-20 08:41:02 +09:00
Mislav Marohnić
beb6234f96
Speed up listing extensions by lazy-loading extension information when needed (#7493) 2023-06-14 09:33:18 +09:00
Sam Coe
74ee8cacae
Allow creating of nested aliases (#7457) 2023-05-25 09:46:45 +09:00