Add support for setting codespace retention-period#5504
Merged
Conversation
greggroth
commented
May 3, 2022
internal/codespaces/api/api.go
Outdated
| PermissionsOptOut bool `json:"multi_repo_permissions_opt_out"` | ||
| RepositoryID int `json:"repository_id"` | ||
| IdleTimeoutMinutes int `json:"idle_timeout_minutes,omitempty"` | ||
| RetentionPeriodMinutes int `json:"retention_period_minutes,omitempty"` |
Contributor
Author
There was a problem hiding this comment.
@reybard pointed out that this won't serialize a 0-minute retention period with omitempty so I'll add a test and fix that
There was a problem hiding this comment.
Just to confirm: the user could specify 0 here, in order to indicate they want to delete it immediately upon idle?
There was a problem hiding this comment.
@lostintangent That is correct. It may not be immediate as it's a scheduled job but it should be pretty quick
There was a problem hiding this comment.
Awesome, thanks for confirming that!
With omitempty, it would remove 0 as the empty value of an integer
markphelps
approved these changes
May 9, 2022
Contributor
Author
|
We don't have API support for this flag just yet and it's not ready to ship with the CLI. Sorry I didn't make that very clear in the description. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/github/codespaces/issues/7177
The Codespace creation API will soon support setting a retention period where a codespace will be auto-deleted once it's been idle for that amount of time.