Commit graph

1901 commits

Author SHA1 Message Date
chemotaxis
e019ff9f02 Modify documentation if called from issue or pr 2022-04-28 23:56:13 -04:00
chemotaxis
364dd38bc0 Get graphql queries and mutations working
- Fix error if found an issue while using `gh pr lock/unlock` or vice versa
- Added additional types
- Used githubv4 types
- Added "relock" state
    - If the conversation is already locked you have two choices: try to
      lock it again or do nothing.  Do nothing is easy.  But, if you
      want to change the lock reason, you need to first unlock the
      conversation and then lock it again.
- Added survey to confirm if you want to relock
- Added formatted print statements
2022-04-28 23:54:22 -04:00
chemotaxis
fa470fc499 Rearrange 2022-04-11 00:38:13 -04:00
chemotaxis
ffcda8fdd4 Map parent commands to typenames 2022-04-11 00:38:13 -04:00
chemotaxis
4b226b1bf8 Other changes
- Changed function to method
- Moved additional common options to method
- Remove redundant documentation
    - Cobra sets documentation in the Command struct.
2022-04-11 00:37:14 -04:00
chemotaxis
72a92fa09d Added lock subcommands to pr command 2022-04-11 00:37:14 -04:00
chemotaxis
631bea2e6d Draft first design
As originally designed in the issue discussion, a single function
`NewCmdLock()` with a parameter to lock or unlock was proposed.
However, after playing around with a couple different designs, it seems
best to create two separate public functions and one private function to
do the common work.

Using two public functions seems to make sense because the api for
locking is different from the api for unlocking.  Therefore, the
documentation for both are different and keeping them in separate
functions would make it easier to maintain the documentation.
2022-04-11 00:36:42 -04:00
chemotaxis
e25c36a7b1 Stub out files for lock command
Lock will lock and unlock both issues and pull requests
2022-03-19 16:58:51 -04: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
2e3400a8af Merge branch 'trunk' into jg/event-handling 2022-03-16 20:51:47 +00: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
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
Mark Phelps
43e4e9514d
Merge pull request #5276 from markphelps/codespaces-accept-perms-wording 2022-03-15 12:55:44 -04:00
Cameron Booth
a20e8b7eec Fix test I missed updating 2022-03-15 09:50:20 -07:00
Bernardo
2163c2312a review suggestions 2022-03-15 05:50:18 +00:00
Josh Gross
f6d2f83938
Support setting Dependabot secrets (#5134)
* Support setting Dependabot secrets

* lint: Remove unnecessary assignment

* Use `StringEnumFlag` helper for Application input

* Add Dependabot to command description

* Move repository name mapping after input validation

* Error when multiple secret entities are set

* Return an error for invalid apps

* Use `assert` instead of `require`
2022-03-15 07:44:51 +02:00
Cameron Booth
e6b09b45de Fix up error and help language 2022-03-14 12:29:49 -07:00
Gowtham Munukutla
83a6cccf2a
Add interactive repository edit functionality (#4895) 2022-03-14 17:49:03 +00:00
Cameron Booth
24ec53365b Return error if both jobID and runID are specified 2022-03-14 10:01:19 -07:00
Cameron Booth
3645975da7 Prefer IsStdoutTTY when that's all we need 2022-03-14 10:00:29 -07: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
Boston Cartwright
bb9bf29835
pr merge switch to base branch if available (#5251)
* after merge, switch to base branch if available

* Add ability to checkout new branch

* Style cleanup

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-03-14 14:02:57 +02: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
GitHub Action
be5923770b Add vscs-target to gh cs list 2022-03-10 16:42:31 -06:00
Josh Spicer
4d5ce7aa56
Adds internal codespace developer flags (#5287) 2022-03-09 15:59:29 +00:00
Sam Coe
e0045f26b9
Add top level search command and search repos sub command (#5172) 2022-03-09 12:24:27 +00:00
Mislav Marohnić
a657fa808a pr checks: fix error message when no checks were found
Fixes the error message:

    no checks reported on the '' branch

Now the correct branch name is reported.
2022-03-08 16:44:41 +01:00
Nate Smith
e361fd47a3
Merge pull request #5254 from ganboonhong/pr-close-failed
pr close skips deleting local branch if not in a git repo
2022-03-07 14:53:41 -06:00
Seito Tanaka
6f66a1d265
Add version to extension list command (#5219)
* Add version to extension list command

* Trim sha only when displaying
2022-03-07 07:14:26 +00:00
Bernardo
fc55e01d86 fix progress indicator bug 2022-03-05 01:48:11 +00:00