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>
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.
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.
* 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>
- 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
- Drop the need for the user argument
- Update mocks
- Remove no longer applicable TODO comment
- Show message for successful deletion (this regressed)