Skip to content

Conversation

@isidorn
Copy link
Contributor

@isidorn isidorn commented Dec 5, 2025

PR by me and Copilot (Opus)

I did not test this out. But happy to do that if the approach looks reasonable

fixes https://github.com/microsoft/vscode-internalbacklog/issues/6397

@isidorn isidorn added this to the December / January 2026 milestone Dec 5, 2025
@isidorn isidorn requested a review from vijayupadya December 5, 2025 14:39
Copilot AI review requested due to automatic review settings December 5, 2025 14:39
Copilot finished reviewing on behalf of isidorn December 5, 2025 14:42
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 a new PlatformAndReleaseDateFilterProvider to enhance the experimentation service with platform and VS Code release date information. The provider reads VS Code's product.json file to extract the release date and combines it with platform information to create experimentation filters that can be used for A/B testing and feature rollouts.

Key changes:

  • Adds PlatformAndReleaseDateFilterProvider class that implements IExperimentationFilterProvider
  • Extracts platform information using existing PlatformToString utility
  • Parses release date from VS Code's product.json file in ISO format and converts it to YYYYMMDDHH format
  • Registers the new filter provider in MicrosoftExperimentationService constructor

fileSystemService: IFileSystemService,
private _logService: ILogService
) {
this._initReleaseDate(envService, fileSystemService);
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _initReleaseDate method is called asynchronously in the constructor but not awaited, creating a race condition. If getFilters() is called before the file read completes, _releaseDate will be undefined and the release date filter will not be set on the first call(s).

Since IExperimentationFilterProvider.getFilters() is synchronous, consider one of these approaches:

  1. Use synchronous file reading (e.g., fs.readFileSync via a Node.js service wrapper) if this code only runs in Node.js environment
  2. Read the file eagerly during service initialization and pass the value to the constructor
  3. Accept that the filter might be missing initially and document this behavior

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants