From bfe1af3c839e3370d5b6132efdaaad5a6b9983a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Falc=C3=B3n?= Date: Mon, 20 Apr 2026 13:35:07 +0100 Subject: [PATCH] fix(ci): order sentry deploy after build (#309) ## Summary - make the `deploy` job wait for `build-image` so Sentry release creation finishes before deploy tracking runs - keep the Sentry deploy marker on the same release name while removing the race that caused `Release not found` - add a focused regression test that asserts the workflow keeps this dependency in place ## Testing - php artisan test --compact tests/Feature/SentryConfigTest.php --- .github/workflows/ci.yml | 2 +- tests/Feature/SentryConfigTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caffd056..484b4a9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -291,7 +291,7 @@ jobs: deploy: runs-on: ubuntu-latest - needs: [tests, linter, static-analysis, performance-tests] + needs: [build-image] if: github.ref == 'refs/heads/main' && github.event_name == 'push' env: SENTRY_RELEASE: whisper-money@${{ github.sha }} diff --git a/tests/Feature/SentryConfigTest.php b/tests/Feature/SentryConfigTest.php index a4572583..8a898a47 100644 --- a/tests/Feature/SentryConfigTest.php +++ b/tests/Feature/SentryConfigTest.php @@ -3,3 +3,11 @@ it('binds the sentry release from the environment', function () { expect(config('sentry.release'))->toBe(env('SENTRY_RELEASE')); }); + +it('waits for the image build before marking a sentry deploy', function () { + $workflow = file_get_contents(base_path('.github/workflows/ci.yml')); + + expect($workflow) + ->toContain("deploy:\n runs-on: ubuntu-latest\n needs: [build-image]") + ->toContain('run: sentry-cli releases deploys "$SENTRY_RELEASE" new -e production'); +});