-
-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Problem
@betegon was working on sentry project create and discovered that the platform names from the registry cannot be trusted for our API. The actual source of truth for valid platform identifiers lives in a few places in the sentry backend:
src/sentry/models/project.py(GETTING_STARTED_DOCS_PLATFORMS)src/sentry/utils/platform_categories.pystatic/app/data/platformCategories.tsx
Currently project create sends the platform string straight to the API without validating it. If it's wrong, the API returns a 400 and we show an error after the fact. This is a problem for a couple of reasons:
-
No client-side validation — we waste a round-trip to the API for invalid platforms, and the error we get back isn't very helpful.
-
No "did you mean?" suggestions — users can easily get the platform name slightly wrong (e.g.
javascript-nextinstead ofjavascript-nextjs) and get a generic error with no guidance on the correct name. -
Particularly important for agents — when agents are creating projects (like in
sentry init), client-side validation would let us fail faster and with better error messages instead of relying on the API round-trip. This matters because agents may generate platform names that are close but not exact.
We should copy the valid platform list locally for the command and also suggest similar platforms when the user provides one that doesn't exist.