Skip to content

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

Merged
merged 4 commits into from
Jul 18, 2019

Conversation

lynnagara
Copy link
Member

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

@lynnagara lynnagara changed the base branch from master to feat/group-model-3 July 16, 2019 18:58
@lynnagara lynnagara requested a review from a team July 17, 2019 00:08
Copy link
Contributor

@fpacifici fpacifici left a 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.

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]
Copy link
Contributor

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.

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):
Copy link
Contributor

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.

Copy link
Member Author

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

data={
'event_id': 'a' * 32,
'fingerprint': ['group-1'],
'timestamp': self.two_sec_ago,
Copy link
Contributor

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.

@lynnagara lynnagara force-pushed the feat/group-model-3 branch from f53a9c9 to 7af0c0f Compare July 17, 2019 18:06
@lynnagara lynnagara changed the base branch from feat/group-model-3 to master July 17, 2019 23:08
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
@lynnagara
Copy link
Member Author

Updated to base on master

data={
'event_id': 'b' * 32,
'fingerprint': ['group-1'],
'timestamp': self.sec_ago,
Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, thanks

@codecov
Copy link

codecov bot commented Jul 18, 2019

Codecov Report

Merging #14038 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
tests/sentry/models/test_group.py 100% <100%> (ø) ⬆️
src/sentry/models/group.py 92.71% <100%> (+0.34%) ⬆️
src/sentry/utils/metrics.py 84.61% <0%> (-3.3%) ⬇️
src/sentry/models/environment.py 98.48% <0%> (+3.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d320b1...0f671c7. Read the comment docs.

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]
Copy link
Contributor

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

@lynnagara lynnagara merged commit 9e66ffc into master Jul 18, 2019
HazAT added a commit that referenced this pull request Jul 19, 2019
* 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
@evanpurkhiser evanpurkhiser deleted the group-model-4 branch July 24, 2019 00:52
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants