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

Allow deploy without prior stage when FORCE_DEPLOY environment is true #72

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

AaronMoat
Copy link
Contributor

@AaronMoat AaronMoat commented Jun 29, 2024

A pattern that is used with stratus may be to stage in branch builds, and deploy in default branch builds.

Upon disasters, like accidental stack deletions or failed changes, retrying a build on a default branch to re-create the infrastructure or roll back, without worrying about making a temporary branch and staging, would be a fast path to recovery. This PR allows this to happen if and only if stratus finds a FORCE_DEPLOY environment variable set to true.

Is this worth documenting? The error message will tell you what to do in a pinch.

A pattern that is used with stratus may be to `stage` in branch builds,
and `deploy` in default branch builds.

Upon disasters, like accidental stack deletions, retrying the default branch
to re-create the infrastructure, without worrying about making a temporary branch and staging,
would be a fast path to recovery.
@AaronMoat AaronMoat changed the title Allow deploy without prior stage Allow deploy without prior stage when FORCE_DEPLOY environment is true Jul 1, 2024
Copy link
Owner

@72636c 72636c left a comment

Choose a reason for hiding this comment

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

Thank you!

@@ -16,8 +18,18 @@ func Deploy(
logger.Title("Find existing change set")

changeSet, err := client.FindExistingChangeSet(ctx, stack)

if err != nil {
Copy link
Owner

Choose a reason for hiding this comment

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

I'm a bit rusty, are there any scenarios where err != nil apart from the change set not existing, where we should continue to short circuit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, there's a few exceptional things that could be bubbled from AWS SDK calls. Would be the pattern here to define a custom error? My go is rustier (in the sense it never existed) than your stratus

Copy link
Owner

@72636c 72636c Jul 1, 2024

Choose a reason for hiding this comment

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

I'm too far detached to speak to idiomatic Go, but I'd be supportive of smuggling through an additional changeSet == nil, err == nil state for "change set does not exist".

@AaronMoat AaronMoat requested a review from 72636c July 1, 2024 09:41
Copy link
Owner

@72636c 72636c left a comment

Choose a reason for hiding this comment

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

🙇

@72636c 72636c enabled auto-merge (squash) July 2, 2024 23:05
@72636c 72636c merged commit eb4c699 into 72636c:main Jul 2, 2024
3 checks passed
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