Skip to content

feat: Add Ephemeral Environment methods to environment repository#233

Merged
stevencl840 merged 1 commit intomainfrom
sjc/add-ephemeral-environment-endpoitns
Oct 9, 2025
Merged

feat: Add Ephemeral Environment methods to environment repository#233
stevencl840 merged 1 commit intomainfrom
sjc/add-ephemeral-environment-endpoitns

Conversation

@stevencl840
Copy link
Copy Markdown
Contributor

@stevencl840 stevencl840 commented Oct 6, 2025

Context 🌇

Ephemeral environments are temporary environments that developers can use to test changes. They are expected to come and go with the same cadence as a PR, created when the PR is opened and torn down when it is merged.

Users would like to be able to manually deploy their release to their ephemeral environment rather than having it deployed automatically when the release is created.

Details 🔍

Users want to be able to deploy to an ephemeral environment from their GitHub Action workflow. This means they will need to be able to create the ephemeral environment from the same workflow. When the PR has been closed, users would like to deprovision their project from the ephemeral environment.

In order to add new GitHub Actions to facilitate this, we need to update the Typescript API client so we can call the required endpoints. As such, I have added new methods to environmentRepository to call the createEphemeralEnvironment and deprovisionedEphemeralEnvironmentForProject endpoints. I have also added a getEnvironmentByName method, which is compatible with ephemeral environments and will allow us to resolve the ID of an environment from its name. This will be necessary for the deprovisioning action.

Testing 🧪

I have added examples that cover the new methods, which I have used to test that the repository methods work as expected.

Files?? 📁

I moved the utility.ts file from the runbook examples so it is available for all examples. It is not a functionality change, but it did change all the runbook examples. It is worth it.

@stevencl840 stevencl840 marked this pull request as ready for review October 7, 2025 05:13
Copy link
Copy Markdown
Contributor

@geofflamrock geofflamrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, a few small questions and thoughts that I think we'll prob want to look at before we can look to merge this in.

Comment thread src/features/deploymentEnvironments/deploymentEnvironment.ts
Comment thread src/features/deploymentEnvironments/environmentRepository.ts Outdated
return response;
}

async deprovisionEphemeralEnvironmentProject(projectId: string, environmentId: string): Promise<DeprovisionEphemeralEnvironmentProjectResponse> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will also need the ability to deprovision the entire ephemeral environment, are you planning to add in this PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I overlooked the use case.

Comment thread src/features/deploymentEnvironments/environmentRepository.ts Outdated
Copy link
Copy Markdown
Contributor

@geofflamrock geofflamrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further changes look good 👍 just one thought on the order of parameters in the create function. Doesn't need a re-review unless you would like one.

Comment thread examples/src/environments/create-ephemeral-environment.ts Outdated
@stevencl840 stevencl840 force-pushed the sjc/add-ephemeral-environment-endpoitns branch 2 times, most recently from c2102a4 to bf431f8 Compare October 9, 2025 04:04
@stevencl840 stevencl840 changed the title Add ephemeral environment create and deprovision feat: Add Ephemeral Environment methods to environment repository Oct 9, 2025
@stevencl840 stevencl840 force-pushed the sjc/add-ephemeral-environment-endpoitns branch from bf431f8 to 3b7f546 Compare October 9, 2025 04:17
@stevencl840 stevencl840 merged commit 4465f36 into main Oct 9, 2025
5 checks passed
@stevencl840 stevencl840 deleted the sjc/add-ephemeral-environment-endpoitns branch October 9, 2025 04:24
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