Repository navigation
feat(api): Report renamed projects with getSentryProjectRename - #131258
Merged
Merged
Conversation
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]>
BYK
approved these changes
Nov 17, 2026
2 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
sluganddetail.extra, but no errorcode.fetchfollows the redirect, so callers never see that body. They just get the renamed project's data back.getSentryProjectRename(request, response)reports the rename anyway:redirect: "manual"outside browsers): it reads theLocationheader.{ 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 returnsundefined.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]