Commit graph

26 commits

Author SHA1 Message Date
minxinyi
21b08bdd20
refactor: use slices.Equal to simplify code (#11364)
Signed-off-by: minxinyi <minxinyi6@outlook.com>
2025-08-26 15:29:19 -06: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
Robin Neatherway
78fb90956c
Teach gh cs create to use current repo as default (#6596)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-02-07 20:05:38 +00:00
Luan Vieira
d4c9890c5a
Default to authenticated user on codespace delete (#6944)
When a username option is not provided for the `gh codespace delete`
command, we will use the authenticated user's login as the default to
avoid deleting anyone else's codespace by mistake.

Prior to this change, running `gh codespace delete --org MYORG --all`
would fetch all of the codespacese associated with the org regardless of
user and then only delete the ones associated with the authenticated
user, which would lead to 404 errors when MYORG had codespaces owned by
members other than the authenticated member.

Co-authored-by: Victoria Dye <vdye@github.com>
Co-authored-by: Lessley Dennington <ldennington@github.com>
2023-02-07 20:46:08 +01:00
John Keech
791c7db632
Fix typo in has_uncommitted_changes for codespaces (#6812)
The REST API for codespaces returns the following schema:
```
"git_status": {
    "ahead": 0,
    "behind": 0,
    "has_unpushed_changes": false,
    "has_uncommitted_changes": false,
    "ref": "main"
  },
  ```

  The CLI was looking for `has_uncommited_changes` in the response instead of `has_uncommitted_changes`, leading to it always reporting a `false` value which could be different than the API response.
2023-01-05 22:02:32 +00:00
Caleb Brose
0c00ca911e Clean up API interface 2022-09-16 22:25:11 +00: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
Ashwin Jeyaseelan
47f5abdb6f
8gitbrix/add delete org codespace (#5827)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-06-22 18:28:09 +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
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Mark Phelps
590acaa1d6 WIP 2022-02-15 19:35:53 -05:00
Mislav Marohnić
3b7e5fc246 Store Executable() information on codespaces App
This is to avoid having to explicitly pass it to each subcommand that
needs it. Each codespaces command runs in the context of App, so that's
a point of shared context that we can store state in.
2021-12-21 14:03:10 +01: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
5e56b4a7ce Fix tests 2021-10-14 09:21:03 -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
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
8a559ee12a Fix unrelated tests 2021-10-07 15:38:16 -04:00
Jose Garcia
7c497f283b Update test signature 2021-10-06 09:15:07 -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
a2e6df18e7
Merge pull request #4432 from cli/jg/rename-pkg
codespace: rename the cmd pkg to codespace
2021-10-05 08:23:36 -04:00
Jose Garcia
d02876e6ea Rename the cmd pkg to codespace 2021-10-04 14:16:04 -04:00
Jose Garcia
6b1876161d Update DeleteCodespaces to new API endpoint
- Drop the need for the user argument
- Update mocks
- Remove no longer applicable TODO comment
- Show message for successful deletion (this regressed)
2021-10-01 12:53:35 -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/delete_test.go (Browse further)