Repository navigation
stewards: resolve a Sentry issue when its ticket reaches Done (BB-37) - #60
Conversation
|
Independent review running in bb thread @thread:thr_rrmdnctn9u. — from bb thread thr_nbynwz4hxz |
Review round 1 (GLM 5.3, at 4aefce5)Owner review required: yes — it widens an existing credential: the production Sentry token must be re-issued with Suggestions
Checked
— from bb thread thr_rrmdnctn9u |
|
Round 1 at
No new head; the approved sha — from bb thread thr_nbynwz4hxz |
|
LGTM |
|
Owner approved (LGTM) on — from bb thread thr_nbynwz4hxz |
|
Merged: owner-reviewed, approved by trotterdylan on This changes a live plugin, so the — from bb thread thr_nbynwz4hxz |
Implements BB-37. Fixed Sentry issues stayed open after their ticket reached Done because the stewards plugin had no Sentry write path. With the new
ops.sentry.resolveOnDoneswitch on, the Sentry look resolves a mapped issue whose ticket is in a completed state while Sentry still shows it unresolved.Classification
owner-reviewed: it widens an existing credential (the Sentry token gains
event:write) and adds a production write. Both are in the decide list's "granting or widening a credential" and "anything irreversible in production" territory; the write itself is undoable because Sentry's regression detection reopens the issue.What changes
sentry.ts:SentryReader.resolve(id)—PUT /api/0/issues/{id}/with{ "status": "resolved" }, the only write in the file; a failure is returned, never thrown.TOKEN_SCOPESgainsevent:write.sentryResolveTargetspicks the rows whose ticket is completed and whose issue is still unresolved.config.ts:ops.sentry.resolveOnDone, default off.server.ts(the Sentry look): with the switch on, resolves each such row once, one quiet note per resolve in the look (Resolved WEB-12 in Sentry: BB-N is Done). A 403 gives one note per look naming the missingevent:writescope and skips the rest of that look's resolves; the look otherwise completes. Canceled, open and already-resolved are untouched.DESIGN.md§18 andREADME.md: the plugin writes exactly one thing in Sentry, and the token needsevent:write. The provide-secret need andbb stewards checkname it throughTOKEN_SCOPES.Testing
npm testinplugins/stewards: pass (372 tests; not in the CI matrix — CI runsnpm testfor stewards, but the matrix is fixed).npm run typecheckinplugins/stewards: pass.sentry.test.ts: the PUT method/URL/body, 403 and network failures returned not thrown, no request without a token,TOKEN_SCOPESincludesevent:write, andsentryResolveTargetsleaves Canceled/open/already-resolved alone.server.test.tswith a fake fetch: the resolve PUT body and the note on resolve; Canceled/open/already-resolved untouched; switch off makes no write; a 403 yields one note namingevent:writeand skips the remaining resolves while the look completes.— from bb thread thr_nbynwz4hxz