One-click install dependencies button for sentry-triage setup gate - #2831
Merged
Conversation
liztom
force-pushed
the
sentry-triage-install-button
branch
from
August 27, 2026 07:13
654e8e8 to
ca08387
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds one-click dependency installation and Sentry authentication to the existing triage canvas.
Changes:
- Adds dependency-install and OAuth login APIs.
- Updates setup gates, live status, and organization discovery.
- Documents the streamlined setup flow.
Show a summary per file
| File | Description |
|---|---|
components/page.mjs |
Adds setup actions and dynamic organization controls. |
extension.mjs |
Connects setup handlers to canvas state. |
preflight.mjs |
Adds installation and authentication flows. |
sentryClient.mjs |
Installs and reloads the Sentry SDK and performs login. |
server.mjs |
Exposes protected setup endpoints. |
styles.mjs |
Styles setup actions and statuses. |
README.md |
Documents one-click and manual setup. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (1)
extensions/sentry-triage/sentryClient.mjs:280
- This has the same constructor mismatch after the real SDK error class is loaded:
{ code: ... }becomesexitCode, whileSENTRY_LOGIN_INCOMPLETEis discarded. Create a validSentryErrorand attach the extension-specific code separately.
throw new SentryError('Sign-in was not completed (denied, cancelled, or the code expired).', { code: 'SENTRY_LOGIN_INCOMPLETE' })
- Files reviewed: 7/7 changed files
- Comments generated: 4
- Review effort level: Balanced
liztom
force-pushed
the
sentry-triage-install-button
branch
from
August 27, 2026 07:20
ca08387 to
b50ebbf
Compare
Contributor
There was a problem hiding this comment.
Review details
Suppressed comments (1)
extensions/sentry-triage/components/page.mjs:1984
- After a successful install that still requires authentication,
applyConnectionState()hides the setup body while focus remains on its disabled install button. The success text is then written to that now-hidden live region, so keyboard and screen-reader users can lose their position without a reliable cue that the sign-in action appeared. Move focus to the newly visible sign-in button when making this transition.
fetch("/api/install-dependencies", { method: "POST" })
.then((res) => {
if (!res.ok) throw new Error("install-dependencies " + res.status);
return res.json();
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Balanced
liztom
commented
Aug 27, 2026
liztom
force-pushed
the
sentry-triage-install-button
branch
from
August 27, 2026 07:29
b50ebbf to
714a8ab
Compare
Contributor
There was a problem hiding this comment.
Review details
Suppressed comments (1)
extensions/sentry-triage/components/page.mjs:2092
- This selector always picks the connectivity lead first, including when a non-transient failure makes that panel hidden and exposes the unknown-error panel instead. Choose the lead using
sentryConn.transientso keyboard focus moves into the panel that is actually visible.
const connLead = document.querySelector("#gate-body-conn .gate-lead, #gate-body-unknown .gate-lead");
if (connLead) { connLead.setAttribute("tabindex", "-1"); connLead.focus(); }
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Balanced
liztom
force-pushed
the
sentry-triage-install-button
branch
from
August 27, 2026 16:21
714a8ab to
e00cd5d
Compare
The sentry-triage canvas's setup gate previously told users to ask
Copilot to install its optional `sentry` dependency and reload
extensions, and to run `sentry auth login` from a terminal. Both
flows were unreliable or high-friction in practice.
This adds real one-click buttons for both steps:
- sentryClient.mjs — installPackage() runs npm install (async, via
execFile so the shared extension process's event loop isn't
blocked) rooted at the file's own directory via import.meta.url, so
the path is never guessed. loadFactory() falls back to importing
the package's resolved entry file by absolute path when the bare
import('sentry') fails, since Node caches a negative resolution for
a bare specifier for the life of the process — while still
distinguishing a genuinely missing package from a transitive-
dependency defect so the latter isn't masked as "package missing."
login() fails fast with a clear message when SENTRY_AUTH_TOKEN/
SENTRY_TOKEN is active in the environment (which takes precedence
over the OAuth login this button drives), and treats an empty/
falsy auth.login() result as a failed sign-in instead of silently
re-probing.
- preflight.mjs — installDependencies() runs the install and
re-probes the connection; authenticate() classifies the new error
codes for gate messaging.
- server.mjs / extension.mjs — wire POST /api/install-dependencies
and POST /api/auth-login routes (through the existing CSRF/Host
gate) to the new preflight functions, publishing refreshed
connection state to the canvas.
- components/page.mjs / styles.mjs — the install and sign-in
buttons, with loading/success/failure states and accessible live-
region status updates; a live multi-org <select> dropdown that
rebuilds in place once org discovery completes post-signin,
without requiring a canvas reopen.
- README.md — documents the one-click flow; manual npm install /
sentry auth login kept as a fallback.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
liztom
force-pushed
the
sentry-triage-install-button
branch
from
August 27, 2026 16:30
e00cd5d to
1449123
Compare
Comment on lines
+2093
to
+2095
| if (sentryConn.reachable) { | ||
| showToast("✅ Signed in — loading your issues"); | ||
| focusActiveOrgControl(); |
aaronpowell
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
npm startand verified thatREADME.mdis up to date.mainbranch for this pull request.Description
The sentry-triage canvas's package-missing setup gate currently tells users to ask Copilot to install its optional
sentrydependency and reload extensions. In practice that flow is unreliable — an agent has to guess which of several possible directories the extension actually materialized into (repo source, user extension, project extension, or an installed plugin's own copy), and users have to manually kick the canvas afterward.This replaces that with real one-click setup buttons on the gate:
sentryClient.mjs—installPackage()runsnpm install(async, viaexecFile) rooted at the file's own directory (viaimport.meta.url), so the path is never guessed and the shared extension process's event loop isn't blocked for the duration. Concurrent install clicks share one in-flight install promise instead of queueing redundantnpm installruns.loadFactory()lazily retries the normal dynamicimport('sentry')after install while still distinguishing a genuinely missingsentrypackage from a transitive-dependency defect in an already-resolved install, so the latter isn't masked as "package missing."login()fails fast with a clear message whenSENTRY_AUTH_TOKEN/SENTRY_TOKENis active in the environment (which takes precedence over the OAuth login this button drives), treats an empty/falsyauth.login()result as a failed sign-in instead of silently re-probing, and coalesces concurrent sign-in clicks onto one in-flight OAuth flow.preflight.mjs—installDependencies()runs the install and re-probes the connection;authenticate()classifies the new error codes for gate messaging.server.mjs/extension.mjs— wirePOST /api/install-dependenciesandPOST /api/auth-loginroutes (through the existing CSRF/Host gate) to the new preflight functions, publishing refreshed connection state to the canvas.components/page.mjs/styles.mjs— the install and sign-in buttons, with loading/success/failure states and accessible live-region status updates; a live multi-org<select>dropdown that rebuilds in place once org discovery completes post-signin, without requiring a canvas reopen.README.md— documents the one-click flow; manualnpm install/sentry auth loginkept as a fallback.Verified end-to-end against a materialized installed-plugin copy: simulated a missing
sentrypackage, confirmed the gate shows, ran the install path, confirmed the connection state clears in the same process without a reload; then ran the sign-in flow through to a working multi-org canvas.New install flow:
Type of Contribution
By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.