Commit graph

459 commits

Author SHA1 Message Date
Jake Shorty
4aca945e2e Drop unused locationResult 2022-04-05 20:27:10 +00:00
Jake Shorty
41719f7624 Location is an optional flag when creating codespaces 2022-04-05 20:19:19 +00:00
Jose Garcia
f6b8bbe982
Merge pull request #5390 from legomushroom/legomushroom/codespaces-add-hidden-select-command
[codespaces]: add hidden select command
2022-04-05 13:37:45 -04:00
Oleg Solomka
e7fb9c0c4d fix linter issues 2022-04-05 10:08:34 -07:00
Amanda Lin
6490f658de handle IdleTimeoutNotice 2022-04-05 10:27:26 -05:00
Oleg Solomka
78573442eb address more PR feedback 2022-04-04 17:13:52 -07:00
Jeff Hubbard
a84e43cadf Final copy and behavior update for prompt 2022-04-04 16:32:38 -07:00
Amanda Lin
371f128871 remove idle timeout flag 2022-04-04 15:15:00 -05:00
Oleg Solomka
d6edc6f8a6 address more PR feedback 2022-04-04 10:53:52 -07:00
Oleg Solomka
b4d29a8b7b address PR feedback 2022-04-04 10:34:04 -07:00
Oleg Solomka
9a0b208200 [select codespace]: cleanup description 2022-04-01 12:30:55 -07:00
Oleg Solomka
07e18ea3d4 [codespace select]: add unit tests for filePath flag, add command description 2022-04-01 11:35:40 -07:00
Jeff Hubbard
ef0672eac0
Merge branch 'trunk' into multi-devcontainer 2022-03-29 13:46:05 -07:00
Mislav Marohnić
3f5311ea1c
Merge pull request #5345 from znull/znull/ssh-config-example
ssh.go: use setup example that should work with any ssh config
2022-03-29 16:15:56 +02:00
Jeff Hubbard
9554e522af Change the way we parse list-devcontainers response 2022-03-28 14:24:57 -07:00
Jeff Hubbard
03b8b16585 Merge branch 'trunk' of ssh://github.com/cli/cli into multi-devcontainer 2022-03-28 13:59:01 -07:00
Jason Lunz
17cb6346a5
ssh.go: use setup example that should work with any ssh config
The `gh cs ssh` command suggests an example recipe for setting up
openssh integration. The last step appends an `Include` statement to the
user's `~/.ssh/config`.

Unfortunately, this won't always work as intended. If the existing
configuration ends with a `Host` block, the added `Include` statement
will be conditional on whether that block matches.

By preceding the `Include` statement with `Match all`, we can ensure
that it is always evaluated.
2022-03-23 17:00:36 -06:00
Caleb Brose
623e67f6b1 Update comments/usage and remove -- 2022-03-23 16:09:07 +00:00
Oleg Solomka
783f316df1 [codespaces]: add hidden select command 2022-03-23 00:26:50 +00:00
Caleb Brose
f22320a478 Parse scp args 2022-03-22 01:57:37 +00:00
Jeff Hubbard
125a7b00a2 Fix tests 2022-03-18 14:44:15 -07:00
Steve Gray
b48a93cddf
Remove unwanted trailing quote
Removes a stray quote from the codespace ssh example.
2022-03-18 14:06:27 -06:00
Jeff Hubbard
8abf50be1d Change some copy per product's suggestions 2022-03-18 10:10:57 -07:00
Bernardo
2e3400a8af Merge branch 'trunk' into jg/event-handling 2022-03-16 20:51:47 +00:00
Jeff Hubbard
ce3d0791c3
Merge branch 'trunk' into multi-devcontainer 2022-03-16 12:51:03 -07:00
Charlie Andrews
64eecef176 Remove unhelpful error wrapper 2022-03-16 09:36:14 -04:00
Charlie Andrews
a2f76fdfe0 Fix copy pasta error to appease the linter 2022-03-16 09:10:54 -04:00
Charlie Andrews
8bf0cb8f13 Refactor the getOrChooseCodespace to always check for pending ops 2022-03-16 08:56:17 -04:00
Charlie Andrews
10e43b5136 Use color variable instead of literal for disabled reason 2022-03-16 08:43:34 -04:00
Charlie Andrews
3ed2e49bd9 Add tests for disallowing all port commands for codespace w/ pending op 2022-03-15 17:27:38 -04:00
Charlie Andrews
f94a1a2bd4 Add test for disallowing opening vs code for codespace with pending op
I also refactored the existing vs code test a bit to work with the new
use of `getOrChooseCodespace`.
2022-03-15 17:27:38 -04:00
Charlie Andrews
6346779f35 Add test for disallowing logs when codespace has a pending op 2022-03-15 17:27:38 -04:00
Charlie Andrews
27a5512b41 Add test for disallowing ssh when codespace has a pending op 2022-03-15 17:27:38 -04:00
Charlie Andrews
5ffe838dce Disallow any port operations when codespace has pending operation
Since all of the port operations require the codespace to be running, we
need to disallow these operations when there's a pending op since we
can't start the codespace in this state.

