Commit graph

38 commits

Author SHA1 Message Date
Andy Feller
d2cd14b4cd Remove out of scope changes, update list commands
After discussing this with the team, the `gh config` changes to display `accessible_colors` have been removed from this branch being outside of acceptance criteria.  This will be moved to a separate issue along with any other work needed to finalize the public preview such as `gh help` entries for `GH_ACCESSIBLE_COLORS` environment variable.

List commands that use ColorScheme.Gray have been updated to use ColorScheme.Muted.
2025-03-31 11:58:30 -04: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
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
David Gardiner
54560c19dd Add gh cs view command 2023-05-26 09:54:58 -07: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
JP Ungaretti
f77eb5f932 Adopt in list.go 2023-02-09 22:48:29 +00:00
Caleb Brose
57c53e6268 linter 2022-12-12 21:21:23 +00:00
Caleb Brose
8e0b4ef21b Use -R for --repo shorthand and deprecate -r 2022-12-12 19:44:59 +00:00
Mislav Marohnić
3fe5026d39
Migrate to tableprinter from go-gh (#6346) 2022-10-17 15:15:39 +02:00
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
Mark Phelps
38ea62afba
Codespaces list by repo (#5854)
* WIP

* Allow to list codespaces by repo

* Tests

* Cleanup

* respond to PR feedback

* Address review comments
2022-06-28 13:34:04 +00:00
Mislav Marohnić
6e3689d58b
Apply UI polish around codespaces org-admin commands (#5843) 2022-06-22 20:35:56 +02:00
Greggory Rothmeier
2294f49d07
Add support for org admins to stop a members codespace (#5812) 2022-06-22 13:56:22 +02:00
Greggory Rothmeier
4b36dc031f
Add flag to list codespaces under an organization (#5807)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-06-21 13:57:40 +00:00
Jose Garcia
7191960694 Add Display Name to the list command 2022-05-03 16:17:53 -04:00
Roshan Padaki
13342cb272
Don't error on list commands when no results found (#5479)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-04-25 17:55:52 +00:00
Charlie Andrews
10e43b5136 Use color variable instead of literal for disabled reason 2022-03-16 08:43:34 -04:00
Charlie Andrews
3d28c52104 Mark codespace with pending op as disabled with reason instead of state 2022-03-15 17:21:24 -04:00
GitHub Action
94128d683c Add consts for targets and treat empty as prod 2022-03-10 19:59:24 -06:00
GitHub Action
5e62a417d8 Add emojis to name 2022-03-10 18:50:12 -06:00
GitHub Action
d85feafa85 Rename to hasNonProdVSCSTarget 2022-03-10 17:05:13 -06:00
GitHub Action
be5923770b Add vscs-target to gh cs list 2022-03-10 16:42:31 -06:00
Christian Gregg
c5dbf20ed4
Alias list as ls for all commands (#5214)
I always get tripped up whenever trying to list my codespaces, adding
`ls` as an alias to `list` feels natural enough.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-02-17 13:53:42 +01:00
Mislav Marohnić
badbf515cb codespace list: support --json and --template export flags 2021-10-22 14:13:15 +02:00
Alan Donovan
2f7f224c9e
Merge pull request #4584 from cli/FlagErrorf
Add FlagErrorf; encapsulate FlagError.error
2021-10-21 14:14:05 -04:00
Mateusz Urbanek
67595110e8
Improve table output from codespace list command (#4516)
Co-authored-by: Jose Garcia <josebalius@github.com>
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-10-21 16:42:08 +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
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
Jose Garcia
3544275c2f Implement new API payload for a Codespace 2021-10-14 09:10:15 -04:00
Mateusz Urbanek
cedbbe3c2a
Add limit flag to codespace list (#4453)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-10-11 18:32:40 +00: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
a8d1718f21 Merge branch 'trunk' of github.com:cli/cli into jg/choose-codespace-prompt 2021-10-05 12:57:11 -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
d02876e6ea Rename the cmd pkg to codespace 2021-10-04 14:16:04 -04:00
Jose Garcia
05297b8c8d Update ListCodespaces to use new API endpoint
- Removes the need for a User to list codespaces which should result in
  a slight speed improvement.
2021-10-01 10:37:15 -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/list.go (Browse further)