diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf9c69d9..74b00004 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,3 +50,9 @@ jobs: with: flags: unittests fail_ci_if_error: true + - name: Make Check Reserved Keywords + env: + TOXENV: ${{ matrix.toxenv }} + DJANGO_SETTINGS_MODULE: registrar.settings.test + run: | + make check_keywords diff --git a/Makefile b/Makefile index 3483c28e..db7c4a51 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ TOX='' createsuperuser html_coverage extract_translations dummy_translations \ fake_translations pull_translations push_translations \ detect_changed_source_translations validate_translations api_generated \ - validate_api_committed + validate_api_committed check_keywords define BROWSER_PYSCRIPT import os, webbrowser, sys @@ -170,6 +170,9 @@ detect_changed_source_translations: ## check if translation files are up-to-date validate_translations: fake_translations detect_changed_source_translations ## install fake translations and check if translation files are up-to-date +check_keywords: ## Scan the Django models in all installed apps in this project for restricted field names + python manage.py check_reserved_keywords --override_file db_keyword_overrides.yml + # Docker commands docker_build: diff --git a/db_keyword_overrides.yml b/db_keyword_overrides.yml new file mode 100644 index 00000000..e7221c78 --- /dev/null +++ b/db_keyword_overrides.yml @@ -0,0 +1,12 @@ +# This file is used by the 'check_reserved_keywords' management command to allow specific field names to be overridden +# when checking for conflicts with lists of restricted keywords used in various database/data warehouse tools. +# For more information, see: https://github.com/edx/edx-django-release-util/release_util/management/commands/check_reserved_keywords.py +# +# overrides should be added in the following format: +# - ModelName.field_name +--- +MYSQL: + - Program.key + - Organization.key +SNOWFLAKE: +STITCH: