Commit 58b766d
feat(init): add detect-sentry local-op for cross-language Sentry detection (#657)
## Summary
Adds a `detect-sentry` local-op so the server can delegate Sentry
detection to the CLI's existing `detectDsn()` instead of doing its own
JS-only file scanning. This is the CLI-side half of the fix for
getsentry/cli-init-api#30 — the server-side PR will simplify
`check-existing-sentry` to use this new operation.
## Changes
New `DetectSentryPayload` type and `detectSentry()` handler in the
local-ops dispatcher. The handler calls the existing DSN detector which
already scans source code, .env files, and env vars across all 140+
supported platforms.
Returns `{ status: "installed", signals: [...], dsn: "..." }` when a DSN
is found, or `{ status: "none", signals: [] }` otherwise.
## Test plan
- Existing local-ops tests pass (51/51)
- Server-side PR (getsentry/cli-init-api) has updated tests for the new
flow
- Manual: `sentry init` in a JS project (regression), then a Python/Go
project (new detection)
Closes getsentry/cli-init-api#30
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 915f2bc commit 58b766d
3 files changed
+36
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
| 328 | + | |
| 329 | + | |
327 | 330 | | |
328 | 331 | | |
329 | 332 | | |
| |||
789 | 792 | | |
790 | 793 | | |
791 | 794 | | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
792 | 815 | | |
793 | 816 | | |
794 | 817 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| |||
0 commit comments