Commit graph

51 commits

Author SHA1 Message Date
Babak K. Shandiz
f498f2e882
fix: resolve copyloopvar issues
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:26 +00:00
Azeem Sajid
33c30d5bd1 Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
David Gardiner
581b6652e2 Resolve race condition in codespaces connection 2023-10-31 12:19:14 -07:00
Heath Stewart
7738b6187c
Add headers to all tables (#8157) 2023-10-20 11:20:02 +02: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
Alexander Seiler
218f29f296
Correct some typos 2023-04-21 03:51:31 +02:00
Caleb Brose
09e86d0ebf
Fix gh cs ports requiring sudo for privileged port numbers (#7326) 2023-04-19 07:00:44 -05:00
JP Ungaretti
5a7f779cf7 Merge branch 'trunk' into jungaretti/fix-jupyter-spinner 2023-03-07 18:43:34 +00:00
Caleb Brose
57c73e8239
Add --repo filter to more gh codespaces commands (#6669)
* Add --repo flag to commands

* Example of using common args

* Add -r to stop

* Add validation to the add helper

* Skip prompt for single option

* Migrate (mostly) everything to addGetOrChooseCodespaceCommandArgs

* Fix typo in logsCmd

* Use R instead of r

* Update a couple -r usages

* Refactor to codespace_selector

* Clean up selector, apply it in a couple examples

* Use apiClient instead in constructor

* Restore addDeprecatedRepoShorthand

* Finish implementing the commands

* Update existing tests to use the selector

* Add tests for selector

* linter

* Catch case where there's no conflict

* Make the flag persistent for ports

* Add support to stop
2023-02-22 17:16:36 -06:00
JP Ungaretti
a388358348 Merge branch 'trunk' into jungaretti/fix-jupyter-spinner 2023-02-09 23:18:22 +00:00
JP Ungaretti
970088a7af Adopt in ports.go 2023-02-09 22:52:04 +00:00
Caleb Brose
2b95cbc5a6 Close port forward writer on reader 2023-01-19 20:22:24 -06:00
Jake Shorty
1cb62b182c Use new domain for forwarded ports 2022-12-08 18:36:26 +00:00
Mislav Marohnić
3fe5026d39
Migrate to tableprinter from go-gh (#6346) 2022-10-17 15:15:39 +02:00
casswedson
00bc550dc6 chore: typo hunting ft. codespell 2022-07-09 21:41:09 -05:00
Mark Phelps
669b0fa981 dont need assignment 2022-05-17 13:36:15 +00:00
Mark Phelps
48bb894277 filter out internal ports from gh cs ports list 2022-05-16 12:40:24 -07:00
JP Ungaretti
ceba2c896b Use safeClose instead of Close 2022-04-28 18:38:46 +00:00
JP Ungaretti
3216d1bb3a Remove function return 2022-04-21 14:29:30 -07:00
JP Ungaretti
4452f37819 Clarify session helper 2022-04-14 17:10:11 -05:00
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