Repository navigation
fix(api): Unescape literal characters in generated API URL types - #128751
Merged
Merged
Conversation
The generator copied a route regex's escapes into the TypeScript union, so a route matching a literal dot, like \.git, came out as '$repositoryId\.git'. oxlint rejects that string as a useless escape. Escaped punctuation is now written as the character itself. Refs CW-2222
Contributor
Sentry Snapshot Testing
Base commit |
vaind
marked this pull request as ready for review
October 26, 2026 11:58
vaind
added a commit
that referenced
this pull request
Oct 27, 2026
The generator copied the route's `\.git` escape into the TypeScript type, which oxlint rejects as a useless escape. With the generator from #128751 merged in, the type spells it `.git`.
scttcper
approved these changes
Oct 27, 2026
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.
CI turns every Django API route into a TypeScript string in
knownSentryApiUrls.generated.ts, so frontend calls togetApiUrl()are checked against real routes. The generator stripped regex groups and character classes but copied escapes through, so a route that matches a literal dot, such as\.gitin the git endpoint added in #128444, came out as'/internal/scm-git/repositories/$repositoryId\.git/$route'. oxlint rejects that string as a useless escape, which fails lint on any PR that adds such a route.Escaped punctuation is now written as the character itself (
$repositoryId.git). No route on master has an escape, so the generated file doesn't change here.Refs CW-2222