Commit graph

5402 commits

Author SHA1 Message Date
nate smith
5569c0e94d oops 2022-03-29 10:29:05 -05:00
nate smith
0e941dca0a words 2022-03-29 10:26:34 -05:00
nate smith
893f833673 use errgroup 2022-03-29 10:25:14 -05:00
nate smith
a3fba669bd add and use RESTWithNext 2022-03-29 10:15:33 -05:00
nate smith
659a8ed1b9 use a StringSliceVar 2022-03-29 09:47:59 -05:00
nate smith
058c2b4fe3 redundant 2022-03-28 11:55:07 -05:00
nate smith
f22c325ea4 gh status 2022-03-28 11:53:13 -05:00
Sam Coe
ee6fc0f9b7
Add search issues and search pull requests commands (#5334) 2022-03-27 19:53:03 +00:00
Gabe D
3a949203c4
Update Codespace permissions opt out param (#5344) 2022-03-25 12:12:14 +01:00
dependabot[bot]
ad313f77f7
Bump github.com/AlecAivazis/survey/v2 from 2.3.2 to 2.3.4 (#5337)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-03-24 15:54:40 +01:00
Caleb Brose
1b01733ce5
Merge pull request #5340 from cli/cmbrose/scp-args
`gh cs cp` parses additional scp args
2022-03-24 09:53:54 -05:00
Caleb Brose
623e67f6b1 Update comments/usage and remove -- 2022-03-23 16:09:07 +00:00
Caleb Brose
a03051f295 Refactoring and comments 2022-03-22 14:49:58 +00:00
Caleb Brose
f22320a478 Parse scp args 2022-03-22 01:57:37 +00:00
Mislav Marohnić
65d90aa24d
Merge pull request #5336 from cli/dependabot/github_actions/actions/cache-3
Bump actions/cache from 2 to 3
2022-03-21 17:57:59 +01:00
Jose Garcia
c7bd3f8626
Merge pull request #5339 from cli/jg/fix-flakey-test
liveshare test: only sleep if conn is nil
2022-03-21 12:22:05 -04:00
Jose Garcia
b5a7a36ece Document why we have a loop retrying 2022-03-21 12:11:00 -04:00
Jose Garcia
cd6176d911 Rename to tries and clean up loop condition 2022-03-21 11:42:32 -04:00
Jose Garcia
74c8b2217e Increment retries 2022-03-21 11:36:12 -04:00
Jose Garcia
107ea6c440 Only sleep if conn is nil 2022-03-21 11:09:52 -04:00
dependabot[bot]
b090ef0578
Bump actions/cache from 2 to 3
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-21 14:27:30 +00:00
Mislav Marohnić
b7bdb369f1
Merge pull request #5327 from sgray/patch-1
Remove unwanted trailing quote
2022-03-21 14:50:08 +01: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
Josh Gross
31c6ba3807
Support listing and removing Dependabot secrets (#5160)
* Support listing and removing Dependabot secrets

* Remove duplicated tests
2022-03-17 11:42:12 +02:00
Bernardo
652c88769b
Merge pull request #5270 from cli/jg/event-handling
Codespaces: Listen to agent port-forwarding events when forwarding ports
2022-03-16 15:03:31 -07:00
Bernardo
2e3400a8af Merge branch 'trunk' into jg/event-handling 2022-03-16 20:51:47 +00:00
Bernardo
c70e2a345e allow 2 go routines to send 2022-03-16 20:34:51 +00:00
Charlie Andrews
bb4fc52199
Merge pull request #5319 from cwndrws/cwndrws/codespaces/handle-codespaces-with-pending-operations
[Codespaces] Disallow some operations on codespaces that have a pending operation
2022-03-16 11:29:06 -04:00
Mislav Marohnić
f3f14555f8
Merge pull request #5323 from cli/dependabot/go_modules/github.com/stretchr/testify-1.7.1
Bump github.com/stretchr/testify from 1.7.0 to 1.7.1
2022-03-16 15:39:58 +01:00
dependabot[bot]
311b9bd380
Bump github.com/stretchr/testify from 1.7.0 to 1.7.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-16 14:25:15 +00:00
Charlie Andrews
4eedfc05c1 Add docs link comment to Codespaces struct definition 2022-03-16 10:20:13 -04:00
Charlie Andrews
7ca31e02b4 Disallow editing a codespace that has a pending operation
This is already prevented by the API, but this will make the error
message cleaner and easier to understand for the user.

Example of old error message:

```
$ gh cs edit -c cwndrws-redacted -d "some silly name"
error editing 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)
exit status 1

```

Example of new error message:

```
$ gh cs edit -c cwndrws-redacted -d "some silly name"
error editing codespace: codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
2022-03-16 10:13:46 -04: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
Charlie Andrews
3f65e5ae24 Add pending opertion and reason to codespace response struct 2022-03-15 17:19:47 -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
Nate Smith
1c260191ee
Merge pull request #5275 from cdb/cdb/rerun-failed-jobs
Support "all failed jobs" and individual job re-run for a github actions workflow run
2022-03-15 12:08:36 -05:00