-
-
Notifications
You must be signed in to change notification settings - Fork 61
51 lines (44 loc) · 1.71 KB
/
ddl-changes.yml
File metadata and controls
51 lines (44 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: ddl-changes
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
jobs:
post_changes:
name: Post new DDL changes from migrations
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6.0.2
name: Checkout master for diffing
with:
ref: master
fetch-depth: 200
- uses: actions/checkout@v6.0.2
name: Checkout HEAD of code that may have migration changes
with:
clean: false
fetch-depth: 200
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
# we just cache the venv-dir directly in action-setup-venv
enable-cache: false
- uses: getsentry/action-setup-venv@5a80476d175edf56cb205b08bc58986fa99d1725 # v3.2.0
with:
cache-dependency-path: uv.lock
install-cmd: uv sync --frozen --active
- name: Run the migration script
run: |
SNUBA_SETTINGS=test_distributed python scripts/ddl-changes.py
- name: Generate SQL for migration
uses: getsentry/action-migrations@v1.2.2
env:
SNUBA_SETTINGS: test_distributed
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
migration: "./snuba/migrations/groups.py"
cmd: python scripts/ddl-changes.py
- name: Check migrations are not coupled with other changes
run: |
# Check that the migration is not coupled with other changes
# If the label skip-check-migrations is present, the check is skipped
SNUBA_SETTINGS=test_distributed python scripts/check-migrations.py --labels ${{join(github.event.pull_request.labels.*.name, '')}}