Skip to content

feat(api): Report renamed projects with getSentryProjectRename - #131258

Merged
BYK merged 1 commit into
masterfrom
feat/api-project-rename
Nov 17, 2026
Merged

BYK merged 1 commit into
masterfrom
feat/api-project-rename

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Part of #131203. Follow-up to #131253, which covers error codes and auth challenges.

When a request uses a project's old slug, the project endpoints answer with a 302 to the same URL with the new slug. That body has slug and detail.extra, but no error code. fetch follows the redirect, so callers never see that body. They just get the renamed project's data back.

getSentryProjectRename(request, response) reports the rename anyway:

  • Followed redirect: it compares the request URL with the final response URL.
  • Unfollowed 302 (redirect: "manual" outside browsers): it reads the Location header.
  • Result: { organization, previousSlug, slug, url }, but only when the redirect stays on the same origin and only the project segment of /projects/{organization}/{project}/ changes. Everything else returns undefined.

It's classification only and never redirects. The README's new "Renamed projects" section shows how to use it from a response interceptor. Browsers hide where an unfollowed redirect points, so in a browser only followed redirects are reported.

via @BYK.

--

View Session [Sentry]

A request that uses a project's old slug gets a 302 to the same URL
with the new slug, which fetch follows. The redirect body has no error
code to match, so getSentryProjectRename compares the request URL with
the followed response URL, or with an unfollowed 302's Location, and
reports the organization, old and new slug and the new URL when only
the project slug changed. It never redirects.

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot requested review from a team as code owners November 16, 2026 15:08
@sentry-junior
sentry-junior Bot requested a review from BYK November 16, 2026 15:09
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 16, 2026
@BYK
BYK merged commit 639e1df into master Nov 17, 2026
88 checks passed
@BYK
BYK deleted the feat/api-project-rename branch November 17, 2026 12:50

This branch was successfully deployed

1 active deployment
Preview — eb5a9b43 Deployed Nov 16, 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.

1 participant