fix(ci): keep Atlas Pro drift check advisory #1
@@ -78,20 +78,25 @@ jobs:
|
||||
echo "Destructive migration $latest has paired down.sql — OK."
|
||||
fi
|
||||
|
||||
- name: Declarative drift (schema.hcl vs migrations)
|
||||
- name: Declarative drift advisory (schema.hcl vs migrations)
|
||||
run: |
|
||||
# If schema.hcl describes more/less than the migration set replays,
|
||||
# this prints a non-empty plan and fails the job. Phase 1 keeps
|
||||
# this advisory until we've populated mc/migrations/ from the
|
||||
# initial schema.
|
||||
# this prints a non-empty plan. Atlas OSS validates migrations above;
|
||||
# the diff dry-run is Atlas Pro-only on current Atlas releases, so it
|
||||
# must remain advisory until we either license Atlas Pro or replace it
|
||||
# with an OSS analyzer. A paywall response must not leave main red.
|
||||
set +e
|
||||
atlas migrate diff drift-probe \
|
||||
--dir 'file://mc/migrations' \
|
||||
--to 'file://mc/schema/schema.hcl' \
|
||||
--dev-url 'docker://postgres/16/dev' \
|
||||
--dry-run
|
||||
rc=$?
|
||||
--dry-run 2>&1 | tee /tmp/atlas-drift.out
|
||||
rc=${PIPESTATUS[0]}
|
||||
if [ $rc -ne 0 ]; then
|
||||
echo "::error::Declarative schema.hcl drifted from materialised migrations" >&2
|
||||
if grep -qiE 'Atlas Pro|available only to Atlas Pro|atlas login' /tmp/atlas-drift.out; then
|
||||
echo "::warning::Atlas declarative drift dry-run requires Atlas Pro; skipping advisory check."
|
||||
exit 0
|
||||
fi
|
||||
echo "::error::Declarative drift advisory failed unexpectedly" >&2
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user