Commit graph

27 commits

Author SHA1 Message Date
William Martin
1d38230675
Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
William Martin
5007c18f5f Fix unused params across project 2024-05-07 17:50:43 +02:00
Sam Coe
4a57a812f5
Upgrade to Go 1.21 (#7843) 2023-08-16 10:37:58 -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
Alexander Seiler
218f29f296
Correct some typos 2023-04-21 03:51:31 +02:00
Sam Coe
35a24caed2
Standardize retry mechanism (#7027) 2023-03-02 23:06:30 +00:00
Des Preston
4ade907ae8
Allow setting codespace display name during create (#6739)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-12-19 17:10:34 +01:00
Mark Phelps
6014b31d03 Fix case where codespace created while in provisioning state causes panic 2022-07-01 13:08:44 -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
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
Greggory Rothmeier
06153770a9
Merge pull request #5504 from greggroth/gregg/retention-period
Add support for setting codespace retention-period
2022-05-10 18:21:55 +02:00
Charlie Andrews
7ca31e02b4 Disallow editing a codespace that has a pending operation
This is already prevented by the API, but this will make the error
message cleaner and easier to understand for the user.

Example of old error message:

```
$ gh cs edit -c cwndrws-redacted -d "some silly name"
error editing 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)
exit status 1

```

Example of new error message:

```
$ gh cs edit -c cwndrws-redacted -d "some silly name"
error editing codespace: codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
2022-03-16 10:13:46 -04:00
Patrick Veverka
86feaff6a9 little bit of testing 2022-02-24 20:21:06 +00:00
Patrick Veverka
3d093d1a95 some tests 2022-02-17 02:23:17 +00:00
Patrick Veverka
133be27d99 wip tests 2022-02-16 13:35:46 +00:00
Mislav Marohnić
a5dddbc1bf Fix lint error 2022-01-31 11:45:00 +01:00
Caleb Brose
eeeb73a3e3
Repo name suggestions for cs create (#5108)
Co-authored-by: Alan Donovan <alan@alandonovan.net>
2022-01-31 10:20:49 +00:00
Marwan Sulaiman
fac2575c73
Add retries to Codespaces API client (#5064) 2022-01-25 18:54:20 +01:00
Marwan Sulaiman
a3940020f9
Inherit API endpoint configuration from the Codespaces environment (#4723)
gh codespace commands now respect the following environment variables:

- GITHUB_SERVER_URL: typically "https://github.com"
- GITHUB_API_URL: typically "https://api.github.com"
- INTERNAL_VSCS_TARGET_URL: typically "https://online.visualstudio.com"
- GITHUB_TOKEN when CODESPACES is set, even if the host connecting to isn't "github.com".

This set of changes ensures that `gh codespace` commands automatically connect to the right API endpoints when gh is used within a codespace.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-11-22 12:40:01 +01: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
Gabriel Ramírez
20ae9d305d
Fetch 100 codespaces by default 2021-10-06 14:53:55 +00:00
Gabriel Ramírez
34f9c0a67c
Updating docs and interation exit condition to not check the final page 2021-10-06 14:18:44 +00:00
Gabriel Ramírez
61b0fe36b2
Adding additional tests for mid-flight deletions and additions 2021-10-05 21:31:47 +00:00
Gabriel Ramírez
409cd9c388
Fixing Has() issue due to go version 2021-10-05 18:49:41 +00:00
Gabriel Ramírez
777978644c
Adding pagination to list codespaces 2021-10-05 16:49:40 +00: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
b5bbb442fd Move internal/api to internal/codespaces/api 2021-09-30 11:06:43 -04:00
Renamed from internal/api/api_test.go (Browse further)