From bd84e1cf5a64eceb16ddc3961b03152280732899 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Sun, 19 Apr 2026 21:07:32 +0700 Subject: [PATCH 1/4] feat(ci): run self-hosted upgrade test --- .github/workflows/self-hosted.yml | 86 +++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 3b33c9556ec7a2..3e3bb5e463c2f0 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -91,6 +91,7 @@ jobs: ghcr: true tag_nightly: false tag_latest: false + publish_on_pr: ${{ github.event.pull_request.author_association == 'OWNER' || github.event.pull_request.author_association == 'MEMBER' }} assemble: needs: [self-hosted] @@ -115,3 +116,88 @@ jobs: --tag ghcr.io/getsentry/sentry:nightly \ ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 \ ghcr.io/getsentry/sentry:${{ github.sha }}-arm64 + + # This job is to ensure database migration is correct to avoid any + # InconsistentMigrationHistory issues when users upgrade to a new version of Sentry. + upgrade-test: + runs-on: ubuntu-24.04 + needs: + - self-hosted-amd64- + strategy: + fail-fast: false + matrix: + compose_profiles: ['feature-complete', 'errors-only'] + name: ${{ format('upgrade test{0}', matrix.compose_profiles == 'errors-only' && ' (errors-only)' || '') }} + env: + REPORT_SELF_HOSTED_ISSUES: 0 + SELF_HOSTED_TESTING_DSN: ${{ vars.SELF_HOSTED_TESTING_DSN }} + timeout-minutes: 90 + steps: + - name: Filter out changes + uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 + id: filter + with: + filters: | + sentry: + - 'src/sentry/migrations/**' + - 'src/sentry/**/migrations/**' + + - name: Checkout + if: ${{ steps.filter.outputs.sentry == 'true' }} + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Get latest release tag + if: ${{ steps.filter.outputs.sentry == 'true' }} + id: latest_release + run: echo "tag=$(gh release list --json tagName,isLatest --jq '.[] | select(.isLatest)|.tagName')" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ github.token }} + + - name: Install latest release and run tests + if: ${{ steps.filter.outputs.sentry == 'true' }} + uses: getsentry/self-hosted@master + with: + skip_backup_restore_test: true + compose_profiles: ${{ matrix.compose_profiles }} + project_name: |- + sentry + snuba + relay + symbolicator + taskbroker + vroom + uptime_checker + image_url: |- + ghcr.io/getsentry/sentry:${{ steps.latest_release.outputs.tag }} + ghcr.io/getsentry/snuba:${{ steps.latest_release.outputs.tag }} + ghcr.io/getsentry/relay:${{ steps.latest_release.outputs.tag }} + ghcr.io/getsentry/symbolicator:${{ steps.latest_release.outputs.tag }} + ghcr.io/getsentry/taskbroker:${{ steps.latest_release.outputs.tag }} + ghcr.io/getsentry/vroom:${{ steps.latest_release.outputs.tag }} + ghcr.io/getsentry/uptime-checker:${{ steps.latest_release.outputs.tag }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + - name: Re-run installation with nightly images and run tests + if: ${{ steps.filter.outputs.sentry == 'true' }} + uses: getsentry/self-hosted@master + with: + skip_backup_restore_test: true + no_restore_volume_cache: true + compose_profiles: ${{ matrix.compose_profiles }} + project_name: |- + sentry + snuba + relay + symbolicator + taskbroker + vroom + uptime_checker + image_url: |- + ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 + ghcr.io/getsentry/snuba:nightly + ghcr.io/getsentry/relay:nightly + ghcr.io/getsentry/symbolicator:nightly + ghcr.io/getsentry/taskbroker:nightly + ghcr.io/getsentry/vroom:nightly + ghcr.io/getsentry/uptime-checker:nightly + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 16d82d410ec7b495272bff7bbc9a406f506d8700 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Thu, 23 Apr 2026 10:52:29 +0700 Subject: [PATCH 2/4] fix(ci): correct checkout order and needs value --- .github/workflows/self-hosted.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 3e3bb5e463c2f0..6aa7a40e777058 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -122,7 +122,7 @@ jobs: upgrade-test: runs-on: ubuntu-24.04 needs: - - self-hosted-amd64- + - self-hosted strategy: fail-fast: false matrix: @@ -133,6 +133,10 @@ jobs: SELF_HOSTED_TESTING_DSN: ${{ vars.SELF_HOSTED_TESTING_DSN }} timeout-minutes: 90 steps: + - name: Checkout + if: ${{ steps.filter.outputs.sentry == 'true' }} + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Filter out changes uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 id: filter @@ -142,10 +146,6 @@ jobs: - 'src/sentry/migrations/**' - 'src/sentry/**/migrations/**' - - name: Checkout - if: ${{ steps.filter.outputs.sentry == 'true' }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Get latest release tag if: ${{ steps.filter.outputs.sentry == 'true' }} id: latest_release @@ -182,7 +182,6 @@ jobs: uses: getsentry/self-hosted@master with: skip_backup_restore_test: true - no_restore_volume_cache: true compose_profiles: ${{ matrix.compose_profiles }} project_name: |- sentry From 019a423144c72cf725a040d5d10ae7217c46eeaa Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Thu, 23 Apr 2026 10:58:01 +0700 Subject: [PATCH 3/4] fix(ci): remove inconsistent criteria for checkout --- .github/workflows/self-hosted.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 6aa7a40e777058..9b0fa569d7336f 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -134,7 +134,6 @@ jobs: timeout-minutes: 90 steps: - name: Checkout - if: ${{ steps.filter.outputs.sentry == 'true' }} uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Filter out changes From d12be93a54aed55f62d9bcc186fc5bb743a6d74f Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Thu, 30 Apr 2026 21:28:41 +0700 Subject: [PATCH 4/4] feat(ci): run migration for sentry only --- .github/workflows/migrations.yml | 30 +++++++++++ .github/workflows/self-hosted.yml | 83 ------------------------------- 2 files changed, 30 insertions(+), 83 deletions(-) diff --git a/.github/workflows/migrations.yml b/.github/workflows/migrations.yml index 359057e28a2fde..831fdbffe40d24 100644 --- a/.github/workflows/migrations.yml +++ b/.github/workflows/migrations.yml @@ -75,3 +75,33 @@ jobs: with: githubToken: ${{ secrets.GITHUB_TOKEN }} migration: ${{ steps.file.outputs.added }} + + upgrade-test: + name: Upgrade Test + runs-on: ubuntu-24.04 + timeout-minutes: 30 + needs: did-migration-change + if: ${{ needs.did-migration-change.outputs.modified == 'true' || needs.did-migration-change.outputs.added == 'true' }} + steps: + - name: Get latest release tag + id: latest_release + run: echo "tag=$(gh release list --json tagName,isLatest --jq '.[] | select(.isLatest)|.tagName')" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ github.token }} + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + ref: ${{ steps.latest_release.outputs.tag }} + - name: Setup sentry env + uses: ./.github/actions/setup-sentry + with: + mode: migrations + - name: Apply migrations + run: | + sentry upgrade --noinput + # Checkout the current ref + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + clean: false + - name: Apply migrations again to test upgrade path + run: | + sentry upgrade --noinput diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 9b0fa569d7336f..24d1e2f01f1091 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -116,86 +116,3 @@ jobs: --tag ghcr.io/getsentry/sentry:nightly \ ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 \ ghcr.io/getsentry/sentry:${{ github.sha }}-arm64 - - # This job is to ensure database migration is correct to avoid any - # InconsistentMigrationHistory issues when users upgrade to a new version of Sentry. - upgrade-test: - runs-on: ubuntu-24.04 - needs: - - self-hosted - strategy: - fail-fast: false - matrix: - compose_profiles: ['feature-complete', 'errors-only'] - name: ${{ format('upgrade test{0}', matrix.compose_profiles == 'errors-only' && ' (errors-only)' || '') }} - env: - REPORT_SELF_HOSTED_ISSUES: 0 - SELF_HOSTED_TESTING_DSN: ${{ vars.SELF_HOSTED_TESTING_DSN }} - timeout-minutes: 90 - steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Filter out changes - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - id: filter - with: - filters: | - sentry: - - 'src/sentry/migrations/**' - - 'src/sentry/**/migrations/**' - - - name: Get latest release tag - if: ${{ steps.filter.outputs.sentry == 'true' }} - id: latest_release - run: echo "tag=$(gh release list --json tagName,isLatest --jq '.[] | select(.isLatest)|.tagName')" >> "$GITHUB_OUTPUT" - env: - GH_TOKEN: ${{ github.token }} - - - name: Install latest release and run tests - if: ${{ steps.filter.outputs.sentry == 'true' }} - uses: getsentry/self-hosted@master - with: - skip_backup_restore_test: true - compose_profiles: ${{ matrix.compose_profiles }} - project_name: |- - sentry - snuba - relay - symbolicator - taskbroker - vroom - uptime_checker - image_url: |- - ghcr.io/getsentry/sentry:${{ steps.latest_release.outputs.tag }} - ghcr.io/getsentry/snuba:${{ steps.latest_release.outputs.tag }} - ghcr.io/getsentry/relay:${{ steps.latest_release.outputs.tag }} - ghcr.io/getsentry/symbolicator:${{ steps.latest_release.outputs.tag }} - ghcr.io/getsentry/taskbroker:${{ steps.latest_release.outputs.tag }} - ghcr.io/getsentry/vroom:${{ steps.latest_release.outputs.tag }} - ghcr.io/getsentry/uptime-checker:${{ steps.latest_release.outputs.tag }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - - name: Re-run installation with nightly images and run tests - if: ${{ steps.filter.outputs.sentry == 'true' }} - uses: getsentry/self-hosted@master - with: - skip_backup_restore_test: true - compose_profiles: ${{ matrix.compose_profiles }} - project_name: |- - sentry - snuba - relay - symbolicator - taskbroker - vroom - uptime_checker - image_url: |- - ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 - ghcr.io/getsentry/snuba:nightly - ghcr.io/getsentry/relay:nightly - ghcr.io/getsentry/symbolicator:nightly - ghcr.io/getsentry/taskbroker:nightly - ghcr.io/getsentry/vroom:nightly - ghcr.io/getsentry/uptime-checker:nightly - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}