Commit graph

54 commits

Author SHA1 Message Date
Kynan Ware
8a063f6b57 Add godoc comments to exported symbols in internal/codespaces
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 16:01:51 -07:00
Caleb Brose
0c8591064d Change back to exponential backoff 2025-01-17 14:09:33 -06:00
Caleb Brose
31bff5b5a8 Better handling for codespace state polling 2025-01-17 14:09:33 -06: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
David Gardiner
e059f32aa5 Forward codespace ports over Dev Tunnels 2023-09-27 13:42:40 -07:00
azarashi
bb42fa07aa
codespace: Handle HTTP request retry interruption (#7846)
* codespace: Handle HTTP request retry interruption

* codespace: Make the error message more detailed
2023-08-18 07:16:06 -07:00
Caleb Brose
09e86d0ebf
Fix gh cs ports requiring sudo for privileged port numbers (#7326) 2023-04-19 07:00:44 -05:00
Sam Coe
35a24caed2
Standardize retry mechanism (#7027) 2023-03-02 23:06:30 +00:00
Caleb Brose
e489050715 Merge remote-tracking branch 'origin/trunk' into cmbrose/pf-half-close 2023-01-19 20:39:58 -06:00
Caleb Brose
2b95cbc5a6 Close port forward writer on reader 2023-01-19 20:22:24 -06:00
David Gardiner
73dfb87680
Use gRPC client to notify codespace of activity (#6870)
* Use gRPC client to notify codespace of activity

* Add test

* Update comment
2023-01-18 16:31:16 -06:00
Cody Taylor
9a80d9c65c Adds max interval and conditional check on elapsed time 2022-10-31 15:23:54 -05:00
Cody Taylor
893bc25bcc Adds exponential backoff to ConnectToLiveshare; Fixes #5738 2022-10-31 13:55:33 -05:00
Mislav Marohnić
8c5ae36311 Clean up progress indicator if codespace fails to start 2022-06-06 14:32:01 +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
Jose Garcia
3544275c2f Implement new API payload for a Codespace 2021-10-14 09:10:15 -04:00
Jose Garcia
97b52b30fc Merge branch 'trunk' of github.com:cli/cli into jg/liveshare-keepalive 2021-10-13 10:45:40 -04:00
Jose Garcia
77a86e8611 Fix for API response body change
- Connection is now embedded within the top level of the Codespace
  payload instead of inside the environment.
2021-10-13 08:07:59 -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
a3efb53c44 Update API.StartCodespace to use new API endpoint
- Switch to using name instead of GUID
- Remove GUID from the code since it is not used anywhere else
- Add docs to the api client methods
- Re-gen mocked client
2021-10-04 08:32:02 -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
Jose Garcia
5b5c3da393 Validate host public keys 2021-09-30 08:16:28 -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
f1c35ba9da Update docs 2021-09-23 10:21:01 -04:00
Jose Garcia
9654dc4bd3 Update to go-liveshare v0.20.0 2021-09-23 10:07:14 -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
a83b3c0816 Update to go-livesare v0.18.0
- Only set err if closeErr is non-nil
2021-09-21 08:46:32 -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
Mislav Marohnić
dbb4e0c177 Merge remote-tracking branch 'origin' into ruleguard 2021-09-16 11:46:50 +02:00
Alan Donovan
06719866c9 move api to internal/ 2021-09-15 13:13:10 -04:00
Mislav Marohnić
fb5a35568c Ensure original errors are wrapped with "%w" instead of "%v" 2021-09-15 13:58:41 +02:00
Alan Donovan
cbb8253544 consolidate survey functions 2021-09-09 11:57:37 -04:00
Alan Donovan
4e2c20606a Merge branch 'main' into join-session 2021-09-02 15:57:34 -04:00
Alan Donovan
8570f4111d sketch after API changes in go-liveshare#11 2021-09-02 12:38:27 -04:00
Alan Donovan
49ccdd3d21 use correct correct spelling of codespace 2021-09-01 17:26:26 -04:00
Alan Donovan
bbcf2dd321 spell product names (Codespaces, Live Share) correctly 2021-08-31 11:15:26 -04:00
Jose Garcia
634796e8a8 merge main 2021-08-27 18:18:30 -04:00
Jose Garcia
1e8a8370fe initial round of PR feedback 2021-08-27 16:29:02 -04:00
Jose Garcia
2cc91c224e add comment for improvements 2021-08-27 12:53:27 -04:00
Jose Garcia
cb6552f4ca more efficient impl for processing states 2021-08-27 12:50:32 -04:00
Alan Donovan
38ff786a7d cmd/ghcs: style tweaks 2021-08-27 12:03:20 -04:00
Jose Garcia
46ee45bcdd simplify the state iteration 2021-08-24 17:46:24 -04:00
Jose Garcia
55f0dad3db merge upstream 2021-08-19 18:30:10 +00:00
Mislav Marohnić
20d75f0ff9 Normalize logging, output, and error reporting
- Return errors as errors, not print to stdout and return nil
- Ensure errors and warnings are always written to stderr, not stout
- Do not print progress to stdout unless stdout is a terminal
2021-08-12 14:37:23 +02:00