Repository navigation
fix(cli): Explain set-commits --commit repositories that Sentry doesn't have - #1902
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
betegon
force-pushed
the
cli/set-commits-commit-repo
branch
from
November 3, 2026 20:58
1bc5724 to
a477d55
Compare
betegon
self-requested a review
November 3, 2026 20:59
betegon
force-pushed
the
cli/set-commits-commit-repo
branch
from
November 3, 2026 21:21
a477d55 to
72d63d0
Compare
betegon
pushed a commit
that referenced
this pull request
Nov 4, 2026
…inds no repos (#1900) Part 5 of the set-commits stack. #1866 has merged, so this is now on `main`. Splits CLI-2SK into one PR per fix. When the org has no repositories in Sentry, `release set-commits --auto` only said "No repository integrations configured for this organization." That's about 27% of CLI-2SK. Nothing on the command line can fix it, so the error now says where to go next: - It links the org's source code integrations page (`/settings/integrations/?category=source%20code%20management`). - It suggests `sentry integration list <org>/`. - It suggests `--local` when run inside a git checkout. The CLI can't install integrations (`sentry integration` only has `list` and `delete`, and GitHub needs a browser install), so the error sends people to the Sentry UI. It stays an `ApiError` with the same message and 404 status, so default mode still falls back to local history and error reporting still silences it. The rest of CLI-2SK is in #1902 (`--commit` with a repository Sentry doesn't have) and #1903 (stop reporting that one as a CLI error). ## Before / after The real CLI, run from source, against a local mock of the Sentry API for an org `acme` with no repositories. Before is `8eba364a` (the old base, before this change). After is `207c4e8d`, the current head on `main`. **Git checkout, `origin` = `github.com/acme/web`** Before: ```console $ sentry release set-commits acme/1.0.0 --auto Error: No repository integrations configured for this organization. Endpoint: organizations/acme/releases/1.0.0/ ``` After: ```console $ sentry release set-commits acme/1.0.0 --auto Error: No repository integrations configured for this organization. Endpoint: organizations/acme/repos/ Connect GitHub, GitLab, Bitbucket, or Azure DevOps to Sentry and add the repository: https://acme.sentry.io/settings/integrations/?category=source%20code%20management Try: sentry integration list acme/ sentry release set-commits acme/1.0.0 --local ``` **No `.git`, repository from CI variables (`GITHUB_REPOSITORY`, `GITHUB_SHA`)** Before: ```console $ sentry release set-commits acme/1.0.0 --auto [info] [api.releases] No 'origin' git remote found. Using acme/web@4f2c9e1b7a3d from GITHUB_REPOSITORY/GITHUB_SHA. Error: No repository integrations configured for this organization. Endpoint: organizations/acme/releases/1.0.0/ ``` After (no `--local`, since there's no git history to read): ```console $ sentry release set-commits acme/1.0.0 --auto [info] [api.releases] No 'origin' git remote found. Using acme/web@4f2c9e1b7a3d from GITHUB_REPOSITORY/GITHUB_SHA. Error: No repository integrations configured for this organization. Endpoint: organizations/acme/repos/ Connect GitHub, GitLab, Bitbucket, or Azure DevOps to Sentry and add the repository: https://acme.sentry.io/settings/integrations/?category=source%20code%20management Try: sentry integration list acme/ ``` Both exit with code 30, before and after. **Unchanged: default mode still falls back to local history** (same output before and after): ```console $ sentry release set-commits acme/1.0.0 [warn] [release.set-commits] Could not auto-discover commits (no repository integration). Falling back to local git history. Commits Set: 1.0.0 ``` **The suggested command runs:** ```console $ sentry integration list acme/ No integrations found in organization 'acme'. ``` ## The integrations link - **Sentry's UI uses the same link.** The onboarding "link a repository" task (`static/app/components/onboardingWizard/taskConfig.tsx`) and the stack trace "add integration" banner (`addIntegrationBanner.tsx`) both link `/settings/${org}/integrations/` with `query: {category: 'source code management'}`. - **The filter shows the right integrations.** The directory reads `location.query.category` (`integrationListDirectory.tsx`). `getCategories` in `integrationUtil.tsx` maps the `commits` feature to `source code management`. The integrations with `IntegrationFeatures.COMMITS` are GitHub, GitHub Enterprise, GitLab, Bitbucket, Bitbucket Server, Azure DevOps (`vsts`), and Perforce. - **The page exists.** `https://sentry.sentry.io/settings/integrations/?category=source%20code%20management` returns a 302 to the org login (`/auth/login/sentry/`). A settings path that doesn't exist redirects to `/settings/sentry/` instead. - **Self-hosted** uses `/settings/<org>/integrations/`, which is covered by `sentry-urls.property.test.ts`. <!-- junior-request-attribution:start --> via **bete**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0C615WFS9G%3A1793734411.837769 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AC0C615WFS9G%3A1793734411.837769) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0C615WFS9G%3A1793734411.837769/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
betegon
force-pushed
the
cli/set-commits-commit-repo
branch
from
November 4, 2026 09:27
72d63d0 to
339c2ed
Compare
sentry-junior
Bot
force-pushed
the
cli/set-commits-commit-repo
branch
from
November 4, 2026 09:29
339c2ed to
9253290
Compare
…'t have
About 73% of CLI-2SK is `release set-commits --commit owner/repo@sha`
naming a repository the org doesn't have. Sentry matches the name
exactly (`Release.set_refs`) and answers with
`{"refs":["Invalid repository names: ..."]}`, which the CLI showed as
"API request failed: 400 Bad Request".
The CLI now looks the repository up and says which case applies:
- The org has it under another name (case, GitLab display names): the
error names it and gives a ready-to-run `--commit` command.
- The org has no repositories: the error links the source code
integrations page and suggests `sentry integration list`.
- The repository isn't added: the error lists up to three similar
names, `sentry repo list`, and the repository settings link.
The error is a ValidationError with field "commit.repository". The
release docs now say commits need a repository in Sentry.
Co-Authored-By: Miguel Betegon <miguel.betegon@sentry.io>
sentry-junior
Bot
force-pushed
the
cli/set-commits-commit-repo
branch
from
November 4, 2026 09:59
9253290 to
49bc712
Compare
betegon
added a commit
that referenced
this pull request
Nov 4, 2026
… differs in form (#1948) Part of the CLI-2SK work. The branch is based on `main` after #1902. #1903 was closed and is not part of this change. Sentry matches `--commit` repository names exactly (`Release.set_refs`, `name__in`). A name that refers to the same repository but is written differently, for example in a different case, fails with `Invalid repository names`. On Vercel production builds, `@sentry/bundler-plugins` passes `VERCEL_GIT_REPO_OWNER/VERCEL_GIT_REPO_SLUG` as-is, which is one way to end up with such a name. **Change.** When the server rejects `--commit` refs as invalid repository names, the CLI now looks up each rejected name with the same matching `--auto` uses (`findSentryRepository`: case-insensitive name, URL path, GitLab display names). If every rejected name matches a Sentry repository, the CLI retries once with Sentry's names and prints a warning for each name it replaced. If any rejected name has no match, or the lookup fails, the command fails with #1902's error and next steps, unchanged. The commit range (`PREV..SHA`) the caller passed is kept. ## Before / after The CLI was run from source against a local stand-in for the Sentry API that rejects names the way `Release.set_refs` does. "Before" is `main` at `08fac06c` (#1902), "after" is this branch. ### Same repository, different case (org `acme` has `acme/web`) **Before** ```console $ sentry release set-commits acme/1.0.0 --commit 'Acme/Web@abc1234..def5678' Error: Sentry organization 'acme' has no repository named 'Acme/Web'. It has 'acme/web'. --commit needs the repository name exactly as Sentry shows it. Try: sentry release set-commits acme/1.0.0 --commit 'acme/web@abc1234..def5678' # exit 21 ``` **After** ```console $ sentry release set-commits acme/1.0.0 --commit 'Acme/Web@abc1234..def5678' [warn] [api.releases] Sentry organization 'acme' has no repository named 'Acme/Web'. Using 'acme/web', the same repository in Sentry. Commits Set: 1.0.0 ━━━━━━━━━━━━━━━━━━ ╭─────────┬───────╮ │ Version │ 1.0.0 │ │ Commits │ 3 │ ╰─────────┴───────╯ # exit 0 ``` The retry sends `acme/web` with the same `abc1234..def5678` range. ### One name matches, another has no match (org `acme` has only `acme/web`) Before and after are the same. No retry runs, and no "Using ..." warning is printed: ```console $ sentry release set-commits acme/1.0.0 --commit 'Acme/Web@abc1234..def5678,Acme/Api@def5678' Error: Sentry organization 'acme' has no repository named 'Acme/Web'. It has 'acme/web'. --commit needs the repository name exactly as Sentry shows it. Try: sentry release set-commits acme/1.0.0 --commit 'acme/web@abc1234..def5678' # exit 21 ``` ### Org has no repositories Before and after are the same: ```console $ sentry release set-commits acme/1.0.0 --commit 'Acme/Web@abc1234..def5678' Error: Sentry organization 'acme' has no repository named 'Acme/Web'. It has no repositories yet, so it cannot associate commits. Try: sentry integration list acme/ Note: Connect GitHub, GitLab, Bitbucket, or Azure DevOps to Sentry and add the repository: https://acme.sentry.io/settings/integrations/?category=source%20code%20management # exit 21 ``` ### Repository not in Sentry, similar names exist (org `acme` has `acme/website`, `acme/web-app`, `acme/api`) Before and after are the same: ```console $ sentry release set-commits acme/1.0.0 --commit 'Acme/Web@abc1234..def5678' Error: Sentry organization 'acme' has no repository named 'Acme/Web'. It has similarly named repositories: acme/website, acme/web-app. Try: sentry release set-commits acme/1.0.0 --commit 'acme/website@abc1234..def5678' sentry release set-commits acme/1.0.0 --commit 'acme/web-app@abc1234..def5678' sentry repo list acme/ Note: Add the repository to Sentry through your source code integration: https://acme.sentry.io/settings/repos/ # exit 21 ``` ## Why the CLI and not only the plugin The fix applies to every `--commit` caller: the bundler plugin, CI scripts and people. The plugin keeps passing Vercel's previous deployment SHA, so the range doesn't change. ## Tests - `correctRefRepositories`: case-only correction (with its warning), no match, a later name with no match (no warning, no retry), other errors (no lookup), lookup failure. - `set-commits --commit` retries with the corrected refs. - The release, error-reporting and URL suites pass (284 tests), and `pnpm run lint` passes. I did not run the full suite. <!-- junior-request-attribution:start --> via @betegon. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0C615WFS9G%3A1793734411.837769 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AC0C615WFS9G%3A1793734411.837769) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0C615WFS9G%3A1793734411.837769/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Miguel Betegon <28983162+betegon@users.noreply.github.com> Co-authored-by: bete <miguel.betegon@sentry.io>
7 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 6 of the set-commits stack, on #1900.
About 73% of CLI-2SK is
release set-commits --commit owner/repo@shanaming a repository the org doesn't have. Many of these come from Vercel builds, where the bundler plugin passes the repository name. Sentry matches names exactly (Release.set_refs,name__in) and answers with{"refs":["Invalid repository names: ..."]}. The CLI only showed "API request failed: 400 Bad Request".The CLI now looks the repository up and says which case applies:
--commitcommand.sentry integration list.sentry repo list, and the repository settings link.The lookups are best-effort. If they fail, the error still links the repository settings. Other errors pass through unchanged.
The error is a
ValidationErrorwith fieldcommit.repository. The next PR stops reporting it to Sentry. The release docs now say that commits need a repository in Sentry.via bete.
--
View Session [Sentry]