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

Django Migration Linter Integration #43

Merged
merged 59 commits into from
Jan 14, 2025
Merged
Changes from 7 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
653bdd9
Added django-migration-linter to project dependencies and updated Mak…
nehakerung Nov 22, 2024
5b72cdf
Poetry.lock fixes
nehakerung Nov 25, 2024
47d73e6
Excluded apps added for linter
nehakerung Nov 26, 2024
3deb099
CI pipeline added
nehakerung Nov 26, 2024
ece5e3c
Merge branch 'main' into feature/django-migration-linter-CMS-201
nehakerung Nov 26, 2024
f068fa7
Recent changes
nehakerung Nov 26, 2024
f9260e0
CI file updated for the lint migration job.
sanjeevz3009 Nov 26, 2024
d83786b
Updated per review suggestions
nehakerung Nov 27, 2024
b37c7b7
Pipeline test
nehakerung Nov 28, 2024
c0bfbc7
Custom django lint migrations script added for cleaner output
sanjeevz3009 Nov 29, 2024
ce6f2af
Poetry lock file updated
sanjeevz3009 Nov 29, 2024
6a0eb6b
Merge branch 'main' into feature/django-migration-linter-CMS-201
sanjeevz3009 Nov 29, 2024
eaabfc6
Lock file updated
sanjeevz3009 Nov 29, 2024
06f6b12
Fix lint-py errors
nehakerung Nov 29, 2024
d9c256c
Update README.md
nehakerung Nov 29, 2024
b451c99
Fixed linting issues
sanjeevz3009 Dec 3, 2024
a47584f
Merge branch 'main' into feature/django-migration-linter-CMS-201
sanjeevz3009 Dec 3, 2024
2284554
Lock file updated
sanjeevz3009 Dec 3, 2024
89fd58f
Outer scope variable redefining lint issue fixed
sanjeevz3009 Dec 3, 2024
7d75d1e
Removing lintmigration step
sanjeevz3009 Dec 3, 2024
a5aef7a
Django migration linter moved out of the dev dependency
sanjeevz3009 Dec 3, 2024
0efbb59
README updated and make file commands added for lintmigrations and li…
sanjeevz3009 Dec 3, 2024
de260bb
Migration linter step added back in
sanjeevz3009 Dec 3, 2024
ce493fa
Retry to execute make command for migration linter
sanjeevz3009 Dec 3, 2024
3ede596
Retry
sanjeevz3009 Dec 3, 2024
e772c21
Exit codes added to pass or fail the custom migration script run
sanjeevz3009 Dec 5, 2024
fc366b8
Merge branch 'main' into feature/django-migration-linter-CMS-201
nehakerung Dec 5, 2024
f190f51
Changes from reviews
nehakerung Dec 6, 2024
aa5ef55
Code formatted
sanjeevz3009 Dec 9, 2024
02f24f8
django migration linter removed from the dev dependencies
sanjeevz3009 Dec 9, 2024
62c348a
Added django-migration-linter to dev.py
sanjeevz3009 Dec 9, 2024
c5bc5e6
Migration linter being added only in dev
sanjeevz3009 Dec 9, 2024
ac5d2bb
Lint errors fixed
sanjeevz3009 Dec 9, 2024
ab9519e
CI updated
sanjeevz3009 Dec 9, 2024
3ac93a3
CI lint migration test
sanjeevz3009 Dec 9, 2024
29066b1
env changed
sanjeevz3009 Dec 9, 2024
5d7538b
Test command removed
sanjeevz3009 Dec 9, 2024
ebf0155
CI changes reverted and MIGRATION_LINTER_OPTIONS moved to dev.py
sanjeevz3009 Dec 9, 2024
541569e
Update ci.yml
nehakerung Dec 9, 2024
fb8bd73
Rename script
nehakerung Dec 10, 2024
9b8cd3b
Change lint-migrations command, delete script, fix documents error
nehakerung Dec 11, 2024
c1083d1
Document migration fixes and readme update
nehakerung Dec 11, 2024
80daaf9
Move CODEOWNER file location (#53)
MebinAbraham Dec 5, 2024
81727f2
UAT fixes (#56)
zerolab Dec 10, 2024
7085463
Documents migrations re-add
nehakerung Dec 11, 2024
bdd72af
Add noop for reverse migrations (create homepage/release calendar index)
zerolab Dec 13, 2024
739c51e
Merge main
nehakerung Dec 13, 2024
b22b9c0
ci updated to run the migration linter as part of the test python job
nehakerung Dec 13, 2024
dab2db0
Fix documents
nehakerung Dec 13, 2024
162ade0
merge main
nehakerung Dec 13, 2024
ce114c7
Migrations files ignored
sanjeevz3009 Dec 16, 2024
4ed61f8
Merge branch 'main' into feature/django-migration-linter-CMS-201
nehakerung Dec 16, 2024
57b18a6
Merge branch 'main' into feature/django-migration-linter-CMS-201
nehakerung Jan 13, 2025
19a848d
Merge branch 'main' into feature/django-migration-linter-CMS-201
nehakerung Jan 13, 2025
b7d79d4
Update poetry.lock
nehakerung Jan 13, 2025
f0b82ad
Merge branch 'main' into feature/django-migration-linter-CMS-201
nehakerung Jan 13, 2025
15750df
Delete .docker/bashrc.sh
nehakerung Jan 14, 2025
92d2350
Add .docker/bashrc.sh
nehakerung Jan 14, 2025
145c672
File permision change
nehakerung Jan 14, 2025
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
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -52,6 +52,25 @@ jobs:
- name: Prettier
run: npm run lint:format

lint-migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
cache: poetry

- name: Install dependencies
run: make install-dev

- name: Lint migrations
run: make lint-migrations
zerolab marked this conversation as resolved.
Show resolved Hide resolved

compile_static:
runs-on: ubuntu-latest
steps:
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ format-frontend: ## Format front-end files (CSS, JS, YAML, MD)
npm run format

.PHONY: lint
lint: lint-py lint-html lint-frontend ## Run all linters (python, html, front-end)
lint: lint-py lint-html lint-frontend lint-migrations## Run all linters (python, html, front-end, migrations)

.PHONY: lint-py
lint-py: ## Run all Python linters (ruff/pylint/mypy).
@@ -50,6 +50,10 @@ lint-html: ## Run HTML Linters
lint-frontend: ## Run front-end linters
npm run lint

.PHONY: lint-migrations
lint-migrations: ## Run django-migration-linter
python manage.py lintmigrations
zerolab marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: test
test: ## Run the tests and check coverage.
poetry run coverage erase
3 changes: 3 additions & 0 deletions cms/settings/base.py
Original file line number Diff line number Diff line change
@@ -88,6 +88,7 @@
"django_jinja",
"wagtailmath",
"wagtailfontawesomesvg",
"django_migration_linter",
]

if not IS_EXTERNAL_ENV:
@@ -788,3 +789,5 @@
# ONS Cookie banner settings
ONS_COOKIE_BANNER_SERVICE_NAME = env.get("ONS_COOKIE_BANNER_SERVICE_NAME", "www.ons.gov.uk")
MANAGE_COOKIE_SETTINGS_URL = env.get("MANAGE_COOKIE_SETTINGS_URL", "https://www.ons.gov.uk/cookies")

# MIGRATION_LINTER_OPTIONS = {"exclude_apps": ["wagtail"]}
Loading