Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI to fail on django db check. Ignore current known issues #920

Merged
merged 1 commit into from
Feb 7, 2025
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ jobs:
- name: Collect staticfiles
run: python manage.py collectstatic --noinput --settings=config.settings.test

- name: Run Django DB config check
run: python manage.py check --database default --fail-level WARNING --settings=config.settings.test

- name: Run tests
run: |
pytest --cov=primed -n auto
Expand Down
6 changes: 6 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@
"root": {"level": "INFO", "handlers": ["console"]},
}

# Django silence system check warnings. https://docs.djangoproject.com/en/5.1/ref/checks/#security
# This check is regarding constraints placed by django-allauth
# that mysql does not support. https://github.com/pennersr/django-allauth/issues/3385
# we would need to move to postgres to support this type of constraint with filter
SILENCED_SYSTEM_CHECKS = ["models.W036"]

# django-maintenance-mode
MAINTENANCE_MODE_IGNORE_SUPERUSER = True
MAINTENANCE_MODE_IGNORE_TESTS = True
Expand Down
4 changes: 2 additions & 2 deletions config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# default to using dotenv files for all production environements
os.environ["DJANGO_READ_DOT_ENV_FILE"] = "True"
from .base import * # noqa
from .base import env # noqa
from .base import SILENCED_SYSTEM_CHECKS, env # noqa

# GENERAL
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -65,7 +65,7 @@
# Since we have disabled HSTS above we get a warning when running check --deploy
# we are manually silencing this as we have verified apache is enforcing
# https://docs.djangoproject.com/en/dev/ref/checks/#security
SILENCED_SYSTEM_CHECKS = ["security.W004"]
SILENCED_SYSTEM_CHECKS += ["security.W004"]
# STATIC
# ------------------------
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
Expand Down