agentHostPullRequestOperationHandler.ts ×7

Frontier kind: Code frontier

unlabeled · c_28be80d1ca74

12 tests · 24310 LOC · 105 files · introduces 0 tests · 23 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges23 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2158 ranges24310 lines · 105 files · Browse complete extent
All tests (intent)
12 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 23 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentHostPullRequestOperationHandler.ts 23 introduced LOC · 7 ranges

Open complete file

104 throw new ProtocolError(AHP_SESSION_NOT_FOUND, `Session not found: ${sessionUri}`);
105 }
107 > const workingDirectoryStr = sessionState.workingDirectories?.[0];
108 if (!workingDirectoryStr) {
109 throw new ProtocolError(JsonRpcErrorCodes.InternalError, `Session has no working directory: ${sessionUri}`);
110 }
112 > const gitHubState = readSessionGitHubState(sessionState._meta);
113 if (!gitHubState?.owner || !gitHubState?.repo) {
114 throw new ProtocolError(
117 );
118 }
120 > const workingDirectory = URI.parse(workingDirectoryStr);
121 > const gitState = readSessionGitState(sessionState._meta);
122 const branchName = gitState?.branchName ?? await this._gitService.getCurrentBranch(workingDirectory);
123 if (!branchName) {
124 throw new ProtocolError(JsonRpcErrorCodes.InternalError, `Could not determine current branch for ${workingDirectory}`);
125 }
127 const baseBranchName = gitState?.baseBranchName ?? (await this._gitService.getDefaultBranch(workingDirectory))?.name;
128 if (!baseBranchName) {
129 throw new ProtocolError(JsonRpcErrorCodes.InternalError, `Could not determine base branch for ${workingDirectory}`);
130 }
131 > const base = baseBranchName; agentHostPullRequestOperationHandler.ts
132 >
133 > const repoResource = this._gitHubEndpointService.getRepoResource();
134 > const authToken = this._agentService.getAuthToken({
135 > resource: repoResource.resource,
136 > scopes: repoResource.scopes_supported,
137 > });
138 > if (!authToken) {
139 throw new ProtocolError(
140 AHP_AUTH_REQUIRED,
143 );
144 }
146 > const hasUncommitted = await this._gitService.hasUncommittedChanges(workingDirectory);
147 > if (hasUncommitted) {
148 this._throwIfCancelled(token);
149 this._logService.info(`[AgentHostPullRequestOperationHandler] Committing uncommitted changes for session ${sessionUri}`);
155 }
156 }
157 > this._throwIfCancelled(token); agentHostPullRequestOperationHandler.ts
158 >
159 > const branchChanges = await this._gitService.computeSessionFileDiffs(workingDirectory, { sessionUri, baseBranch: base });
160 > if (branchChanges === undefined) {
161 throw new ProtocolError(JsonRpcErrorCodes.InternalError, localize('agentHost.changeset.pr.computeChangesFailed', "Could not compute branch changes to create a pull request."));
162 }