-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref: Remove unused Group.get_oldest_event and legacy events behavior #14038
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
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.
There are a couple of things to fix in the tests.
tests/sentry/models/test_group.py
Outdated
self.min_ago = (timezone.now() - timedelta(minutes=1)).isoformat()[:19] | ||
self.two_min_ago = (timezone.now() - timedelta(minutes=2)).isoformat()[:19] | ||
self.sec_ago = (timezone.now() - timedelta(seconds=1)).isoformat()[:19] | ||
self.two_sec_ago = (timezone.now() - timedelta(seconds=1)).isoformat()[:19] |
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.
Unless you are moving close to the speed of light, thus introducing relativistic effects like time dilation, this is still one sec ago and not two sec ago.
Technically we do not know where travis runs CI so we cannot exclude the relativistic option.
tests/sentry/models/test_group.py
Outdated
event_id=six.text_type(i), | ||
group=group, | ||
datetime=datetime(2013, 8, 13, 3, 8, 30), # all in the middle | ||
def test_get_latest_identical_timestamps(self): |
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.
Is this an invariant we want to test for ?
I am not sure the product should depend on the fact that 3 events carrying the same timestamp will be returned in the order in which they are stored.
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.
Probably doesn't make much sense anymore, will remove this test
tests/sentry/models/test_group.py
Outdated
data={ | ||
'event_id': 'a' * 32, | ||
'fingerprint': ['group-1'], | ||
'timestamp': self.two_sec_ago, |
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'd turn these into 60 seconds ago and 61 seconds ago to avoid test flakiness.
When you query snuba, it rounds the last timestamp to one second ago, which means you may miss the event added at line 95 one in a while.
f53a9c9
to
7af0c0f
Compare
Removes the "snuba.events-queries.enabled" option and legacy code paths that were not being used in production. Also removes the unused Group.get_oldest_event method. Part 4 of #13905
Updated to base on master |
tests/sentry/models/test_group.py
Outdated
data={ | ||
'event_id': 'b' * 32, | ||
'fingerprint': ['group-1'], | ||
'timestamp': self.sec_ago, |
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.
These are not almost identical anymore
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.
Oops, thanks
Codecov Report
@@ Coverage Diff @@
## master #14038 +/- ##
==========================================
- Coverage 86.81% 86.81% -0.01%
==========================================
Files 3222 3222
Lines 140420 140400 -20
Branches 4952 4952
==========================================
- Hits 121906 121887 -19
+ Misses 17124 17123 -1
Partials 1390 1390
Continue to review full report at Codecov.
|
tests/sentry/models/test_group.py
Outdated
super(GroupTest, self).setUp() | ||
self.min_ago = (timezone.now() - timedelta(minutes=1)).isoformat()[:19] | ||
self.two_min_ago = (timezone.now() - timedelta(minutes=2)).isoformat()[:19] | ||
self.sec_ago = (timezone.now() - timedelta(seconds=1)).isoformat()[:19] |
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.
Not used. You can remove it
* master: ref(admin): Convert user edit page to react (#14074) ref: Remove unused Group.get_oldest_event and legacy events behavior (#14038) ref(api): Update DELETE users/ to support hard deleting (#14068) test(OrganizationDiscoverSavedQueryDetailTest): Stabilize put test (#14077) meta(readme): Sentry logo should link to sentry.io (#14076) ref: Remove duplicate column (#14073) App platform/update permissions token auth (#14046) feat: Support issue IDs as canonical parameters ref: Change to new traceparent header for Python SDK (#14070) feat: Use option to force-disable transaction events (#14056) feat(apm): Register option to force-disable transaction events (#14055) Feat/mark sentry app installed put route (#14060) ref: Remove unused Group.event_set property (#14036) fix: Filter out groups that are pending deletion/merge from `by_qualified_short_id` (SEN-849) fix(ui): Fix resolve/ignore actions for accounts without multi… (#14058) Fix: Remove extra $.param introduced in GH-14051 (#14061) feat: Use Snuba for Group.from_event_id (#14034) fix(ui) Display implicit default sort and default to descending (#14042) fix(github) Fix 404s not being handled in repository search (#14030) fix: Pass an empty array to $.param instead of an empty string when options.query is falsey (#14051) # Conflicts: # src/sentry/utils/sdk.py
Removes the "snuba.events-queries.enabled" option and legacy code paths
that were not being used in production. Also removes the unused
Group.get_oldest_event method. Part 4 of #13905