Skip to content

Improve application previews by preventing naming collision #36

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

Merged
merged 17 commits into from
Aug 9, 2024

Conversation

lukqw
Copy link
Member

@lukqw lukqw commented Aug 8, 2024

Background

While working on the blog post around ephemeral instances, @remotesynth and @HarshCasper both ran into the same issue:
Pushing two commits in close succession would first yield a successful application preview deployment, while the second commit would run into an error with an already_exists message.
This is because the name of the instance was already taken by the first commit and related preview deployment.

Solution

This PR changes the naive approach that was previously used:
Instead of simply calling our creation endpoint, we first detect whether an instance with the same name is already running, and shut it down in case that's true, before starting the instance.

Copy link

github-actions bot commented Aug 8, 2024

The ephemeral instance for the application preview has been shut down

@lukqw lukqw requested a review from lakkeger August 8, 2024 15:54
@lukqw lukqw changed the title make ephemeral instance deployment smart, by checking for existing instances Improve application previews by preventing naming collision Aug 8, 2024
Copy link
Contributor

@lakkeger lakkeger left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for tackling it 💯 🎉 🚀

@lakkeger lakkeger merged commit 5b17176 into main Aug 9, 2024
5 checks passed
@lakkeger lakkeger deleted the retrigger-deployment branch August 9, 2024 10:43
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