From 77d1b3cae33ff2d8cfcd05b84643267792e7dd24 Mon Sep 17 00:00:00 2001 From: core-devops Date: Fri, 22 May 2026 12:00:15 -0700 Subject: [PATCH] fix(ci): keep Atlas Pro drift check advisory --- .gitea/workflows/ci-drift-check.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci-drift-check.yml b/.gitea/workflows/ci-drift-check.yml index fad75f0..374c979 100644 --- a/.gitea/workflows/ci-drift-check.yml +++ b/.gitea/workflows/ci-drift-check.yml @@ -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 -- 2.52.0