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

Migrations ignored from git_commit_id when the app label does not exactly match the folder name #249

Open
phillipuniverse opened this issue Feb 10, 2023 · 2 comments
Assignees

Comments

@phillipuniverse
Copy link
Contributor

Here's a screenshot from the Pycharm debugger that shows the issue

image

The migration linter is checking for a migration with a tuple ("netsuite", "0012_added_netsuite_suiteapp_config") against the Django disk_migrations (self.migration_loader is the Django MigrationLoader).

This migration linter assumes that "netsuite" is a valid app name for Django. But it's not - Django doesn't know about an app called netsuite, it knows about one called integrations_netsuite. This is because we renamed it in a custom AppConfig in apps.py:

 class NetsuiteConfig(AppConfig): 
     name = "integrations.netsuite" 
     label = name.replace(".", "_") 

So the root issue is that the linter doesn't look truly at app labels, it only looks at folder structures.

This appears to only be an issue when used in concert with the git commit id.

Fix for this issue is at #248 which takes the folder structure and converts it to the real Django app without assumptions about naming.

@David-Wobrock
Copy link
Collaborator

Hi @phillipuniverse

Thanks for the report! That's indeed something the linter should support.
I'll try to look into it and review #248 soon :)

@mjvankampen
Copy link

Ran into this as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants