Skip to content

project create: platform names from registry are unreliable, need client-side validation #364

@betegon

Description

@betegon

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:

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:

  1. 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.

  2. No "did you mean?" suggestions — users can easily get the platform name slightly wrong (e.g. javascript-next instead of javascript-nextjs) and get a generic error with no guidance on the correct name.

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions