-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add dummy action to checkout the PR from session toolbar #2794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a "Checkout" action button to the session toolbar for cloud agent pull request sessions. The button appears only when the GitHub Pull Request extension is not activated and allows users to checkout the associated pull request by opening a URI that redirects to the GitHub PR extension.
Changes:
- Adds a new command
github.copilot.chat.checkoutPullRequestReroutethat constructs a URI to trigger the GitHub PR extension's checkout flow - Configures the command to appear in the session toolbar for copilot-cloud-agent sessions when the PR extension is not activated
- Adds localization string for the "Checkout" button title
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts | Implements the checkoutPullRequestReroute command that parses the session URI and constructs a checkout URL for the GitHub PR extension |
| package.json | Registers the command and adds it to the session toolbar menu with appropriate visibility conditions |
| package.nls.json | Adds localization entry for the checkout button title |
Comments suppressed due to low confidence (2)
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts:1108
- The variable is named
pullRequestNumberbut receives a string fromSessionIdForCLI.parse(). This creates a type mismatch since pull request numbers should be numeric values. Additionally, the validation check on line 1109 doesn't verify that the value is actually a valid number before using it in the URI construction on line 1118.
const pullRequestNumber = SessionIdForCLI.parse(resource);
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts:39
- This import should be
SessionIdForPrinstead of justgetRepoIdsince the function needs to parse copilot-cloud-agent session URIs usingSessionIdForPr.parsePullRequestNumber()rather thanSessionIdForCLI.parse().
import { getRepoId } from '../vscode/copilotCodingAgentUtils';
Part of microsoft/vscode#282428