-
Notifications
You must be signed in to change notification settings - Fork 28
feat: Add function to retrieve all ephemeral environments #368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for retrieving ephemeral environments by introducing V2 environment query types, response models, and a service function to fetch all ephemeral environments.
- Introduces EphemeralEnvironment and related V2 response wrapper types.
- Adds EnvironmentV2Query and a new template including type filtering.
- Implements GetAllEphemeralEnvironments to fetch all ephemeral environments.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
pkg/environments/ephemeralenvironments/ephemeral_environment.go | Adds models for ephemeral environment V2 responses. |
pkg/environments/environment_v2_query.go | Adds query struct supporting type filtering for V2 endpoints. |
pkg/environments/environment_service.go | Adds V2 template constant and a function to retrieve all ephemeral environments. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
pkg/environments/ephemeralenvironments/ephemeral_environment.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start. I'd prefer that we support all of the V2 functionality rather than having an EE specific method that skips paging.
@@ -0,0 +1,7 @@ | |||
package environments | |||
|
|||
type EnvironmentV2Query struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also supports ids and partial name, any reason to not include those here?
} | ||
|
||
// GetAllEphemeralEnvironments returns a response containing all ephemeral environments. If an error occurs, it returns nil. | ||
func GetAllEphemeralEnvironments(client newclient.Client, spaceID string) (*ephemeralenvironments.EphemeralEnvironmentResponse, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not just support all of the V2 functionality (and let the caller specify if they just need ephemeral environments) rather than having a typed method for ephemeral enviornments that skips paging?
I think it would be better to just support all of the V2 endpoint functionality here rather than having separate methods for different types, and the caller can call it how they need.
In order to be able to select an ephemeral environment to deploy to, we have to have the ability to find all ephemeral environments. This code review adds a function that will retrieve all ephemeral environments to the user.
[sc-122277]