Skip to content

Add a maximum date of the comparison commit for the 1p repo telemetry info#3774

Merged
zhichli merged 8 commits intomicrosoft:mainfrom
IanMatthewHuff:dev/ianhu/telemetrySettingDateCheck
Feb 27, 2026
Merged

Add a maximum date of the comparison commit for the 1p repo telemetry info#3774
zhichli merged 8 commits intomicrosoft:mainfrom
IanMatthewHuff:dev/ianhu/telemetrySettingDateCheck

Conversation

@IanMatthewHuff
Copy link
Member

Context for this fix:

Our first party only repo info telemetry looks to create diffs between the public upstream and the current working tree of the local repo. It starts out by first doing a git diff to see just the names and counts of the files in the diff. Then, if it sees too many files, it exits early to avoid perf issues. We get this upstream branch for comparison by first looking for a set upstream tracking branch, and then if that fails using getMergeBase to get a comparison branch.

However in the case for some Windows devs, the tools they use to branch often don't set an upstream and the branch that they appear to have branched from is sometimes all the way back at the start of official/main. This is over four years old, and when git tries to just see the names and counts of files in the diff it churns up a huge git process causing performance issues.

This PR does two things.

  1. Adds in an internal setting to provide a shutoff switch for this telemetry. If we hit some other degenerate case like this, we now have a way to unblock local users, and it could also be put into the settings file for a full repository.
  2. When we find our upstream comparison commit, check the date on it, and only accept commits that are < 1 month old for comparison. This will rule out cases like this from happening. Any diff getting longer than that is very unlikely to fit inside the telemetry limits even if it gets past the file check. Return a new status code for this situation so we can see how often it's happening.

Testing:

  • Unit tests added to test file for repo info telemetry
  • Manual testing
    • With the setting not specified, data was collected
    • Setting set to true, data was not collected
    • Setting set to false, data was collected
    • Opened a repo that was branched > 1 month ago, did not collect with status message
    • Opened a more recent repo, data begin and end were collected as normal

@IanMatthewHuff IanMatthewHuff marked this pull request as ready for review February 16, 2026 18:46
Copilot AI review requested due to automatic review settings February 16, 2026 18:46
Copy link
Contributor

Copilot AI left a 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 safeguards to prevent performance issues in repo info telemetry caused by very old merge base commits. It introduces two main improvements: a configuration toggle to disable the telemetry and a 30-day age limit check for merge base commits.

Changes:

  • Added a team-internal configuration setting chat.advanced.debug.disableRepoInfoTelemetry to provide an emergency shutoff for repo info telemetry
  • Implemented a 30-day maximum age check for merge base commits before performing diff operations, preventing expensive git operations on stale branches
  • Added new telemetry result type mergeBaseTooOld to track when commits are rejected due to age

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/platform/configuration/common/configurationService.ts Added new team-internal configuration setting DisableRepoInfoTelemetry
src/extension/prompt/node/repoInfoTelemetry.ts Added configuration service injection, early exit check for disabled setting, commit age validation logic with 30-day threshold, and new mergeBaseTooOld result type
src/extension/prompt/node/test/repoInfoTelemetry.spec.ts Updated all test instantiations with configurationService parameter, added mock for getCommit method, and added 5 new test cases covering disabled setting and merge base age scenarios

@jruales jruales assigned sbatten and unassigned jruales Feb 16, 2026
@jruales jruales requested review from mjbvz and sbatten February 16, 2026 20:07
@IanMatthewHuff
Copy link
Member Author

@sbatten @mjbvz Need anything from my end on this review? Just wanted to make sure that the windows folks hitting this issue get unblocked.

@IanMatthewHuff
Copy link
Member Author

@zhichli Here is the PR that I mentioned along with the PR here: #4018. It's merged with the changes now.

