Skip to content

Conversation

lourens-octopus
Copy link
Contributor

@lourens-octopus lourens-octopus commented Oct 6, 2025

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]

Copy link

@Copilot Copilot AI left a 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.

Copy link

@dylanlerch dylanlerch left a 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 {

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) {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants