Closed sobolevn closed 5 years ago
Hi @sobolevn , weird I didn't manage to reproduce. Could you give more precise steps or env info please?
So, I had the time to make you a repo to reproduce this issue: https://github.com/sobolevn/django_migration_linter_issue_44
Documentation for the similar projects: https://wemake-django-template.readthedocs.io/en/latest/
Steps:
git clone https://github.com/sobolevn/django_migration_linter_issue_44.git
cd django_migration_linter_issue_44
docker-compose run --rm web django-migration-linter .
The repository contains only two commits:
wemake-django-template
projectdjango_migration_linter
and django_celery_monitor
Output:
(axes, 0001_initial)... OK
(axes, 0002_auto_20151217_2044)... OK
(axes, 0003_auto_20160322_0929)... OK
(axes, 0004_auto_20181024_1538)... OK
(axes, 0005_remove_accessattempt_trusted)... ERR
DROPPING columns
(django_celery_monitor, 0001_initial)... Traceback (most recent call last):
File "/usr/local/bin/django-migration-linter", line 11, in <module>
sys.exit(_main())
File "/usr/local/lib/python3.6/site-packages/django_migration_linter/migration_linter.py", line 341, in _main
linter.lint_all_migrations(git_commit_id=args.commit_id)
File "/usr/local/lib/python3.6/site-packages/django_migration_linter/migration_linter.py", line 145, in lint_all_migrations
self.lint_migration(m)
File "/usr/local/lib/python3.6/site-packages/django_migration_linter/migration_linter.py", line 104, in lint_migration
sql_statements = self.get_sql(app_name, migration_name)
File "/usr/local/lib/python3.6/site-packages/django_migration_linter/migration_linter.py", line 193, in get_sql
"sqlmigrate command failed {0}".format(err.decode("utf-8"))
RuntimeError: sqlmigrate command failed CommandError: App 'django_celery_monitor' does not have migrations
Thanks a lot @sobolevn for the environment, finally got the time to work on it.
However, I still cannot reproduce.
When I clone your repo, and run the docker-compose line you are suggesting, it works.
For the details, in the installation, the latest version of the linter is installed
- Installing django-migration-linter (0.1.2)
and on execution of it:
*** Summary:
Valid migrations: 0/0 - erroneous migrations: 0/0 - ignored migrations: 0/0
Can it be that an older version of the linter is installed in your container?
Nope, I am also using 0.1.2
. You can see this line in lock file: https://github.com/sobolevn/django_migration_linter_issue_44/blob/master/poetry.lock#L317
What can be the case? We have docker
, reproducible builds, etc. And it still does not work! 😄
Hmm, can you try cloning the repo from scratch and you give me the exact steps you do. And then the output of the docker-compose run --rm web django-migration-linter .
command please
git clone https://github.com/sobolevn/django_migration_linter_issue_44.git
cd django_migration_linter_issue_44
cp config/.env.template config/.env
docker-compose run --rm web django-migration-linter .
Output:
Starting django_migration_linter_issue_44_db_1 ... done
wait-for-command.sh finished successfully after 1 second(s).
cmd: curl db:5432
target exit status: 0 52
exited status: 52
Postgres is up - continuing...
*** Summary:
Valid migrations: 0/0 - erroneous migrations: 0/0 - ignored migrations: 0/0
And it now works for me. I do not know what happened. Anyway, thanks for your time, effort, and this project!
Okay, thanks! Don't hesitate to re-open this issue if the error occurs again :)
Linting process fails with an exception when using
django_celery_monitor
. I expect it just to ignore apps without migrations.Traceback:
Version:
django-celery-monitor==1.1.2
Usage:
Related: https://github.com/wemake-services/wemake-django-template/issues/634