Skip to content

Deeplinking to Releases Drawer List (Global Drawer) #88560

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

Closed
billyvg opened this issue Apr 2, 2025 · 3 comments
Closed

Deeplinking to Releases Drawer List (Global Drawer) #88560

billyvg opened this issue Apr 2, 2025 · 3 comments

Comments

@billyvg
Copy link
Member

billyvg commented Apr 2, 2025

For the new Releases Drawer, we want to be able to deep link into the drawer. There are currently two ways to open up the drawer:

  • Clicking a link to a specific release (not implemented yet) opens up the drawer and shows some details about that release. This is pretty straight forward in terms of linking.
  • Clicking a release bubble on a chart opens up the drawer and displays the chart from where the bubble was clicked on (but zoomed into the bubble’s date boundaries) and a table of the releases within that bubble. The table is straight forward in terms of linking, it is the chart that is a bit more complicated and will be the focus of this ticket.

There are also currently two entry points (i.e. the views that contain the charts that will open the drawer) where you can link to/open the global drawer: Insights and Issue Details.

Problem

We need a method to represent a single chart via URL parameters so that we can render the chart inside of the Global Drawer. We currently need to render two (+ possibly more in future) different chart components that take in a variety of props that can be tricky to serialize into URL params.

Potential Solutions

1. Serializing props to URL parameters

For each chart, we could determine the unique parameters it needs to be able to render the chart and use them directly in the URL. This will probably mean a lot of data being saved to the URL. This also might be hard to maintain as we add more charts.

1a. Map props to an ID

Instead of preserving all props in the URL, we could instead give each chart a unique id and use that to map to the props required to render the chart. We would need to refactor our current charts to make sure they render using the same method so that the chart logic does not get desynced.

2. React Context

Views that render a release-enabled chart would need to register a rendering function w/ a release drawer context. We could then pass an id unique to that chart in the URL parameters for the Global Drawer to use for context lookup. This means that the drawer would need to wait for the chart to register/render on the page before it can render in the drawer. It also means that the chart cannot render independently of the page. This isn’t currently a concern, but could be if we wanted to be able to render the releases list outside of clicking on a release bubble.

@getsantry
Copy link
Contributor

getsantry bot commented Apr 2, 2025

Routing to @getsentry/product-owners-releases for triage ⏲️

@gggritso
Copy link
Member

gggritso commented Apr 2, 2025

Wow, this is really hard! I'm trying to tease apart all the factors here by working backwards from what I think a good future is.


Firstly, I think we want IDs in the URL, rather than parameters for the panel chart. I think we want to avoid having users deal with long URLs, potentially getting them wrong, potentially creating impossible charts, etc. With IDs we can store configurations in the code, which will let us update those configurations, make sure that the graph on the page always matches the panel, etc.

Supporting argument 1: Having an ID per chart is probably good for us. That would let us store chart legend selection in localStorage, for example, and manually unsync series between charts if we want.

Supporting argument 2: Having an ID per chart is how Dashboards work. If/when we introduce release panels in Dashboards, those charts will get their configs from the widget rather than the URL, otherwise someone might change a widget and then a link to the widget's releases would have a bad, old configuration.

Supporting argument 3: Configurable Release Health charts are using this kind of approach already, assigning unique names to chart components, so they can be moved around the page. Charts like having IDs!

Counter-argument 1: parameters in the URL are more flexible, and probably simpler. Each chart only needs to store a few parameters in the URL (yAxis, query, etc.) so it's probably not that hard to serialize those in practice.

Counter-argument 2: The date bounds of the release for the panel have to be in the URL, so there's going to be at least some URL serialization anyway


Secondly, I think we want each chart to be independent of the main page. I think. Coordinating the rendering and/or the data loading with the main page seems like it's be really hard? You tell me. A good end result here would be that the chart in the panel loads fast, independently of the page, and I'm still stuck on having it load a higher data resolution than the main page. This'll probably be a lot of work.

Supporting argument 1: There is some appetite for having charts load their own data, and some charts already do (all the new Release Health charts, some of the landing page charts). When charts load their own data, it usually improves perceived performance if some charts are able to load faster than others.

Counter-argument 1: It'll be for real a lot of work to do this, and probably with some strange gotchas.

Counter-argument 2: Supporting multiple chart types will be annoying for sure. That said, we're working hard to reduce the number of chart types, and are making headway, so maybe this won't be that bad?

@billyvg
Copy link
Member Author

billyvg commented Apr 9, 2025

