diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23a8eac..f7977c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,8 @@ jobs: python-version: ['3.8'] toxenv: [django22-celery44-drflatest, django22-celery50-drflatest, django30-celery44-drflatest, django30-celery50-drflatest, django31-celery44-drflatest, django31-celery50-drflatest, - django32-celery44-drflatest, django32-celery50-drflatest, quality, docs, pii_check] + django32-celery44-drflatest, django32-celery50-drflatest, quality, docs, pii_check, + check_keywords] steps: - uses: actions/checkout@v2 diff --git a/Makefile b/Makefile index 98fa5d6..8a43d6e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: clean compile_translations coverage diff_cover docs dummy_translations \ extract_translations fake_translations help pii_check pull_translations push_translations \ - quality requirements selfcheck test test-all upgrade validate + quality requirements selfcheck test test-all upgrade validate check_keywords .DEFAULT_GOAL := help @@ -104,6 +104,9 @@ build_dummy_translations: extract_translations dummy_translations compile_transl validate_translations: build_dummy_translations detect_changed_source_translations ## validate translations +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 + ################## #Devstack commands ################## diff --git a/db_keyword_overrides.yml b/db_keyword_overrides.yml new file mode 100644 index 0000000..dcc39cd --- /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 7695b3c..2f83e17 100644 --- a/tox.ini +++ b/tox.ini @@ -55,3 +55,10 @@ deps = commands = code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage +[testenv:check_keywords] +whitelist_externals = + make +deps = + -r{toxinidir}/requirements/test.txt +commands = + make check_keywords