Commit graph

448 commits

Author SHA1 Message Date
Uday R
40beb82e0c fix: list branches in square brackets in gh codespace 2024-12-10 15:19:30 -05:00
bagtoad
677ed2cdcf Refactor command documentation to use heredoc 2024-11-21 13:23:03 -07:00
Caleb Brose
509a181d79
Remove unimplemented tests 2024-11-06 19:10:28 +00:00
Caleb Brose
940560acf2
Fix ssh directory 2024-11-06 16:13:29 +00:00
Caleb Brose
b4c221dfb7
Create the automatic key when specified with -i 2024-11-05 22:30:15 +00:00
Yukai Chou
d7b8ecf33d Unify use of tab indent in non-test source files
Found with
    rg '(^ | \t|\t )' -g '*.go' -g '!*_test.go'

Mixed indent exceptions:
- wrapped long list items with extra 2-space indent
- code snippets using space indent
- commented code lines having "\t*// \t+" prefix
2024-08-03 00:35:30 +08:00
David Gardiner
400db0f41b Fix linting error 2024-01-30 13:24:23 -08:00
David Gardiner
2cb044caf5 Parse SSH args before creating the shell 2024-01-30 13:16:46 -08:00
David Gardiner
8c77e53c35 Send activity signals during non-interactive codespace SSH command 2024-01-29 19:20:51 -08:00
David Gardiner
20273d1f17 Move create codespace permission opt out behind else to fix token permissions 2024-01-12 12:16:38 -08:00
Andy Feller
c7c74dd422
Merge pull request #8342 from muzimuzhi/docs/unify-markup
Unify doc mark-ups
2023-12-01 09:31:36 -05:00
Mateus Marquezini
7a32b8b5f3 some code improvements after code review 2023-11-27 17:17:24 -03:00
Yukai Chou
ba585149c3 Leftovers 2023-11-23 07:12:47 +08:00
Yukai Chou
07a87ca8a4 Wrap special values and placeholders like - and $1 2023-11-23 07:09:29 +08:00
Mateus Marquezini
7af33d090a added a new error handling when the display name flag exceeds 48 characters #8356 2023-11-20 18:45:12 -03:00
Yukai Chou
21bf1babdf Proof-reading 2023-11-17 02:04:35 +08:00
Yukai Chou
5612d2864e Add leftovers 2023-11-17 01:32:29 +08:00
Yukai Chou
8eec3e8040 Wrap path to file in backticks 2023-11-17 01:32:29 +08:00
Yukai Chou
b70c28ba20 Misc docs improvements 2023-11-17 01:32:28 +08:00
David Gardiner
581b6652e2 Resolve race condition in codespaces connection 2023-10-31 12:19:14 -07:00
David Gardiner
500f359592
Don't poll for addition codespace permissions if user chooses to create without them (#8267) 2023-10-30 13:22:38 -05:00
Sam Coe
5023b61909
Remove uses of FuzzyAgoAbbr in tables (#8222) 2023-10-22 17:33:49 +02:00
Heath Stewart
7738b6187c
Add headers to all tables (#8157) 2023-10-20 11:20:02 +02:00
David Gardiner
135c56aead Fix linting error 2023-10-16 10:09:04 -07:00
David Gardiner
a8f8728056 Poll permission acceptance endpoint on codespace creation 2023-10-12 16:55:13 -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
David Gardiner
e059f32aa5 Forward codespace ports over Dev Tunnels 2023-09-27 13:42:40 -07:00
Josh Gross
c5f88bb551
Show full permissions URL in gh cs create (#7983)
* Show full permissions URL in `gh cs create`

* Validate that full permissions URL is displayed
2023-09-12 10:12:53 -07:00
John Keech
93e1511bae
Codespaces: Use the host name from the logged in server for commands (#7795)
* Use the host name from the logged in server for codespace commands

* Fix existing tests

* Add tests for server url configuration

* Rename defaultApiUrl to defaultAPIURL and comment cleanup

* Switch to t.Setenv in codespaces api tests

* Switch to t.Setenv in other tests

* Support custom server in web flows for list and create

* Rename GetServerURL() to ServerURL()
2023-08-08 09:32:06 -07:00
Jose Garcia
37d8e9e915 Support --server-port behavior with conn details 2023-07-02 20:55:56 -04:00
David Gardiner
acf7dadaeb Codespaces view command updates 2023-06-07 11:04:17 -07:00
David Gardiner
290b802bf7 Remove unused type 2023-05-30 14:22:12 -07:00
David Gardiner
15e1fa510d Add test 2023-05-30 14:19:15 -07:00
David Gardiner
82650b364b Fix linting error 2023-05-30 12:53:46 -07:00
David Gardiner
5b83d55186 Don't display retention period if 0 days 2023-05-30 12:45:53 -07:00
David Gardiner
3c05c99c83 Address comments 2023-05-30 12:20:23 -07:00
David Gardiner
f6a5398bf9 Update fields to show 2023-05-26 22:59:28 +00:00
David Gardiner
99cd0af8b4 Check if running in a codespace 2023-05-26 15:41:34 -07:00
David Gardiner
54560c19dd Add gh cs view command 2023-05-26 09:54:58 -07:00
Kousik Mitra
8d0f211fdb
Print message after codespace deletion (#7353) 2023-05-09 20:56:54 -05:00
Kousik Mitra
d0207a2ede
Add capability to filter codespaces by repo owner (#7347)
* Add capability to filter codespaces by repo owner

* Replace Flags with PersistentFlags

* Reword flag description

* Update test seed

* Add mutual exclusion

---------

Co-authored-by: Caleb Brose <5447118+cmbrose@users.noreply.github.com>
2023-04-27 10:42:08 -05: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
John Keech
4b5a9032fe
Clarify how SSH keys are selected (#7325)
Fixes: https://github.com/orgs/community/discussions/52556

Update the help text for `gh codespace ssh` to provide more details about how SSH keys are selected.
2023-04-17 10:19:03 -07:00
Navaneethan
c0855a3e61
Fix typo in cs stop command: Stoppping -> Stopping (#7318) 2023-04-14 14:08:42 -05:00
doaortu
83322104b7
feat: add web flag for codespace list & create subcommand (#7288)
* feat: add web flag to cs list subcommand

web flag only works with repo flag, because,
currently there only param for listing with repo_id

* feat: add web flag to cs crate subcommand

web flag used for creating codespace through web UI instead of terminal.
web flag cannot be used with display-name, idle-timeout,
or retention retention-period
because there's no option for that in the Web UI

* refactor: extract mutual excusive logic to PreRunE

- changed web flag mutual exclusive logic, using cmdutil
- extract that logic to PreRunE clause in createCmd
- move web flag up to make it close to PreRunE clause (for clarity)
- add new param to newCreateCmd fn to facilitate test logic
- apply new newCreateCmd fn to root.go

* fix: clarify flag desc and error message

- remove 'yet' from error messages that can cause misunderstanding
- clarify list web flag can only be used with repo flag

* fix: skip machine check when we use web flag ...
(..and no machine flag provided)

+ add test for this new case
+ adjust related test cases for this new change.

* refactor: move flag check logic to PreRunE

why: err on PreRunE or RunE will also print help if error happened

+ move web, repo, org, user mutual exclusive logic to PreRunE clause
+ move repo, org, user mutual exclusive logic to PreRunE
+ move limit check flag to PreRunE
+ modify newListCmd fn to facilitate test logic
+ apply new newListCmd to root.go
+ add test cases to check PreRunE clause
- remove mutual exclusive test cases from Test_AppList

* refactor: remove the opts equality checks

* fix: mutually exclusive misfires
because of wrong logic

+ refine test case too

* cleanup:removing useWeb check in fn getMachineName

because it's no longer needed

+ remove redundant test-case

* refactor: remove redundant ifs

* refactor: clarify test name

* re-clarify web flag desc in list.go

* refactor: break long lines, use more idiomatic err

* add test case for nonexistent/wrong machine
2023-04-13 10:37:16 -05:00
Caleb Brose
27a3fcc807 Fix invoker immediately closing 2023-04-05 19:33:50 -05:00
Mislav Marohnić
1933fc2f69
codespace ssh: fix "connection reset by peer" 2023-03-09 15:14:39 +01:00
JP Ungaretti
0673dcccb1 Fix delete tests 2023-03-07 19:29:44 +00:00
JP Ungaretti
39a1dc90af Match return style 2023-03-07 19:05:49 +00:00