Skip to content
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

fix: make review app URLs predictable #806

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rowanmanning
Copy link
Member

@rowanmanning rowanmanning commented Mar 7, 2025

Tip

This is a draft PR because the --ephemeral-id argument has not been added to Hako yet. We'll need that work to happen and then we'll also need to update the Hako version as part of this PR.

Description

We now generate a hash based on the branch name and use this as a suffix on review app names. This means a couple of things:

  1. Review app names are predictable
  2. Only one review app will be created per branch, with future commits to that branch updating the existing review app instead of deploying another one

This is good for a couple of reasons:

We can now hand the review app URL off to future jobs. This is important for the n-test and cyprus plugins which expect a URL in the review or staging state.

We will stop creating a new review app for every commit, we're already seeing way too many review apps get created which is a problem while we don't have automatic deletion of old review apps.

Changes to a PR will deploy faster because most of the review app CloudFormation stack will have been created already - we'll be doing updates instead of fully creating a new stack on each commit.

See-also: CPREL-1300

Checklist:

  • My branch has been rebased onto the latest commit on main (don't merge main into your branch)
  • My commit messages are conventional commits, for example: feat(circleci): add support for nightly workflows, fix: set Heroku app name for staging apps too

@rowanmanning rowanmanning requested a review from a team March 7, 2025 12:19
Copy link
Contributor

@ivomurrell ivomurrell left a comment

Choose a reason for hiding this comment

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

looks good so far! let's see how the hako implementation goes.

@rowanmanning rowanmanning force-pushed the predictable-review-apps branch from dd0cf4b to 0fa2947 Compare March 10, 2025 16:55
We now generate a hash based on the branch name and use this as a suffix
on review app names. This means a couple of things:

  1. Review app names are predictable
  2. Only one review app will be created per branch, with future commits
     to that branch updating the existing review app instead of
     deploying another one

This is good for a couple of reasons:

We can now hand the review app URL off to future jobs. This is important
for the n-test and cyprus plugins which expect a URL in the `review` or
`staging` state.

We will stop creating a new review app for every commit, we're already
seeing way too many review apps get created which is a problem while we
don't have automatic deletion of old review apps.

Changes to a PR will deploy faster because most of the review app
CloudFormation stack will have been created already - we'll be doing
updates instead of fully creating a new stack on each commit.

See-also: https://financialtimes.atlassian.net/browse/CPREL-1300
@rowanmanning rowanmanning force-pushed the predictable-review-apps branch from 0fa2947 to d0af161 Compare March 10, 2025 16:59
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