I’m going to do my best to present this request to the community without the classic blunder where the only right answer is: “that depends entirely on your configuration, which I don’t know”
The spirit of my quandary is that I’d like to be able to have independent developers working on separate features concurrently without a given tag rollback triggering any unrelated files to rollback which someone else may have been working on at the same time. Since our Lab Snowflake account acts a bit as our local development instance, this sometimes is really disruptive to our way of working.
Forgive me if I n00b anything up to badly, I’ve inherited ownership of this process from those before me.
Today we use Liquibase to deploy Snowflake objects to 3 environments in sequence as as follows:
- Lab
- This is a discreet Lab Snowflake account target/changelog table
- Triggered by either explicitly calling a GHA workflow against your feature branch or by the act of opening a PR
- This Liquibase release is tagged as
pr-[feature-branch-name]
- This environment deploys as
update-testing-rollback
- The tag is rolled back on failure or cancellation
- Stage
- This is a discreet Stage Snowflake account target/changelog table
- Triggered when we’ve met our SDLC requirements (codeowner approval, etc…)
- This Liquibase release is tagged as
release-[feature-branch-name]
- The tag is rolled back on failure or cancellation
- Prod
- This is a discreet Prod Snowflake account target/changelog table
- Triggered on merge to
main
- This Liquibase release is tagged as
release-[feature-branch-name]
- The tag is rolled back on failure or cancellation
Note: We use a master
changelog.xml
file which contains our running list of directories and files sequenced appropriately for everything to work (e.g. deploy the tables before the views)
The main issue we’re trying to chase only really applies to the Lab environment. Based presumably on tag sequencing, sometimes developer A has an an issue in their feature branch we end up rolling back features from developer B who was making unrelated changes over the period of time between developer A doing an initial deploy and developer A pushing a mistake.
To me, intuitively, it should be possible for only incoming changes to be rolled back on failure; this way if maybe a developer paused work on a feature for some time they never run the risk of rolling back subsequent and unrelated changes that may have even shipped to Prod days or weeks prior. If I’m reading the docs correctly, Liquibase does not work this way, at least not as we’ve configured it.
Any advice would be much appreciated, community!