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

Add rollback command to deployer #1614

Merged
merged 1 commit into from
Jan 23, 2023
Merged

Add rollback command to deployer #1614

merged 1 commit into from
Jan 23, 2023

Conversation

amarthadan
Copy link
Contributor

@amarthadan amarthadan commented Jan 18, 2023

Close #1406

At this point src/infrastructure/index.ts should be refactored a bit, some common code can be extracted into functions and the whole thing should be divided into separate files. I'm leaving that for a separate issue.

@amarthadan amarthadan requested a review from a team January 18, 2023 11:59
@amarthadan amarthadan self-assigned this Jan 18, 2023
Copy link
Contributor

@Siegrift Siegrift left a comment

Choose a reason for hiding this comment

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

I tested on AWS, looks good, but found a few edge cases which I think should not be present.

  1. I can rollback even to current version
  2. As a user I'd (or better said I could) expect the rollback to move the string "(current)" in the info output to the rollbacked version. However, what we do is we create a new version with config+secrets from the version to rollback to. I think this could be clarified in the output. E.g. Creating a new version <version_id> with configuration files from version <version_to_rollback>

@@ -1,25 +1,34 @@
import { join } from 'path';
import fs from 'fs';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can we enforce it with eslint? I prefer the member import syntax, but I am OK with this if it's for the consistency sake.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't able to mock the functions from the fs module without it.

@amarthadan
Copy link
Contributor Author

I can rollback even to current version

The thing is that if you don't change your config or secrets and deploy you're doing that anyway. So, it's a bit weird preventing it in one place but allowing it in another. But I get that rollback evocates something in the past. Ok, I'll add a check to prevent rollbacking into a current version.

As a user I'd (or better said I could) expect the rollback to move the string "(current)" in the info output to the rollbacked version. However, what we do is we create a new version with config+secrets from the version to rollback to. I think this could be clarified in the output. E.g. Creating a new version <version_id> with configuration files from version <version_to_rollback>

I agree, I'll do that.

Copy link
Contributor

@Siegrift Siegrift left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@amarthadan amarthadan merged commit f20a40b into master Jan 23, 2023
@amarthadan amarthadan deleted the deployer-rollback branch January 23, 2023 07:41
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.

Add rollback functionality for Airnode deployments
2 participants