-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Release threshold folder imports nit #56400
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
Conversation
This PR has a migration; here is the generated SQL for --
-- Alter field project on releasethreshold
-- |
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, but maybe get confirmation from someone from migrations?
@@ -10,8 +10,7 @@ | |||
from sentry.api.bases.project import ProjectEndpoint | |||
from sentry.api.exceptions import ResourceDoesNotExist | |||
from sentry.api.serializers import serialize | |||
from sentry.models.project import Project | |||
from sentry.models.release_threshold.releasethreshold import ReleaseThreshold |
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.
where do we prefer importing models like this? i see both styles sometimes
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.
Specific imports are fine, however we're already exporting everything from the models/init.py so imo it's cleaner to simply have the top level path for imports.
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.
I think we're trying to get away from this like @JoshFerge pointed out
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.
Ah - sounds like we're actually pushing for the explicit imports so reverting and changing to that
Codecov Report
@@ Coverage Diff @@
## master #56400 +/- ##
==========================================
- Coverage 78.63% 78.62% -0.01%
==========================================
Files 5077 5078 +1
Lines 218315 218349 +34
Branches 36951 36961 +10
==========================================
+ Hits 171671 171687 +16
- Misses 41100 41114 +14
- Partials 5544 5548 +4 |
@@ -1,9 +1,9 @@ | |||
from sentry.api.serializers import Serializer, register, serialize | |||
from sentry.models import ReleaseThreshold |
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.
should favor importing directly from the model file. (i.e. import from sentry.models.releasethreshold
). We should work towards enforcing this somewhere
0b4f99d
to
666054a
Compare
This PR has a migration; here is the generated SQL for --
-- Alter field project on releasethreshold
-- |
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.
could we isolate the migration from the nits? try in general to keep migration PRs separate from other changes.
Separate Migration from nits in #56400
8175ac5
to
79d8972
Compare
Separate Migration from nits in #56400
Cleans up release threshold model imports & adds related name to the relase_threshold table for projects