Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The upgrade-test CI job will not run for modified migration files because the migrations_modified filter is not defined in .github/file-filters.yml.
Severity: MEDIUM

Suggested Fix

Define the migrations_modified filter in .github/file-filters.yml using the modified: event qualifier, similar to how migrations_added is defined. This will ensure the dorny/paths-filter action correctly detects modified migration files and populates the migrations_modified output, allowing the upgrade-test job to trigger as intended.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .github/workflows/migrations.yml#L84

Potential issue: The `upgrade-test` job's conditional logic is intended to trigger for
both added and modified migration files. However, the check for modified files,
`needs.did-migration-change.outputs.modified == 'true'`, will never evaluate to true.
This is because the underlying output `steps.changes.outputs.migrations_modified` from
the `dorny/paths-filter` action is always empty, as the `migrations_modified` filter key
is not defined in `.github/file-filters.yml`. Consequently, the `upgrade-test` job is
silently skipped for all modified migration files, potentially allowing breaking changes
to be merged without testing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrade test never triggers for modified migrations

Medium Severity

The modified == 'true' part of this condition will never be true because the migrations_modified filter is not defined in .github/file-filters.yml — only migrations_added exists. The needs.did-migration-change.outputs.modified value will always be an empty string, meaning this upgrade test only runs for newly added migrations, not for modified ones. Since the stated goal is to prevent InconsistentMigrationHistory, and modifying an existing migration's dependencies is one way to cause that error, this is a coverage gap.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d12be93. Configure here.

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 }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing repo context for gh release list command

High Severity

The gh release list command on line 88 runs before any actions/checkout step, so there's no local git repository context. The gh CLI does not fall back to the GITHUB_REPOSITORY environment variable — it requires either the GH_REPO env var or the --repo/-R flag when not inside a git checkout. This will fail with a "could not determine repo" error, breaking the entire upgrade-test job. Adding GH_REPO: ${{ github.repository }} to the env block would fix this.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d12be93. Configure here.

- 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
1 change: 1 addition & 0 deletions .github/workflows/self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Loading