Skip to content

feat(releases): Use routing for Releases Drawer #88562

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 26 commits into from
Apr 25, 2025

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Apr 2, 2025

Note: this does not currently handle charts inside of the drawer list.

This splits <ReleasesDrawer> into useReleasesDrawer() hook which opens drawer and renders <ReleasesDrawerList> or <ReleasesDrawerDetails>.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 2, 2025
@billyvg billyvg force-pushed the billy/replay-2-releases-drawer-needs-to-have-deeplinks branch from 5b45118 to 42c868c Compare April 4, 2025 23:01
@billyvg billyvg force-pushed the billy/replay-2-releases-drawer-needs-to-have-deeplinks branch from 42c868c to f6cde8e Compare April 7, 2025 22:29
@billyvg billyvg requested a review from a team April 7, 2025 23:39
@billyvg billyvg force-pushed the billy/replay-2-releases-drawer-needs-to-have-deeplinks branch from dd5465a to e03efe2 Compare April 8, 2025 18:48
@billyvg billyvg marked this pull request as ready for review April 8, 2025 19:04
@billyvg billyvg requested a review from a team as a code owner April 8, 2025 19:04
@billyvg billyvg force-pushed the billy/replay-2-releases-drawer-needs-to-have-deeplinks branch from 4847126 to d7dced6 Compare April 10, 2025 14:49
@billyvg billyvg requested a review from ryan953 April 10, 2025 16:23
@getsentry getsentry deleted a comment from codecov bot Apr 11, 2025
@billyvg billyvg requested a review from a team as a code owner April 11, 2025 14:57
@billyvg billyvg removed request for a team April 11, 2025 14:58
@billyvg
Copy link
Member Author

billyvg commented Apr 11, 2025

The chart rendering hack breaks the breadcrumb navigation from release details. Going to revert this back and wait until we get chart deeplinking.

@billyvg billyvg removed request for a team and ryan953 April 11, 2025 16:37
@billyvg billyvg marked this pull request as draft April 11, 2025 16:37
billyvg added a commit that referenced this pull request Apr 24, 2025
)

These hooks are using `useLocation` to spread the entire
`location.query` object (less a few fields) to the API request. Instead,
directly use pageFilters instead of the current location query object.

Required for #88562
billyvg added a commit that referenced this pull request 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
Copy link
Member

@michellewzhang michellewzhang left a comment

Choose a reason for hiding this comment

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

loading looks good now

@billyvg billyvg removed the Do Not Merge Don't merge label Apr 24, 2025
@billyvg billyvg merged commit c349789 into master Apr 25, 2025
45 checks passed
@billyvg billyvg deleted the billy/replay-2-releases-drawer-needs-to-have-deeplinks branch April 25, 2025 15:15
evanh pushed a commit that referenced this pull request Apr 25, 2025
This allows the Releases drawer to be deeplinked (including charts).

This splits `<ReleasesDrawer>` into `useReleasesDrawer()` hook which
opens drawer and renders `<ReleasesDrawerList>` or
`<ReleasesDrawerDetails>`.
@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.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants