Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 61 additions & 4 deletions apps/cli-docs/src/content/docs/migrating-from-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ sentry auth status

v4 is also published under the v3 names, so upgrading through the channel you
already use gets you v4. Every channel installs a `sentry` command; none
installs `sentry-cli`. Pin the major version to stay on v3.
installs a `sentry-cli` that runs v4. Pin the major version to stay on v3.

The v4 binary, when run as `sentry-cli`, and PyPI `sentry-cli`'s `sentry-cli`
command print that the command is now `sentry`, link this guide and the v3
pins, and exit 1. They never run v4 commands.

| v3 channel | What a v4 upgrade does | Stay on v3 |
|------------|------------------------|------------|
| npm `@sentry/cli` | Installs `@sentry/cli@4`, the `sentry` package under the old name. It is deprecated: switch to `sentry`. | `@sentry/cli@^3` |
| Homebrew `getsentry/tools/sentry-cli` | The formula is renamed to `getsentry/tools/sentry`. `brew update` moves your install to it, and `brew upgrade` installs v4. | `brew pin sentry-cli` before updating |
| Homebrew `getsentry/tools/sentry-cli` | The formula is renamed to `getsentry/tools/sentry`. Homebrew 6 and later don't follow the rename; see [Homebrew](#homebrew). | `brew install --cask sentry-cli` |
| PyPI `sentry-cli` | Installs the standalone v4 binary as `sentry`. | `sentry-cli<4` |
| `downloads.sentry-cdn.com/sentry-cli/<version>/` | v4 versions hold the v4 binaries, named like `sentry-linux-x64` and `sentry-darwin-arm64.gz`. | Use a 3.x version in the URL |
| Release registry `app:sentry-cli` | `latest` is v4, with download URLs on `downloads.sentry-cdn.com`. | `apps/sentry-cli/3` |
Expand All @@ -98,12 +102,35 @@ x64 or arm64, or Windows on x64 or arm64. There are no musl (Alpine) wheels; use
Sentry, also installs a `sentry` command, so do not install both into one
environment.

### Homebrew

Install v4 by its full name, `getsentry/tools/sentry`, as in
[Installation](#installation). Homebrew 6 and later load a formula from
`getsentry/tools` only if you [trust](https://docs.brew.sh/Tap-Trust) it, and
trust doesn't follow a rename. Installing by the full name trusts the formula,
so there is no separate `brew trust` step. The old name doesn't get you v4:

- `brew install getsentry/tools/sentry-cli` fails with "Refusing to load
formula getsentry/tools/sentry from untrusted tap getsentry/tools."
- An existing `sentry-cli` install stays on 3.8.2. `brew update` lists it under
"Deleted Installed Formulae", and `brew upgrade` skips it.

To stay on v3, use the `sentry-cli` cask from Homebrew's own repository. It
installs 3.8.2 as `sentry-cli` on macOS and Linux, next to `sentry` if you have
both:

```bash
brew uninstall sentry-cli # if v3 is installed from getsentry/tools
brew install --cask sentry-cli
```

### Docker

The v4 image keeps the `getsentry/sentry-cli` name and the `/work` working
directory, so `docker run --rm -v "$PWD:/work" getsentry/sentry-cli <command>`
keeps working once you update the [command names](#command-changes). v3
releases stay available under their version tags. What changed:
keeps working once you update the [command names](#command-changes). `latest`
is v4. To stay on v3, use `getsentry/sentry-cli:3`, which follows the newest
3.x release, or a 3.x version tag. What changed:

- The entrypoint runs `sentry` directly. The v3 entrypoint dropped a leading
`sentry-cli` argument and ran `sh` when asked; v4 passes every argument to
Expand All @@ -114,6 +141,36 @@ releases stay available under their version tags. What changed:
- The binary is `/usr/local/bin/sentry`; there is no `sentry-cli`. The image
includes `git`.

Copying the binary into your own image needs the new path. The v4 binary needs
glibc and `libatomic1`, so it doesn't run on Alpine:

```dockerfile
# v3
COPY --from=getsentry/sentry-cli:3 /bin/sentry-cli /usr/local/bin/sentry-cli

# v4
COPY --from=getsentry/sentry-cli /usr/local/bin/sentry /usr/local/bin/sentry
```

A GitLab CI job can't use the v4 image, because GitLab runs the job's script
with a shell. Pin `getsentry/sentry-cli:3`, or run v4 in an image that has one:

```yaml
# v3
upload-sourcemaps:
image:
name: getsentry/sentry-cli:3
entrypoint: [""]
script:
- sentry-cli sourcemaps upload ./dist

# v4
upload-sourcemaps:
image: node:22
script:
- npx --yes sentry@4 sourcemap upload ./dist
```

See [Docker](../getting-started/#docker) for usage.

## The `sentry-cli` → `sentry` rename
Expand Down
Loading