Skip to content

Conversation

@markstory
Copy link
Member

The upcoming work to adopt discover style queries means that we can no longer have special slugs. We can also use argMax() in snuba to get to the latest event when viewing an aggregated view.

This removes the special slug value handling, and relies entirely on eventSlug. Discover2 will require that all modal states need to be reachable from just the eventSlug and query state.

This change will break pagination in the short term but I'll be working on new endpoints that will allow that behavior to be restored in the short term.

Refs SEN-875

The upcoming work to adopt discover style queries means that we can no
longer have special slugs. We can also use `argMax()` in snuba to get to
the latest event when viewing an aggregated view.

This removes the special slug value handling, and relies entirely on
eventSlug. Discover2 will require that all modal states need to be
reachable from just the eventSlug and query state.

This change will break pagination in the short term but I'll be working
on new endpoints that will allow that behavior to be restored in the
short term.

Refs SEN-875
@markstory markstory requested a review from a team August 2, 2019 16:18
// * project-slug:a_bare_string:oldest
// * project-slug:/some/otherpath:deadbeef
if (value && !/^(?:[^:]+):(?:[^:]+):(?:[^:]+|latest|oldest)$/.test(value)) {
if (value && !/^(?:[^:]+):(?:[a-f0-9]+)(?:\:latest|oldest)?$/.test(value)) {
Copy link
Member

Choose a reason for hiding this comment

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

Is the project slug part of that right? Can we have : in project slug? Is every other character there really valid? If you wanted to, could also enforce that event ID has a length of 32

Copy link
Member Author

Choose a reason for hiding this comment

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

Project slugs can't have : in them. The slug generation done in project.save() removes the : from the slug.

Copy link
Member

Choose a reason for hiding this comment

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

@markstory to double check, are the colons are removed on the django side?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is still one : left between the projectid and eventid. We need to retain that one as eventids are only unique within a project.

'fields': [
['argMax', ['id', 'timestamp'], 'latest_event'],
],
},
Copy link
Member

Choose a reason for hiding this comment

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

@markstory Heads up, the docs above the SPECIAL_FIELDS variable may need to be updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

This code is not long for this world. I'll get this updated in my next set of changes.

Copy link
Member

Choose a reason for hiding this comment

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

💀

Copy link
Member

@dashed dashed left a comment

Choose a reason for hiding this comment

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

Looks good to me. 👍

I cherry picked this PR to #14225 and it works fine.

@dashed dashed mentioned this pull request Aug 6, 2019
19 tasks
@markstory markstory merged commit 5d173e3 into master Aug 6, 2019
@markstory markstory deleted the sen-875-remove-aggregate-params branch August 6, 2019 14:23
@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.

4 participants