Since the API already disallows this, this is basically cleaning up the
error messages that the user sees in this state

Old error message:

```
$ gh cs ports forward 80:80
? Choose codespace: redacted
Starting codespace â£ğerror connecting to codespace: error starting codespace: HTTP 422: your codespace has an operation pending: updating to a sku with a different amount of storage; please wait until this operation is complete (https://api.github.com/user/codespaces/cwndrws-redacted/start)
```

New error message:

```
$ gh cs ports forward 80:80
? Choose codespace: redacted
codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
2022-03-15 17:27:38 -04:00
Charlie Andrews
da99a1b59b Ensure codespace exists and doesn't have a pending op when opening Code
The initial intention for this change was to disallow users to open a
codespace in VS Code if the codespace has a pending operation. This also
adds a side-benefit of presenting the user an error before waiting for
VS Code to open if they provide an invalid codespace to open.
2022-03-15 17:21:28 -04:00
Charlie Andrews
599c7c900f Disallow getting logs from codespaces with pending ops
Since the API already disallows this, this pretty much just cleans up
the error reporting to the user.

Example of old error:

```
$ gh cs logs -c cwndrws-redacted
Starting codespace ⣽connecting to codespace: error starting codespace: HTTP 422: your codespace has an operation pending: updating to a sku with a different amount of storage; please wait until this operation is complete (https://api.github.com/user/codespaces/cwndrws-redacted/start)
exit status 1

```

Example of new error:

```
$ gh cs logs -c cwndrws-redacted
codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
2022-03-15 17:21:28 -04:00
Charlie Andrews
afa71c4b2f Disallow ssh'ing to codespace with a pending operation
Since the API already disallows this, this makes the error cleaner and
more explicit when a user is trying to start/ssh into a codespace that
has a pending operation.

Example of the old error message:

```
$ gh cs ssh -c cwndrws-redacted
Starting codespace ⣽error connecting to codespace: error starting codespace: HTTP 422: your codespace has an operation pending: updating to a sku with a different amount of storage; please wait until this operation is complete (https://api.github.com/user/codespaces/cwndrws-redacted/start)
exit status 1

```

Example of the new error message:

```
$ gh cs ssh -c cwndrws-redacted
codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
2022-03-15 17:21:28 -04:00
Charlie Andrews
3d28c52104 Mark codespace with pending op as disabled with reason instead of state 2022-03-15 17:21:24 -04:00
Bernardo
d60419b2db req is no longer needed 2022-03-15 21:07:28 +00:00
Bernardo
1b50852b2d remove unnecessary new context 2022-03-15 18:25:54 +00:00
Bernardo
7d07249150 review suggestions 2022-03-15 18:22:32 +00:00
Mark Phelps
43e4e9514d
Merge pull request #5276 from markphelps/codespaces-accept-perms-wording 2022-03-15 12:55:44 -04:00
Bernardo
2163c2312a review suggestions 2022-03-15 05:50:18 +00:00
Jose Garcia
bc80675b6f Remove unused types 2022-03-14 10:34:52 -04:00
Jose Garcia
ed376f3691 Pass conn to handlers instead of obj stream 2022-03-14 10:29:31 -04:00
Caleb Brose
ca98aec535
Merge pull request #5297 from cmbrose/cmbrose/cs-cp-profile
Add `--profile` option to `gh cs cp`
2022-03-14 07:10:02 -05:00
GitHub Action
94128d683c Add consts for targets and treat empty as prod 2022-03-10 19:59:24 -06:00
GitHub Action
21a1059f7c Add --profile option to gh cs cp 2022-03-10 19:01:55 -06:00
GitHub Action
5e62a417d8 Add emojis to name 2022-03-10 18:50:12 -06:00
GitHub Action
d85feafa85 Rename to hasNonProdVSCSTarget 2022-03-10 17:05:13 -06:00