@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 26, 2026
@zhichli zhichli added this pull request to the merge queue Feb 27, 2026
Merged via the queue into microsoft:main with commit 189b93a Feb 27, 2026
9 checks passed
mexicodxnmexico-create added a commit to mexicodxnmexico-create/vscode-copilot-chat that referenced this pull request Feb 28, 2026
* Revert "cli - do not trust empty changes (microsoft/vscode#297975) (microsoft#4036)" (microsoft#4063)

This reverts commit 420c26f.

* Run command tool should include command result (microsoft#4061)

* Run command tool should include command result
Part of microsoft/vscode#298181

* CCR feedback

* Support CAPI WebSocket connections (microsoft#4068) (microsoft#4069)

* Add a maximum date of the comparison commit for the 1p repo telemetry info (microsoft#3774)

* initial passes with copilot before testing

* only pass on successful date

* add tests for new functionality

* return tooOld for all date failures

* remove extra logging, info is already in telemetry and may be too noisy

* fix test that used custom repo mock

---------

Co-authored-by: Ian Huff <ianhuff@Mac.home>
Co-authored-by: Ian Huff <ianhuff@Ians-MacBook-Pro-2.local>

* 0.39.0 (microsoft#4057)

* Make auto have provider affiniy (microsoft#4072)

* Pipe vendor from CAPI through to chat endpoint

* Adopt discussed auto mode behavior

* Update src/platform/endpoint/node/test/automodeService.spec.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Hold external repo info telemetry (microsoft#4075)

* Hold external repo info telemetry

* Update src/extension/prompt/node/repoInfoTelemetry.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update test to reflect no external telemetry for non-internal users

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* pass in the URL for the proxy to the CLI session (microsoft#4070)

* Update telemetry pkg (microsoft#4078)

* Merge agents and chatsession folder (microsoft#4058)

* Remove duplicated memory tool in picker (microsoft#4079)

* fixes microsoft/vscode#297010

* address feedback

* 🎨 Palette: Add aria-busy state to webview loading container

💡 What: Toggles `aria-busy` attribute on the `solutionsContainer` during async loading phases.
🎯 Why: To prevent screen reader users from experiencing silent, disorienting DOM changes when dynamic webview content updates.
♿ Accessibility: Improves loading state communication to assistive technologies.

Co-authored-by: mexicodxnmexico-create <245638303+mexicodxnmexico-create@users.noreply.github.com>

* Background - clean worktree changes cache at the end of the turn (microsoft#4083)

* 🎨 Palette: Add aria-busy state to webview loading container

💡 What: Toggles `aria-busy` attribute on the `solutionsContainer` during async loading phases.
🎯 Why: To prevent screen reader users from experiencing silent, disorienting DOM changes when dynamic webview content updates.
♿ Accessibility: Improves loading state communication to assistive technologies.

Co-authored-by: mexicodxnmexico-create <245638303+mexicodxnmexico-create@users.noreply.github.com>

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
Co-authored-by: Alex Ross <38270282+alexr00@users.noreply.github.com>
Co-authored-by: Christof Marti <chrmarti@microsoft.com>
Co-authored-by: Ian Huff <ian.huff@gmail.com>
Co-authored-by: Ian Huff <ianhuff@Mac.home>
Co-authored-by: Ian Huff <ianhuff@Ians-MacBook-Pro-2.local>
Co-authored-by: Ben Villalobos <bevillal@microsoft.com>
Co-authored-by: Logan Ramos <loganramos@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Zhichao Li <57812115+zhichli@users.noreply.github.com>
Co-authored-by: Aaron Munger <2019016+amunger@users.noreply.github.com>
Co-authored-by: Vijay Upadya <41652029+vijayupadya@users.noreply.github.com>
Co-authored-by: Don Jayamanne <don.jayamanne@outlook.com>
Co-authored-by: SteVen Batten <sbatten@microsoft.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: mexicodxnmexico-create <245638303+mexicodxnmexico-create@users.noreply.github.com>
Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants