agentHostRepoInfoTelemetry.ts ×11

Frontier kind: Code frontier

unlabeled · c_1f5bf828bbe7

6 tests · 21205 LOC · 80 files · introduces 0 tests · 41 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges41 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1836 ranges21205 lines · 80 files · Browse complete extent
All tests (intent)
6 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: 41 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentHostRepoInfoTelemetry.ts 41 introduced LOC · 11 ranges

Open complete file

173 return undefined;
174 }
176 > const [gitState, untrackedPaths] = await Promise.all([
177 > this._gitService.getSessionGitState(workingDirectory),
178 > this._gitService.getUntrackedPaths(workingDirectory),
179 > ]);
180 const upstreamRemote = gitState?.upstreamBranchName?.split('/')[0];
181 const fetchRemoteUrls = await this._gitService.getFetchRemoteUrls(workingDirectory, upstreamRemote);
182 > const remote = fetchRemoteUrls agentHostRepoInfoTelemetry.ts
183 ?.map(url => resolveRepoInfoRemote(url, this._gitHubEndpointService.getEnterpriseHost()))
184 .find((candidate): candidate is IResolvedRepoInfoRemote => candidate !== undefined);
186 return undefined;
187 }
189 const baseBranch = persistedBaseBranch ?? gitState?.upstreamBranchName ?? gitState?.baseBranchName ?? (await this._gitService.getDefaultBranch(workingDirectory))?.name;
190 const [headBranchName, headCommitHash] = await Promise.all([
192 this._gitService.resolveBranchBaselineCommit(workingDirectory, baseBranch),
193 ]);
194 > if (!headCommitHash) { agentHostRepoInfoTelemetry.ts
195 return undefined;
196 }
197 > const repoInfo: IRepoInfoContext = { ...remote, headCommitHash, headBranchName }; agentHostRepoInfoTelemetry.ts
198 > const safety = await this._gitService.getBranchDiffSafetyInfo(workingDirectory, headCommitHash);
199 > if (!safety) {
200 return undefined;
201 }
202 > if (safety.hasVirtualFileSystem) { agentHostRepoInfoTelemetry.ts
203 return this._report(telemetryContext, isContextCurrent, telemetryMessageId, location, repoInfo, 'virtualFileSystem', 0, 0, 0);
204 }
209 return this._report(telemetryContext, isContextCurrent, telemetryMessageId, location, repoInfo, 'tooManyCommits', 0, 0, 0);
210 }
211 > const tree = await this._gitService.captureWorkingTreeAsTree(workingDirectory); agentHostRepoInfoTelemetry.ts
212 > if (!tree) {
213 return undefined;
214 }
216 > const fileDiffs = await this._gitService.computeFileDiffsBetweenRefs(workingDirectory, {
217 > sessionUri,
218 > fromRef: headCommitHash,
219 > toRef: tree,
220 > });
221 > if (!fileDiffs) {
222 return undefined;
223 }
224 > if (fileDiffs.length === 0) { agentHostRepoInfoTelemetry.ts
225 return await this._reportIfTreeUnchanged(telemetryContext, isContextCurrent, telemetryMessageId, location, repoInfo, workingDirectory, tree, 'noChanges', safety.workspaceFileCount, 0, 0);
226 }
312
313 private _report(telemetryContext: IAgentHostRestrictedTelemetryContext, isContextCurrent: () => boolean, telemetryMessageId: string, location: 'begin' | 'end', repoInfo: IRepoInfoContext, result: AgentHostRepoInfoResult, workspaceFileCount: number, changedFileCount: number, diffSizeBytes: number, fileRelativePaths?: string, diffsJSON?: string): AgentHostRepoInfoResult {
314 > if (this._isDisposed || !isContextCurrent()) { agentHostRepoInfoTelemetry.ts
315 return result;
316 }
317 > this._reporter.reportRepoInfo(telemetryContext, { agentHostRepoInfoTelemetry.ts
318 > telemetryMessageId,
319 > location,
320 > remoteUrl: repoInfo.remoteUrl,
321 > repoId: repoInfo.repoId,
322 > repoType: repoInfo.repoType,
323 > headCommitHash: repoInfo.headCommitHash,
324 > headBranchName: repoInfo.headBranchName,
325 > fileRelativePaths,
326 > diffsJSON,
327 > result,
328 > isActiveRepository: 'true',
329 > workspaceFileCount,
330 > changedFileCount,
331 > diffSizeBytes,
332 > });
333 > return result;
334 > }
335 }
336