How do I validate Snowflake objects in a CI/CD pipeline?

November 14, 2026 4 answers
Asked by Nerby-4x

I'm building a proof of concept to deploy tables, streams, tasks, and stages to DEV/QA and PROD with GitHub Actions. I'm using schemachange for migrations and SQLFluff for linting, plus scripts for backups and rollback.

How can the pipeline check that the deployed objects are actually correct, rather than just confirming that the SQL ran? Any other suggestions for the pipeline are welcome.

Answers

Brelby.7k

Treat migration execution and object validation as separate checks. The schemachange history table can tell you which changes ran, but it doesn't prove the current objects match what you intended.

After deployment, run SQL checks in the target environment and compare the results with expected definitions in code or a small manifest. For example, check table columns and types, stream metadata, task state, and stage properties. Fail the pipeline if a required object is missing or a property doesn't match.

n16+chalkdust_730:

A YAML or JSON manifest could make those expectations easy to review alongside the migration files.

Reply to this answer
2k+ledger_47

For tasks, checking that the object exists is only the start. Verify whether it should be resumed and whether its warehouse is available. A successful CREATE statement won't tell you that the task can actually run as intended.

Where practical, add a controlled functional test in DEV/QA and check the task's execution result, not just its metadata.

Reply to this answer
h306!datapulse_8

I'd also test the recovery path before relying on it for PROD. A backup or rollback script is useful only if it restores the objects and data you need, so try it against a disposable test deployment and check the result.

Some changes may need a forward fix rather than a simple reversal. Make that explicit in the migration review instead of assuming every DDL change has a safe automatic rollback.

Reply to this answer
6t~parcel_731

Keep environment-specific settings separate from the object definitions where you can. Have the pipeline deploy and validate in DEV/QA first, then use an approval gate before PROD. Run the same checks in each target, with expectations adjusted for settings that legitimately differ.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions