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(ci): Instant rollback process #5460

Merged
merged 52 commits into from May 8, 2024
Merged

Conversation

AliaksandrRyzhou
Copy link
Collaborator

@AliaksandrRyzhou AliaksandrRyzhou commented Apr 26, 2024

Rollback the ECS and Netlify.

So that we don't have to use the Web interface to roll back our ECS and Netlify releases, we decided to create a workflow that should simplify this procedure.

Workflow options

You can find this workflow here.

When you click the button Run workflow you will see the menu with the following options:

Use workflow from

Specify the branch name to be used when running the Rollback workflow. Keep in mind that to use these options, the latest rollback.yml should exist in your branch.

Service:

  • inbound_mail
  • api
  • web
  • webhook
  • widget
  • worker
  • ws

The micro-service that we want to rollback to the previous version.

Environment:

  • Development
  • Production

The environment where the service is located. Mostly, I've added this option for testing, but let's leave it here until we're assured that everything works fine.

Region:

  • [EU]
  • [US]
  • [EU,US]

The region of the environment is necessary to know the TF workspace. When you choose the DEV environment, this option is not needed. However, if you attempt to run the Rollback for the Development environment in the US Region, it will return an error because we don't have a DEV environment in this region.

Rollback mode:

  • Previous Version
  • Commit Hash

You can roll back to the previously deployed version or to the version that has the current commit hash of this branch in an image tag name or a deployment info. The Commit Hash option should be tested as it will be useful for tags. When a tag is created and this workflow is run for that tag, the workflow retrieves the HEAD Commit for the current git state. It then attempts to find the image tag with this value or the Deploy in Netlify with the same commit_ref roll back the release from the current version to the version with this head commit value.

More you can find here

Remember that this workflow works only in the branch where rollback.yml exists and is updated.

Copy link

linear bot commented Apr 26, 2024

@github-actions github-actions bot added the CI/CD label Apr 26, 2024
@AliaksandrRyzhou AliaksandrRyzhou changed the title fix(ci): Get back after workflow creation in the list fix(ci): Instant rollback process Apr 26, 2024
Copy link

netlify bot commented Apr 26, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 918faa4
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/663b0cc7184d020008f98e4e
😎 Deploy Preview https://deploy-preview-5460--dev-web-novu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 26, 2024

Deploy Preview for novu-design ready!

Name Link
🔨 Latest commit 918faa4
🔍 Latest deploy log https://app.netlify.com/sites/novu-design/deploys/663b0cc7b9543100087fce7b
😎 Deploy Preview https://deploy-preview-5460--novu-design.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AliaksandrRyzhou AliaksandrRyzhou had a problem deploying to {{ github.event.inputs.environment }} April 26, 2024 09:58 — with GitHub Actions Failure
@AliaksandrRyzhou AliaksandrRyzhou had a problem deploying to {{ github.event.inputs.environment }} April 26, 2024 11:22 — with GitHub Actions Failure
@AliaksandrRyzhou AliaksandrRyzhou had a problem deploying to {{ github.event.inputs.environment }} April 26, 2024 12:21 — with GitHub Actions Failure
Copy link
Contributor

@SokratisVidros SokratisVidros left a comment

Choose a reason for hiding this comment

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

@AliaksandrRyzhou this is great work. Kudos for combining all services, environments and regions in a single workflow! We should apply the same mindset in the deployment workflows very soon.

I added some comments to discuss but overall this is already in great shape.

.github/workflows/rollback.yml Outdated Show resolved Hide resolved
.github/workflows/rollback.yml Outdated Show resolved Hide resolved
.github/workflows/rollback.yml Show resolved Hide resolved
.github/workflows/rollback.yml Show resolved Hide resolved
.github/workflows/rollback.yml Show resolved Hide resolved
.github/workflows/rollback.yml Outdated Show resolved Hide resolved
.github/workflows/rollback.yml Outdated Show resolved Hide resolved
.github/workflows/rollback.yml Outdated Show resolved Hide resolved
@Cliftonz
Copy link
Contributor

Cliftonz commented May 7, 2024

@AliaksandrRyzhou Lets make sure sok does not have any other discussion point tomorrow otherwise I am good to merge this, dont forget we need to cherry pick this to main also.

@SokratisVidros

@AliaksandrRyzhou
Copy link
Collaborator Author

@Cliftonz I'm waiting for your approval :) Anyway, we have to merge it to have a chance of how it works, If something happens we will fix it

@Cliftonz Cliftonz merged commit 04ef4ad into next May 8, 2024
25 checks passed
@Cliftonz Cliftonz deleted the inf-376-instant-rollback-process branch May 8, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants