Skip to content

Conversation

@brianwarsing
Copy link
Contributor

@brianwarsing brianwarsing commented Apr 25, 2025

Preserve Environment Variables During Rollbacks

Changes

This PR ensures that environment variables are properly preserved when performing rollbacks in Shipit. The changes include:

  • Modified trigger_revert method to accept and pass through environment variables
  • Updated rollback creation to include environment variables from the original deploy
  • Enhanced test coverage to verify environment variable preservation during rollbacks

Technical Details

  • Added env parameter to trigger_revert method
  • Ensures environment variables are passed through when:
    • Manually triggering a rollback
    • Automatically rolling back after an aborted deploy
    • Rolling back to a specific commit
  • Added test cases to verify environment variable preservation in various rollback scenarios

Testing

Added comprehensive test coverage in deploys_test.rb to verify that:

  • Environment variables are preserved during automatic rollbacks
  • Environment variables are preserved when rolling back to a specific commit
  • Environment variables are correctly passed through the rollback chain

Impact

This change ensures that rollbacks maintain the same environment configuration as the original deploy, preventing potential issues that could arise from missing or incorrect environment variables during rollback operations.

@brianwarsing brianwarsing force-pushed the preserve_env_vars_on_rollback branch from c5ebb8d to 2143354 Compare April 25, 2025 16:48
@brianwarsing brianwarsing force-pushed the preserve_env_vars_on_rollback branch from 20ccafa to 6965d27 Compare April 25, 2025 17:46
@brianwarsing brianwarsing merged commit 6572be7 into Shopify:main Apr 28, 2025
7 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