You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(telemetry): centralize sentry.org/project tags in resolution functions (#538)
Follows up on #534 which added `setContext` to `issue explain` and
`issue plan`. Rather than playing whack-a-mole with individual commands,
this moves `setOrgProjectContext()` into the shared resolution functions
that every command already calls.
### Problem
~15 commands manually called `this.setContext()` after resolution, while
~15 others (all dashboard/\*, event/view, project/\*, trial/\*,
org/view)
forgot — causing missing `sentry.org`/`sentry.project` tags on error
events for those commands.
### Solution
Add `setOrgProjectContext()` calls to the 4 resolution layers:
- `resolve-target.ts` — 6 functions (`resolveOrgAndProject`,
`resolveOrg`, `resolveAllTargets`, `resolveOrgProjectTarget`,
`resolveProjectBySlug`, `resolveOrgsForListing`)
- `trace-target.ts` — 2 functions (`resolveTraceOrgProject`,
`resolveTraceOrg`)
- `dashboard/resolve.ts` — `resolveOrgFromTarget`
Then remove `setContext` from `SentryContext` interface and all 12
command files that called it manually.
### Stats
50 files changed, +85 −350 (net −265 lines)
0 commit comments