diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caba1459509..968bf2f7a8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,7 @@ jobs: - js_tests - js_lint - rst_validation + - check_keywords steps: - uses: actions/checkout@v1 - name: Setup python diff --git a/Makefile b/Makefile index 7301c23695e..aeffb1ce79f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ requirements-test coverage pii_check \ compile_translations dummy_translations extract_translations \ fake_translations pull_translations push_translations test test-python \ - test-js quality-python quality-js + test-js quality-python quality-js check_keywords .DEFAULT_GOAL := help @@ -146,3 +146,6 @@ build_dummy_translations: extract_translations dummy_translations compile_transl check_translations_up_to_date: build_dummy_translations detect_changed_source_translations ## validate translations test: test-python test-js ## run tests + +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 diff --git a/db_keyword_overrides.yml b/db_keyword_overrides.yml new file mode 100644 index 00000000000..dcc39cde04d --- /dev/null +++ b/db_keyword_overrides.yml @@ -0,0 +1,10 @@ +# 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: +SNOWFLAKE: +STITCH: diff --git a/tox.ini b/tox.ini index 6d4de7e7875..2c62b1e936f 100644 --- a/tox.ini +++ b/tox.ini @@ -81,3 +81,11 @@ commands = sudo apt-get update sudo apt-get install --no-install-recommends -y gettext make validate_translations + +[testenv:check_keywords] +whitelist_externals = + make +deps = + -r{toxinidir}/requirements/test.txt +commands = + make check_keywords