Add telemetry for "open on github" - #8941
Merged
Merged
Conversation
Giuseppe Cianci (Giuspepe)
approved these changes
Sep 9, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
A new test uses a non-standard assert default import that likely breaks compilation/linting given existing repository test import conventions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
src/test/github/openOnGitHub.test.ts — This test file uses a default import form for Node's assert module, but the rest of the repo’s… |
What changed in this PR
This PR centralizes “Open on GitHub” behavior and adds telemetry emission for both pull requests and issues when opening their GitHub URLs.
Changes:
- Introduces a shared
openIssueOrPullRequestOnGitHubhelper that opens via the default external opener and emits the appropriate GDPR-annotated telemetry event. - Replaces several direct “open on GitHub” call sites to use the shared helper / generalized
openItemOnGitHub. - Adds test coverage validating telemetry and external-opening behavior for issues, PRs, and several item wrappers.
| File | Description |
|---|---|
| src/test/mocks/mockTelemetry.ts | Updates mock telemetry signatures to match ITelemetry so new tests can spy on calls. |
| src/test/github/openOnGitHub.test.ts | Adds tests for telemetry + external-open behavior for issue/PR open flows and item classification. |
| src/issues/issueFeatureRegistrar.ts | Routes “open issue on GitHub” flow through the shared open+telemetry helper. |
| src/github/pullRequestOverview.ts | Switches PR overview “open on GitHub” commands to openItemOnGitHub. |
| src/github/pullRequestModel.ts | Uses the shared helper when offering “Open on GitHub” for invalid PR head scenarios. |
| src/github/openOnGitHub.ts | New shared helper implementing telemetry + external open for issue/PR kinds. |
| src/github/issueOverview.ts | Switches issue/PR overview webview action to openItemOnGitHub. |
| src/github/activityBarViewProvider.ts | Switches activity bar actions to openItemOnGitHub. |
| src/commands.ts | Replaces PR-only open helper with generalized openItemOnGitHub and routes command handling through the new helper. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| * Licensed under the MIT License. See License.txt in the project root for license information. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import { default as assert } from 'assert'; |
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.

No description provided.