Commit graph

64 commits

Author SHA1 Message Date
David Gardiner
581b6652e2 Resolve race condition in codespaces connection 2023-10-31 12:19:14 -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
Caleb Brose
09e86d0ebf
Fix gh cs ports requiring sudo for privileged port numbers (#7326) 2023-04-19 07:00:44 -05:00
Caleb Brose
2b95cbc5a6 Close port forward writer on reader 2023-01-19 20:22:24 -06:00
David Gardiner
814fcf8c74 Remove unused token field 2023-01-06 09:56:16 -08:00
David Gardiner
000a84d49b Address comments 2023-01-04 15:33:33 -08:00
David Gardiner
731ba682f2 Create Invoker object 2023-01-04 14:41:25 -08:00
David Gardiner
1e75a74d18 Create centralized Codespaces RPC invoker 2023-01-04 14:41:25 -08:00
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
Sam Coe
d244346960
Replace uses of strings.Title (#5623) 2022-05-12 13:52:21 +00:00
HÃ¥vard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Jose Garcia
8296904c26
Rename errors from Live Share to generic codespace 2021-11-08 13:35:48 +00: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
Jose Garcia
0748e658cc Switches port binding to 127.0.0.1 where possible 2021-10-14 11:07:25 -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
bdc9ad30e7 Revert other rename changes 2021-10-06 13:46:04 -04:00
Jose Garcia
3a28643630 Keep codespace struct in API for now
- Use a private codespace structure in the cmd pkg to encapsulate common
  behavior
2021-10-06 11:44:26 -04:00
Jose Garcia
017632d63d Merge branch 'trunk' of github.com:cli/cli into jg/choose-codespace-prompt 2021-10-06 09:57:39 -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
7fe8357d40 Better short name 2021-10-05 13:30:17 -04:00
Jose Garcia
975bd7c08a Change choose codespace prompt
- Repo + branch is favored
- Codespace name is included to disambiguate between two codespaces
- Move Codespace model out of out API into its own package
- Update call sites and group behavior under codespace.Codespace
2021-10-05 11:23:12 -04:00
Jose Garcia
94953ed3fc Merge branch 'trunk' of github.com:cli/cli into jg/move-codespace-api 2021-09-30 11:52:22 -04:00
Jose Garcia
b5bbb442fd Move internal/api to internal/codespaces/api 2021-09-30 11:06:43 -04:00
Jose Garcia
f4a5f82312 Move internal/liveshare to pkg/liveshare 2021-09-30 10:34:27 -04:00
Mislav Marohnić
f749590e87 Replace old "github/ghcs" import statements 2021-09-28 16:57:56 +02:00
Mislav Marohnić
ca0f89d3bc Introduce an App struct that executes core business logic
The Cobra commands are now a light wrapper around the App struct.

Co-authored-by: Jose Garcia <josebalius@github.com>
2021-09-24 17:20:34 +02:00
Jose Garcia
f4396e8f1a Inline go-liveshare with history 2021-09-23 11:28:04 -04:00
Jose Garcia
e8e914c220 PR Feedback
- Upgrade to go-liveshare v0.19.0
- Remove export helper method
- Use local implementation
2021-09-21 10:05:48 -04:00
Jose Garcia
7f682f9c39 Close Live Share sessions
- New helper method codespaces.CloseSession to be used using defer
- Upgrade to go-liveshare v0.17.0
2021-09-20 16:56:57 -04:00
Jose Garcia
42e47a98d7 add docs, simplify map, error on invalid args 2021-09-16 15:22:47 -04:00
Jose Garcia
10ad85486f Merge pull request #154 from github/jg/fix-ctx-error
ghcs create/ssh: fix ctx cancellation errors & fix todo for X11 forwarding
2021-09-15 15:45:35 -04:00
Jose Garcia
45a9715e9f Merge pull request #158 from github/jg/go-liveshare-0.16.0
upgrade to go-liveshare 0.16.0
2021-09-15 15:40:58 -04:00
Jose Garcia
ecd0c70567 upgrade to go-liveshare 0.16.0 2021-09-15 15:15:28 -04:00
Alan Donovan
06719866c9 move api to internal/ 2021-09-15 13:13:10 -04:00
Jose Garcia
547c629220 fix ctx cancellation errors & fix todo for X11 forwarding 2021-09-15 10:38:19 -04:00
Alan Donovan
2c660fa2e5 avoid ListenTCP helper 2021-09-03 12:55:40 -04:00
Alan Donovan
a56a84947a Update ghcs for go-liveshare@v0.12.0 2021-09-03 10:11:29 -04:00
Alan Donovan
981b2545bc sketch of changes for https://github.com/github/go-liveshare/pull/13 2021-09-02 17:08:17 -04:00
Alan Donovan
4e2c20606a Merge branch 'main' into join-session 2021-09-02 15:57:34 -04:00
Alan Donovan
3485bacc97 fix StartSharing data race 2021-09-02 15:53:56 -04:00
Alan Donovan
8570f4111d sketch after API changes in go-liveshare#11 2021-09-02 12:38:27 -04:00
Alan Donovan
65c19a3317 Merge pull request #107 from github/spelling-again
use correct correct spelling of codespace
2021-09-02 11:38:25 -04:00
Alan Donovan
72a2099a50 fix breakage from API changes 2021-09-01 17:50:24 -04:00
Alan Donovan
49ccdd3d21 use correct correct spelling of codespace 2021-09-01 17:26:26 -04:00
Alan Donovan
3aad0bbeb4 check context error in PollPostCreateStates 2021-08-31 17:27:53 -04:00
Alan Donovan
37b2f5e979 Merge branch 'main' into runcommand 2021-08-31 17:18:52 -04:00
Alan Donovan
f1c3a22a0b Merge branch 'main' into product-spelling 2021-08-31 16:24:41 -04:00
Jose Garcia
ebb04d1753 format code 2021-08-31 19:52:32 +00:00
Jose Garcia
535d832f8a small tweak 2021-08-31 15:50:04 -04:00