Skip to content

ref: replace withOrganization with useOrganization in function components#115343

Merged
evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/ref-replace-withorganization-with-useorganization-in-function-components
May 21, 2026
Merged

ref: replace withOrganization with useOrganization in function components#115343
evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/ref-replace-withorganization-with-useorganization-in-function-components

Conversation

@evanpurkhiser
Copy link
Copy Markdown
Member

Swap the 17 trivial (already-FC) consumers of withOrganization to call useOrganization directly. The HoC itself stays — the class-component consumers will need conversion first.

Where withOrganization was the only HoC wrapping the export, the file moves to a named export (and its importers update to match) because the no-default-exports eslint rule disallows plain-identifier default exports. Two of those (organizationAuthTokens/index.tsx and organizationIntegrations/pluginDetailedView.tsx) are lazy-imported in router/routes.tsx, so the lazy import unwraps the named export into a {default: ...} shape.

Follow-up to #115334 (drop withSentryAppComponents HoC), continuing the legacy HoC cleanup.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.61%

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-replace-withorganization-with-useorganization-in-function-components branch from d012250 to 5caa581 Compare May 20, 2026 15:53
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Backend Test Failures

Failures on 4301352 in this run:

tests/sentry/integrations/perforce/test_pipeline.py::PerforceApiPipelineTest::test_auth_failure_returns_errorlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/perforce/test_pipeline.py:92: in test_auth_failure_returns_error
    assert "Authentication failed" in resp.data["data"]["detail"]
                                      ^^^^^^^^^^^^^^^^^
E   KeyError: 'data'
tests/sentry/integrations/perforce/test_pipeline.py::PerforceApiPipelineTest::test_connection_failure_returns_errorlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/perforce/test_pipeline.py:115: in test_connection_failure_returns_error
    assert "Failed to connect" in resp.data["data"]["detail"]
                                  ^^^^^^^^^^^^^^^^^
E   KeyError: 'data'
tests/sentry/integrations/perforce/test_pipeline.py::PerforceApiPipelineTest::test_successful_connectionlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/perforce/test_pipeline.py:68: in test_successful_connection
    assert resp.status_code == 200
E   assert 400 == 200
E    +  where 400 = <Response status_code=400, "application/json">.status_code

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-replace-withorganization-with-useorganization-in-function-components branch from 5caa581 to 6073dc0 Compare May 21, 2026 14:16
@evanpurkhiser evanpurkhiser marked this pull request as ready for review May 21, 2026 14:16
@evanpurkhiser evanpurkhiser requested review from a team as code owners May 21, 2026 14:16
@evanpurkhiser evanpurkhiser enabled auto-merge (squash) May 21, 2026 14:16
…ents

Swap the 17 trivial (already-FC) consumers of withOrganization to call
useOrganization directly. The HoC itself stays — the class-component
consumers will need conversion first.

Where withOrganization was the only HoC wrapping the export, the file
moves to a named export (and its importers update to match) because the
no-default-exports eslint rule disallows plain-identifier default
exports.
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-replace-withorganization-with-useorganization-in-function-components branch from 6073dc0 to 54da118 Compare May 21, 2026 14:28
@evanpurkhiser evanpurkhiser merged commit 2030355 into master May 21, 2026
71 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-replace-withorganization-with-useorganization-in-function-components branch May 21, 2026 14:47
JonasBa pushed a commit that referenced this pull request May 21, 2026
…ents (#115343)

Swap the 17 trivial (already-FC) consumers of `withOrganization` to call
`useOrganization` directly. The HoC itself stays — the class-component
consumers will need conversion first.

Where `withOrganization` was the only HoC wrapping the export, the file
moves to a named export (and its importers update to match) because the
`no-default-exports` eslint rule disallows plain-identifier default
exports. Two of those (`organizationAuthTokens/index.tsx` and
`organizationIntegrations/pluginDetailedView.tsx`) are lazy-imported in
`router/routes.tsx`, so the lazy import unwraps the named export into a
`{default: ...}` shape.

Follow-up to #115334 (drop withSentryAppComponents HoC), continuing the
legacy HoC cleanup.
natemoo-re pushed a commit that referenced this pull request May 21, 2026
…ents (#115343)

Swap the 17 trivial (already-FC) consumers of `withOrganization` to call
`useOrganization` directly. The HoC itself stays — the class-component
consumers will need conversion first.

Where `withOrganization` was the only HoC wrapping the export, the file
moves to a named export (and its importers update to match) because the
`no-default-exports` eslint rule disallows plain-identifier default
exports. Two of those (`organizationAuthTokens/index.tsx` and
`organizationIntegrations/pluginDetailedView.tsx`) are lazy-imported in
`router/routes.tsx`, so the lazy import unwraps the named export into a
`{default: ...}` shape.

Follow-up to #115334 (drop withSentryAppComponents HoC), continuing the
legacy HoC cleanup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants