Commit graph

30 commits

Author SHA1 Message Date
JP Ungaretti
eaf8f84baf Merge branch 'trunk' into add-cs-jupyter 2022-04-14 15:27:40 -05:00
Bernardo
2e3400a8af Merge branch 'trunk' into jg/event-handling 2022-03-16 20:51:47 +00:00
Charlie Andrews
8bf0cb8f13 Refactor the getOrChooseCodespace to always check for pending ops 2022-03-16 08:56:17 -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
Bernardo
fc55e01d86 fix progress indicator bug 2022-03-05 01:48:11 +00:00
Bernardo
75c6c2c877 fix scoping bug 2022-03-04 23:07:24 +00:00
Bernardo
9616706984 review suggestion 2022-03-04 22:30:50 +00:00
JP Ungaretti
fba5fb4eec Refactor liveshare setup to a new function 2022-03-04 00:54:15 +00:00
Bernardo
7656943c31 review suggestions 2022-03-03 18:40:00 +00:00
Jose Garcia
2328ccb881 Abstract port notification logic into liveshare 2022-02-28 07:56:37 -05:00
Jose Garcia
3847d965da Refactor port update data into liveshare 2022-02-25 08:09:12 -05:00
Jose Garcia
9556c72ecf Update event types and drop idea of global request 2022-02-17 17:05:56 -05:00
Jose Garcia
ee349700de Checkin almost final impl but wrong direction 2022-02-16 17:56:09 -05:00
Bernardo
ca14d10b7b add failure tests 2022-02-16 03:10:47 +00:00
Jose Garcia
c96807fae7 Clean up cruft 2022-02-15 15:34:04 -05:00
Jose Garcia
c90da9799d Tests for update port visibility 2022-02-15 15:30:06 -05:00
Jose Garcia
04a4e43dec Initial spike with request/event handling 2022-02-14 17:22:58 -05:00
Jose Garcia
8296904c26
Rename errors from Live Share to generic codespace 2021-11-08 13:35:48 +00:00
Mislav Marohnić
83a08aa3ba Remove unnecessary pointers to Go maps 2021-10-25 17:20:12 +02:00
Mislav Marohnić
905cb3b9fa Touch-up codespaces exporting functionality 2021-10-25 15:45:10 +02:00
Mislav Marohnić
cbeb675e56 codespace ports: support --json and --template export flags 2021-10-22 14:13:43 +02:00
Jose Garcia
bbea5ac95e
codespace: progress indication, logging (#4555)
* Rework logging, showing progress, and printing from `codespace` commands
* Change rendering of the general progress indicator so that it's visible on both dark and light backgrounds
* The progress indicator now "spins" faster

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-10-21 18:04:04 +02:00
Marwan Sulaiman
6f34e4a605
Rename privacy sub-command to visibility (#4533)
* Rename privacy sub-command to visibility

* PR fixes
2021-10-15 09:51:46 -04:00
Marwan Sulaiman
b9bdef2b00
Add org scoped port forwarding + fix test formatting (#4497)
* Add org scoped port forwarding + fix test formatting

* Redesign port visibility

* Update pkg/cmd/codespace/ports.go

Co-authored-by: Jose Garcia <josebalius@github.com>

* Change sub command to privacy

* Example pr comment

* Fix test mock

* Fix test mock

Co-authored-by: Jose Garcia <josebalius@github.com>
2021-10-13 13:56:03 -04:00
Jose Garcia
5170a2931f Switch to standard lib log.Logger & support dfile
- --debug-file flag can now be used in conjuction with --debug to
  specify the debug file path
- Push out logger concerns to callers of liveshare
2021-10-12 15:45:05 -04:00
Jose Garcia
55f4fcf05c Live Share session activity detection
- Session now accepts two new options: ClientName and Logger
- Port forwarder now supports a keepAlive parameter which when true,
  instructs the PF to call the session's keepAlive method.
- Port forwarder uses a new traffic monitor to detect I/O traffic and
  notify the session when applicable.
- The SSH command introduces a new debug flag which enables the command
  to log to a new temporary file. The file path is printed to the user.
2021-10-07 10:42:06 -04:00
Jose Garcia
8135fdbd99 Switch GetCodespace to new API endpoint
- Drop GetCodespaceToken as it is no longer necessary
- Introduces new behavior with the API to optionally include connection
  details in the GET request. Ommitting to do so results in a faster
  response
2021-10-06 08:50:42 -04:00
Jose Garcia
d02876e6ea Rename the cmd pkg to codespace 2021-10-04 14:16:04 -04:00
Jose Garcia
0859de0124 Merge branch 'trunk' of github.com:cli/cli into jg/move-ghcs-cmd 2021-09-30 12:38:41 -04:00
Jose Garcia
9e6c11e767 Move cmd/ghcs to pkg/cmd/codespace
- Delete pkg/cmd/codespace/main as it is no longer needed in this
  codebase
2021-09-30 11:20:13 -04:00
Renamed from cmd/ghcs/ports.go (Browse further)