Skip to content

fix(cli): Say how to connect an integration when set-commits --auto finds no repos - #1900

Merged
betegon merged 1 commit into
mainfrom
cli/set-commits-no-repos
Nov 4, 2026
Merged

betegon merged 1 commit into
mainfrom
cli/set-commits-no-repos

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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:

$ 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:

$ 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:

$ 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):

$ 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):

$ 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:

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

via bete.

--

View Session [Sentry]

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-local Ready Ready Preview Nov 3, 2026 9:24pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 3, 2026
@sentry-junior
sentry-junior Bot force-pushed the cli/set-commits-no-repos branch from 6190143 to c017b7b Compare November 3, 2026 19:51
@sentry-junior
sentry-junior Bot force-pushed the cli/set-commits-no-repos branch 2 times, most recently from 809e7c0 to af4bc84 Compare November 3, 2026 19:57
@sentry-junior
sentry-junior Bot force-pushed the cli/set-commits-no-repos branch from af4bc84 to cc7c50b Compare November 3, 2026 20:01
@sentry-junior
sentry-junior Bot added this pull request to stack #1867 November 3, 2026 20:02
@sentry-junior sentry-junior Bot changed the title fix(cli): Say how to connect a repository when set-commits finds none fix(cli): Say how to connect an integration when set-commits --auto finds no repos Nov 3, 2026
@github-actions github-actions Bot added risk: low PR risk score: low and removed risk: medium PR risk score: medium labels Nov 3, 2026
@betegon
betegon force-pushed the cli/set-commits-no-repos branch from cc7c50b to d585f10 Compare November 3, 2026 20:58
@betegon
betegon self-requested a review November 3, 2026 20:59
Base automatically changed from cli/set-commits-errors to main November 3, 2026 21:21
…inds no repos

When the org has no repositories in Sentry, `release set-commits --auto`
only said "No repository integrations configured for this organization."
(about 27% of CLI-2SK). The error now links the org's source code
integrations page, suggests `sentry integration list <org>/`, and
suggests `--local` when run inside a git checkout.

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.

Co-Authored-By: Claude <noreply@anthropic.com>
@betegon
betegon force-pushed the cli/set-commits-no-repos branch from d585f10 to 207c4e8 Compare November 3, 2026 21:21
@betegon
betegon merged commit 3273f56 into main Nov 4, 2026
29 checks passed
@betegon
betegon deleted the cli/set-commits-no-repos branch November 4, 2026 09:27
betegon added a commit that referenced this pull request Nov 4, 2026
…'t have (#1902)

Part 6 of the set-commits stack, on #1900.

About 73% of CLI-2SK is `release set-commits --commit owner/repo@sha`
naming 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:

- **Same repository under another name** (case, GitLab display names):
the error names the Sentry name 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 lookups are best-effort. If they fail, the error still links the
repository settings. Other errors pass through unchanged.

The error is a `ValidationError` with field `commit.repository`. The
next PR stops reporting it to Sentry. The release docs now say that
commits need a repository in Sentry.

<!-- 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: Miguel Betegon <miguel.betegon@sentry.io>

This branch was successfully deployed

1 active deployment
Preview — 207c4e8d Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant