Commit graph

96 commits

Author SHA1 Message Date
Uday R
40beb82e0c fix: list branches in square brackets in gh codespace 2024-12-10 15:19:30 -05:00
David Gardiner
20273d1f17 Move create codespace permission opt out behind else to fix token permissions 2024-01-12 12:16:38 -08:00
David Gardiner
500f359592
Don't poll for addition codespace permissions if user chooses to create without them (#8267) 2023-10-30 13:22:38 -05:00
David Gardiner
a8f8728056 Poll permission acceptance endpoint on codespace creation 2023-10-12 16:55:13 -07:00
David Gardiner
64f4660ec7
Migrate all Codespaces operations from Live Share to Dev Tunnels (#8149)
* Migrate all Codespaces operations from Live Share to Dev Tunnels

* Remove Live Share references

* Fix linting errors

* Update comments, remove deps, add uint16 bound checks

* Fix tests and move keep-alive logic to forwarder

* Address comments

* Updated mock port forwarder

* Fix CodeQL error

* Update comment

* Update func name

* Add missing connection close

* Fix linting error

* https -> http

* Update defer

* Fix tests
2023-10-12 22:16:36 +00:00
David Gardiner
e059f32aa5 Forward codespace ports over Dev Tunnels 2023-09-27 13:42:40 -07:00
John Keech
93e1511bae
Codespaces: Use the host name from the logged in server for commands (#7795)
* Use the host name from the logged in server for codespace commands

* Fix existing tests

* Add tests for server url configuration

* Rename defaultApiUrl to defaultAPIURL and comment cleanup

* Switch to t.Setenv in codespaces api tests

* Switch to t.Setenv in other tests

* Support custom server in web flows for list and create

* Rename GetServerURL() to ServerURL()
2023-08-08 09:32:06 -07:00
Kousik Mitra
d0207a2ede
Add capability to filter codespaces by repo owner (#7347)
* Add capability to filter codespaces by repo owner

* Replace Flags with PersistentFlags

* Reword flag description

* Update test seed

* Add mutual exclusion

---------

Co-authored-by: Caleb Brose <5447118+cmbrose@users.noreply.github.com>
2023-04-27 10:42:08 -05:00
JP Ungaretti
5a7f779cf7 Merge branch 'trunk' into jungaretti/fix-jupyter-spinner 2023-03-07 18:43:34 +00:00
Caleb Brose
57c73e8239
Add --repo filter to more gh codespaces commands (#6669)
* Add --repo flag to commands

* Example of using common args

* Add -r to stop

* Add validation to the add helper

* Skip prompt for single option

* Migrate (mostly) everything to addGetOrChooseCodespaceCommandArgs

* Fix typo in logsCmd

* Use R instead of r

* Update a couple -r usages

* Refactor to codespace_selector

* Clean up selector, apply it in a couple examples

* Use apiClient instead in constructor

* Restore addDeprecatedRepoShorthand

* Finish implementing the commands

* Update existing tests to use the selector

* Add tests for selector

* linter

* Catch case where there's no conflict

* Make the flag persistent for ports

* Add support to stop
2023-02-22 17:16:36 -06:00
JP Ungaretti
a388358348 Merge branch 'trunk' into jungaretti/fix-jupyter-spinner 2023-02-09 23:18:22 +00:00
JP Ungaretti
1b88915a4d Rename f to run 2023-02-09 23:16:12 +00:00
JP Ungaretti
43783a33a2 Move helper to iostreams 2023-02-09 22:23:58 +00:00
Robin Neatherway
78fb90956c
Teach gh cs create to use current repo as default (#6596)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-02-07 20:05:38 +00:00
Luan Vieira
d4c9890c5a
Default to authenticated user on codespace delete (#6944)
When a username option is not provided for the `gh codespace delete`
command, we will use the authenticated user's login as the default to
avoid deleting anyone else's codespace by mistake.

Prior to this change, running `gh codespace delete --org MYORG --all`
would fetch all of the codespacese associated with the org regardless of
user and then only delete the ones associated with the authenticated
user, which would lead to 404 errors when MYORG had codespaces owned by
members other than the authenticated member.

Co-authored-by: Victoria Dye <vdye@github.com>
Co-authored-by: Lessley Dennington <ldennington@github.com>
2023-02-07 20:46:08 +01:00
JP Ungaretti
216d3bf912 Add generic progress runner 2023-01-12 22:56:19 +00:00
David Gardiner
839378d5cb
Merge pull request #6657 from dmgardiner25/codespaces-rpc-invoker
Create centralized Codespaces RPC invoker
2023-01-06 12:58:44 -08:00
John Keech
791c7db632
Fix typo in has_uncommitted_changes for codespaces (#6812)
The REST API for codespaces returns the following schema:
```
"git_status": {
    "ahead": 0,
    "behind": 0,
    "has_unpushed_changes": false,
    "has_uncommitted_changes": false,
    "ref": "main"
  },
  ```

  The CLI was looking for `has_uncommited_changes` in the response instead of `has_uncommitted_changes`, leading to it always reporting a `false` value which could be different than the API response.
2023-01-05 22:02:32 +00:00
David Gardiner
1e75a74d18 Create centralized Codespaces RPC invoker 2023-01-04 14:41:25 -08:00
Caleb Brose
56006eefa6 Flags instead of PersistentFlag 2022-12-13 01:20:49 +00:00
Caleb Brose
57c53e6268 linter 2022-12-12 21:21:23 +00:00
Caleb Brose
8e0b4ef21b Use -R for --repo shorthand and deprecate -r 2022-12-12 19:44:59 +00:00
JP Ungaretti
a29820ebe3 Use incremental rebuild by default 2022-11-01 21:00:14 +00:00
Ashwin Jeyaseelan
a756ffb1e8
Fix Codespace Creation Devcontainer bug (#6389) 2022-10-18 11:11:28 +03:00
JP Ungaretti
982aa5ba82 Rename RPC command to RebuildContainer 2022-10-10 21:01:29 +00:00
JP Ungaretti
da91216c31 Add new Rebuild function 2022-10-08 00:04:45 +00:00
Caleb Brose
0c00ca911e Clean up API interface 2022-09-16 22:25:11 +00:00
Caleb Brose
6b24949649
Merge pull request #5958 from cli/cmbrose/no-auto-key-if-uploaded
Check for already configured ssh keys before using automatic key
2022-08-23 12:09:16 -05:00
Sam Coe
6a8deb1f5a
Integrate latest go-gh packages (#6084) 2022-08-18 09:04:13 +03:00
Caleb Brose
f313953642 Initial pass 2022-07-16 20:38:23 +00:00
Mark Phelps
38ea62afba
Codespaces list by repo (#5854)
* WIP

* Allow to list codespaces by repo

* Tests

* Cleanup

* respond to PR feedback

* Address review comments
2022-06-28 13:34:04 +00:00
Ashwin Jeyaseelan
47f5abdb6f
8gitbrix/add delete org codespace (#5827)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-06-22 18:28:09 +02:00
Greggory Rothmeier
2294f49d07
Add support for org admins to stop a members codespace (#5812) 2022-06-22 13:56:22 +02:00
Greggory Rothmeier
4b36dc031f
Add flag to list codespaces under an organization (#5807)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-06-21 13:57:40 +00:00
Greggory Rothmeier
9b86fe41c0
Simplify codespace picker (#5826)
This doesn't change anything about how it's formatted, but extracts a
new function formatCodespacesForSelect so we can test and see how it
treats the different combinations of codespaces.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-06-21 15:47:11 +02:00
Jake Shorty
832f35e000 PreFlight => BillableOwner for less confusion 2022-06-20 17:12:07 +00:00
Jake Shorty
edf83af07a Add Codespaces pre-flight request to API client 2022-06-15 21:17:04 +00:00
Caleb Brose
b5580f9503 Refactor inferfaces from PR comments 2022-06-13 19:04:29 +00:00
cmbrose
eebef06c67 Merge main and use func options again 2022-06-07 12:27:29 -05:00
Greggory Rothmeier
f15a8ca335
Extract LiveshareSession interface (#5725)
This will make it possible to inject a mock liveshare session for testing
2022-06-06 15:52:52 +02:00
Thomas Horstmeyer
d9d3d7ba8e Fix nil pointer exception in codespace selection 2022-05-10 16:27:25 +01:00
Jose Garcia
cd6386cf64 Update order 2022-05-05 15:07:29 -04:00
Jose Garcia
ea7d9288e3 Handle star in display name 2022-05-05 08:21:12 -04:00
JP Ungaretti
2dd81671a9
Remove empty return 2022-05-03 09:40:07 -07:00
Caleb Brose
55bce59ab7
Add command to open codespaces in JupyterLab
Add command to open codespaces in JupyterLab
2022-04-28 16:11:14 -05:00
JP Ungaretti
3526d25a1e Remove mention of function 2022-04-28 20:55:43 +00:00
JP Ungaretti
8aa132e6c6 Use named return values 2022-04-28 18:42:05 +00:00
JP Ungaretti
6ddd3360d8 Update auth error message 2022-04-28 18:10:14 +00:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
JP Ungaretti
fce69a5350 Add context to errors 2022-04-21 15:03:07 -07:00