agentHostPullRequestOperationHandler.ts ×10

Frontier kind: Code frontier

unlabeled · c_f163a2d224cc

9 tests · 24363 LOC · 105 files · introduces 0 tests · 29 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges29 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2175 ranges24363 lines · 105 files · Browse complete extent
All tests (intent)
9 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: 29 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentHostPullRequestOperationHandler.ts 29 introduced LOC · 10 ranges

Open complete file

229 */
230 private async _finalize(
231 > pr: CreatedPullRequest, agentHostPullRequestOperationHandler.ts
232 > isExisting: boolean,
233 > sessionUri: string,
234 > owner: string,
235 > repo: string,
236 > authToken: string,
237 > signal: AbortSignal,
238 > token: CancellationToken,
239 > ): Promise<InvokeChangesetOperationResult> {
240 > if (!this._autoMergeMethod) {
241 // No auto-merge configured
242 this._onPullRequestCreated({ sessionKey: sessionUri, pullRequestUrl: pr.url });
265 this._onPullRequestCreated({ sessionKey: sessionUri, pullRequestUrl: pr.url });
266 return this._createResult(pr, this._buildMessage(pr, isExisting, autoMergeOutcome, autoMergeError));
268
269 private _buildMessage(pr: CreatedPullRequest, isExisting: boolean, autoMergeOutcome: 'none' | 'enabled' | 'failed', autoMergeError: string | undefined): string {
270 > let mergeMethodLabel: string | undefined; agentHostPullRequestOperationHandler.ts
271 > switch (this._autoMergeMethod) {
272 > case 'SQUASH':
273 mergeMethodLabel = localize('agentHost.changeset.pr.autoMerge.squash', "squash");
274 break;
276 mergeMethodLabel = localize('agentHost.changeset.pr.autoMerge.rebase', "rebase");
277 break;
279 mergeMethodLabel = localize('agentHost.changeset.pr.autoMerge.merge', "merge");
280 break;
282 >
283 > if (isExisting) {
284 switch (autoMergeOutcome) {
285 case 'enabled':
295 case 'enabled':
296 return localize('agentHost.changeset.pr.created.autoMerge', "Created pull request [#{0}]({1}) with auto-merge ({2}) enabled.", pr.number, pr.url, mergeMethodLabel);
298 return localize('agentHost.changeset.pr.created.autoMergeFailed', "Created pull request [#{0}]({1}), but auto-merge could not be enabled: {2}", pr.number, pr.url, autoMergeError ?? '');
300 return this._draft
301 ? localize('agentHost.changeset.pr.createdDraft', "Created draft pull request [#{0}]({1}).", pr.number, pr.url)
302 : localize('agentHost.changeset.pr.created', "Created pull request [#{0}]({1}).", pr.number, pr.url);
304 > }
305
306 private _throwIfCancelled(token: CancellationToken): void {
476
477 private _createResult(created: { readonly url: string; readonly number: number }, message: string): InvokeChangesetOperationResult {
478 > const followUp: ChangesetOperationFollowUp = { agentHostPullRequestOperationHandler.ts
479 > content: { uri: created.url, contentType: 'text/html' },
480 > external: true,
481 > };
482 > return { message: { markdown: message }, followUp };
483 > }
484 }