Skip to content

fix(coding-conventions): Migrate ReleaseSeries class component to hook - #125156

Open
sentry[bot] wants to merge 2 commits into
masterfrom
seer/ref-release-series-hook
Open

sentry[bot] wants to merge 2 commits into
masterfrom
seer/ref-release-series-hook

Conversation

@sentry

@sentry sentry Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

This PR addresses the no-class-components linting rule violation in static/app/components/charts/releaseSeries.tsx.

The ReleaseSeries component was a deprecated React class component, marked with @deprecated use useReleaseBubbles instead. To comply with coding conventions and improve maintainability, its logic has been refactored into a new useReleaseSeries React hook.

Changes Made:

  1. static/app/components/charts/releaseSeries.tsx:

    • The ReleaseSeries class component has been removed.
    • All its core logic, including data fetching, pagination, and series building, has been extracted into a new useReleaseSeries hook.
    • The ReleaseSeries component is now a thin functional component that uses the useReleaseSeries hook and maintains its render-prop API for backward compatibility.
    • The withApi, withOrganization, and withTheme HOCs have been replaced with their respective hooks (useApi, useOrganization, useTheme).
    • Bug Fix 1 (Infinite Render Loop): The emphasizeReleases = [] default in the hook's signature, which caused an infinite render loop due to creating a new array reference on every render, has been removed. A stable emphasizeReleasesKey (serialized string) is now used as a dependency for the relevant useEffect.
    • Bug Fix 2 (Unnecessary Refetches): The useEffect responsible for data fetching previously used reference equality for start, end, projects, and environments. This led to unnecessary refetches and error toasts when these props (e.g., Date objects, arrays) were recreated with the same values by callers. This has been fixed by introducing stable serialized keys (startKey, endKey, projectsKey, environmentsKey) for these dependencies, ensuring value-based comparison.
  2. static/app/views/insights/common/components/chart.tsx:

    • Updated to directly consume the useReleaseSeries hook instead of the <ReleaseSeries> render-prop component.
  3. static/app/views/projectDetail/charts/projectBaseSessionsChart.tsx:

    • Updated to directly consume the useReleaseSeries hook instead of the <ReleaseSeries> render-prop component.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes CODING-CONVENTIONS-56H

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

@sentry
sentry Bot requested review from a team as code owners September 21, 2026 23:10
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 21, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread static/app/components/charts/releaseSeries.tsx Outdated
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 95.56% 95.56% ±0%
Typed 140,020 140,045 🟢 +25
Untyped 6,511 6,510 🟢 -1
🔍 4 new type safety issues introduced

any-typed symbols (4 new)

File Line Detail
static/app/components/charts/releaseSeries.tsx 123 api (var)
static/app/components/charts/releaseSeries.tsx 124 organization (var)
static/app/components/charts/releaseSeries.tsx 153 organizationRef (var)
static/app/components/charts/releaseSeries.tsx 183 org (var)

This is informational only and does not block the PR.

@sentry sentry Bot changed the title ref(charts): Migrate ReleaseSeries to useReleaseSeries hook fix(coding-conventions): Convert ReleaseSeries class component to functional hook Sep 21, 2026
@sentry
sentry Bot force-pushed the seer/ref-release-series-hook branch from ea5f26e to 032554c Compare September 21, 2026 23:16

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread static/app/components/charts/releaseSeries.tsx
@sentry sentry Bot changed the title fix(coding-conventions): Convert ReleaseSeries class component to functional hook fix(coding-conventions): Migrate ReleaseSeries class component to hook Sep 21, 2026
@sentry
sentry Bot force-pushed the seer/ref-release-series-hook branch from 5c8a46d to fef8e0c Compare September 21, 2026 23:22

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0a2ae4b. Configure here.

Comment thread static/app/components/charts/releaseSeries.tsx

This branch had an error being deployed

1 failed deployment
Preview 0a2ae4b1 Deployed Sep 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants