Skip to content

Commit

Permalink
fix: address django migration failing on SQLite (#5308)
Browse files Browse the repository at this point in the history
## Which issue(s) this PR closes

Fixes #5306 (and related to
#5244 (comment)) +
add CI check to avoid this from happening in the future

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
  • Loading branch information
joeyorlando authored Nov 28, 2024
1 parent 4826291 commit 86ca438
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/linting-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,15 @@ jobs:
uses: actions/checkout@v4
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Wait for MySQL to be ready
working-directory: engine
run: ./wait_for_test_mysql_start.sh
- name: Test Django migrations work from blank slate
working-directory: engine
run: python manage.py migrate
- name: Unit Test Backend
working-directory: engine
run: ./wait_for_test_mysql_start.sh && pytest -x
run: pytest -x

unit-test-backend-postgresql-rabbitmq:
name: "Backend Tests: PostgreSQL + RabbitMQ (RBAC enabled: ${{ matrix.rbac_enabled }})"
Expand Down Expand Up @@ -229,6 +235,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Test Django migrations work from blank slate
working-directory: engine
run: python manage.py migrate
- name: Unit Test Backend
working-directory: engine
run: pytest -x
Expand Down Expand Up @@ -259,6 +268,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Test Django migrations work from blank slate
working-directory: engine
run: python manage.py migrate
- name: Unit Test Backend
working-directory: engine
run: pytest -x
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by Django 4.2.16 on 2024-11-20 20:23

import common.migrations.remove_field
import django_migration_linter as linter
# import common.migrations.remove_field
# import django_migration_linter as linter
from django.db import migrations


Expand All @@ -12,10 +12,14 @@ class Migration(migrations.Migration):
]

operations = [
linter.IgnoreMigration(),
common.migrations.remove_field.RemoveFieldDB(
model_name='resolutionnoteslackmessage',
name='_slack_channel_id',
remove_state_migration=('alerts', '0068_remove_resolutionnoteslackmessage__slack_channel_id_state'),
),
# NOTE: commented out due to some issues this was causing w/ SQLite:
# https://github.com/grafana/oncall/issues/5306
# https://github.com/grafana/oncall/issues/5244#issuecomment-2503999986
#
# linter.IgnoreMigration(),
# common.migrations.remove_field.RemoveFieldDB(
# model_name='resolutionnoteslackmessage',
# name='_slack_channel_id',
# remove_state_migration=('alerts', '0068_remove_resolutionnoteslackmessage__slack_channel_id_state'),
# ),
]

0 comments on commit 86ca438

Please sign in to comment.