-
Notifications
You must be signed in to change notification settings - Fork 143
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
Rewrite model check as validation check re #10079 #11646
Conversation
This model check should have been skippped by checking the `databases` kwarg provided when `check()` is called, but that reduces the circumstances on which this check is run to either: - manage.py migrate - manage.py check --databases So, given how infrequently this would be run, better to just implement this in our validation framework.
check=IntegrityCheck.PUBLICATION_MISSING_FOR_LANGUAGE, # 1014 | ||
queryset=( | ||
models.GraphModel.objects.filter( | ||
isresource=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prior version of this was also checking branches when it shouldn't.
@@ -613,39 +613,6 @@ def save(self, *args, **kwargs): | |||
|
|||
super(GraphModel, self).save(*args, **kwargs) | |||
|
|||
@classmethod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure this deletion is the main reason the coverage check is failing.
Some more info about the original motivation here: #11342 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Types of changes
Description of Change
When trying my hand at writing a django system check in #10079, I missed a pretty major caveat, which is that if you use the database, you need to do something like:
arches/arches/app/models/models.py
Lines 619 to 620 in 0f23a6c
... to avoid db hits during commands that don't generally expect a database to be configured. (My earlier workaround was was to run subsets of checks in different places, but that was kind of a code smell. This PR removes some of those workarounds.)
But to start observing
kwargs["databases"]
means that these checks only run on:So, given how infrequently this would be run, better to just implement this in our validation framework and call it out in the release notes?
Testing instructions