I did two quick PoCs (#89045 and #88864) - and the former is what we will be doing. It's cleaner and has some small benefits with existing usage of the widgets, but mostly we want the flexibility in the future for deeplinking directly to widgets.

Next steps:

  • Refactor existing insights widgets into self-contained widgets that handle their own data fetching. We will need a convention for naming as we will need to dynamically load the widgets based on a unique id/string. e.g. chartId/Name == component name == filename.
  • Add an optional id prop on TimeSeriesVisualizationWidget`. This will be used to generate links to the chart (e.g. in Releases Drawer). This will be optional until all charts are converted.
  • Create a <WidgetLoader> that accepts an id and dynamically imports the widget that renders a chart [with data]. We'll need to think about loading (and error) states here. If we use a spinner for the dynamic import, that means once the module is loaded, we'll have another + different spinner for data fetching. The two spinners will look like it's stutter if they are not perfectly synced up (they won't be).
    • Widget loader will need to be able to load the Insights widgets AND <EventGraph> in Issue Details
  • Refactor <EventGraph /> so that we can use only the chart and add a data-fetching wrapper around it for Release Drawer e.g. we can only pass groupId (do we need eventId as well?)
  • Refactor Insights widgets so that they can accept non-pageFilters params when necessary. e.g. in Releases Drawer, we have a smaller timeframe to show
  • Links to open the Releases Drawer need to include a chartId (+ possibly chart type? e.g. insights vs event graph). Assuming that not all Insights widgets are converted, we'll want to be able to render the chart if id is available, otherwise keep previous behavior.
  • Eventually all Insights widgets will be loaded via <WidgetLoader>
  • Add lint rule to disallow directly importing TimeSeriesVisualizationWidget (or rather the LineSeries, etc wrappers around it)

billyvg added a commit that referenced this issue Apr 10, 2025
…> Http pages

As part of an effort to be able to [deeplink to charts via the Releases Drawer](#88560), we need to move data fetching + chart rendering into a self-contained component (with a unique id).

This refactors the widgets on `httpLandingPage` and `httpDomainSummaryPage` so that we get an idea of what this will look like.
billyvg added a commit that referenced this issue Apr 10, 2025
billyvg added a commit that referenced this issue Apr 11, 2025
…> Http pages (#89325)

As part of an effort to be able to [deeplink to charts via the Releases
Drawer](#88560), we need to
move data fetching + chart rendering into a self-contained component
(with a unique id).

This refactors the widgets on `httpLandingPage` and
`httpDomainSummaryPage` so that we get an idea of what this will look
like before continuing on to do others.
billyvg added a commit that referenced this issue Apr 14, 2025
billyvg added a commit that referenced this issue Apr 15, 2025
…89455)

Inside of the Releases Drawers, we are only viewing a smaller slice of
time than the main PageFilters. The chart widgets and their hooks need
to support a pageFilters override. I think env/projects should be the
same, but I think it will be more consistent to pass around the full
pageFilters object. `showReleaseAs` is also needed since we currently
show lines inside of the drawer, and bubbles outside of it.

Need as part of #88560
billyvg added a commit that referenced this issue Apr 15, 2025
billyvg added a commit that referenced this issue Apr 15, 2025
billyvg added a commit that referenced this issue Apr 15, 2025
Move into its own component and parse location query itself

Part of #88560
billyvg added a commit that referenced this issue Apr 16, 2025
gggritso added a commit that referenced this issue Apr 17, 2025
… widgets (#89714)

Part of #88560
Closes REPLAY-90

---------

Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com>
gggritso added a commit that referenced this issue Apr 17, 2025
Part of #88560
Follow-up to #89325

---------

Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com>
gggritso added a commit that referenced this issue Apr 17, 2025
Move into its own component and parse location query itself

Part of #88560

---------

Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com>
billyvg added a commit that referenced this issue Apr 22, 2025
Refactors the Insights -> LLM charts to better support deep linking in a
future PR.

Notable in this PR is the introduction of a `chartProperties` prop for
`LoadableChartWidgetProps`. These are to be used as URL query params
when linking to the Releases Drawer, but also used to render the chart
as well. They are chart-specific, which is the reason for the additional
level of object nesting.

Part of #88560
billyvg added a commit that referenced this issue Apr 22, 2025
Refactors the Insights -> LLM charts to better support deep linking in a
future PR.

Notable in this PR is the introduction of a `chartProperties` prop for
`LoadableChartWidgetProps`. These are to be used as URL query params
when linking to the Releases Drawer, but also used to render the chart
as well. They are chart-specific, which is the reason for the additional
level of object nesting.

Part of #88560
andrewshie-sentry pushed a commit that referenced this issue Apr 22, 2025
…> Http pages (#89325)

As part of an effort to be able to [deeplink to charts via the Releases
Drawer](#88560), we need to
move data fetching + chart rendering into a self-contained component
(with a unique id).

This refactors the widgets on `httpLandingPage` and
`httpDomainSummaryPage` so that we get an idea of what this will look
like before continuing on to do others.
andrewshie-sentry pushed a commit that referenced this issue Apr 22, 2025
…89455)

Inside of the Releases Drawers, we are only viewing a smaller slice of
time than the main PageFilters. The chart widgets and their hooks need
to support a pageFilters override. I think env/projects should be the
same, but I think it will be more consistent to pass around the full
pageFilters object. `showReleaseAs` is also needed since we currently
show lines inside of the drawer, and bubbles outside of it.

Need as part of #88560
andrewshie-sentry pushed a commit that referenced this issue Apr 22, 2025
… widgets (#89714)

Part of #88560
Closes REPLAY-90

---------

Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com>
andrewshie-sentry pushed a commit that referenced this issue Apr 22, 2025
Part of #88560
Follow-up to #89325

---------

Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com>
andrewshie-sentry pushed a commit that referenced this issue Apr 22, 2025
Move into its own component and parse location query itself

Part of #88560

---------

Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com>
billyvg added a commit that referenced this issue Apr 24, 2025
This PR creates a "chart widget" similar to what we did for Insights
widgets (e.g. #89344). This is
so that we can deep-link to the `EventGraph` using only `groupId` from
URL parameters.

This also makes some changes to `EventGraph` so that we can use a custom
date range (/page filters). This is used when we click a release bubble,
we want the chart in the drawer to refetch the same stats (but at a
different interval) according to the bubble's time bucket.


Part of #88560
billyvg added a commit that referenced this issue Apr 24, 2025
Refactors the Insights -> LLM charts to better support deep linking in a
[future PR](#88562).

Notable in this PR is that these widgets are used in 3 different
sections:

1) Landing Page - no additional args
2) Details Page - takes a `groupId` from URL parameters
3) "LLM Monitor Section" (group details page) - The wrapping components
takes in an `event` argument, which uses the trace (span id + trace id)
to query for a groupId to pass to widgets

We're going to refactor the 3 widgets into:
- ~(3) base widgets that accept an optional `groupId` (referring to AI
Pipeline Group, and not our normal Issues Group)~
- (3) widgets that do not require a groupId from URL params. These
widgets handle point 1) above
- (3) widgets that use `groupId` from URL parameters. These widgets
handle points ~1) and~ 2) above.
- (2) widgets (`llmEvent*`) that take `groupId` (Issues Group!) and
`eventId` from URL parameters to fetch the Issues Group, and then tries
to find the AI Pipeline Group id via the event's trace. This AI Pipeline
Group ID is then used in the query and renders the appropriate charts.
These widgets account for point 3) above.

~In order to handle this[^1] (and for future widgets), this PR
introduces a `chartProperties` prop for `LoadableChartWidgetProps`.
These are to be used as URL query params when linking to the Releases
Drawer, but also used to render the chart as well. They are
chart-specific, which is the reason for the additional level of object
nesting. Think of it as these two stages:~

~- "Serialization": we have a chart, and want to "serialize" it into a
URL. This will involve 2 steps~
~- taking the *keys* of `chartProperties` object and using a known query
parameter key (e.g. `rdChartPropertyKey`) to create a list of query
parameters (e.g. `rdChartPropertyKey=foo&rdChartPropertyKey=bar`)~
~- turning `chartProperties` into query parameters (e.g.
`foo=val1&bar=val2`)~

~- "Parsing": inverse of "serialization" -- we have a URL and want to
render a chart.~
~- using known key (`rdChartPropertyKey`), we're able to fetch the keys
of `chartProperties` (which can vary from chart to chart)~
~- with the keys, we can again look through the query parameters to get
the values for each key~
  
~The known key (e.g. `rdChartPropertKey`) acts as an indirect pointer to
the `chartProperties` object which has dynamic keys. See [this
commit](00d9fd6#diff-0269df2be334787a8238014bd4dae87472c3adf1b5f8021a7a151fc464427c3fR33-R42)
for an example.~


Part of #88560


[^1]: There is another solution, since (1) and (2) can be handled
without any changes, we would just need slightly diff widgets for (3)
where it's mostly the same except it expects `eventId` to available via
URL params and it fetches the event to get the trace and then fetches
the group id
@billyvg billyvg closed this as completed Apr 25, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

2 participants