Skip to content

Update ExP Service to have user account based filters #620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

sbatten
Copy link
Member

@sbatten sbatten commented Aug 15, 2025

  • filter by internal
  • filter by sku

This PR also greatly reduces the service API to simplify things. We also refresh treatments every 1 hour.

@sandy081 I'd love to get your feedback as this is related to the work you did in core and it affects configurations.

@sbatten sbatten self-assigned this Aug 15, 2025
@sbatten sbatten requested a review from sandy081 August 15, 2025 18:59
@sbatten sbatten marked this pull request as ready for review August 21, 2025 18:44
@vs-code-engineering vs-code-engineering bot added this to the August 2025 milestone Aug 21, 2025
lramos15
lramos15 previously approved these changes Aug 21, 2025
Copy link
Member

@lramos15 lramos15 left a comment

Choose a reason for hiding this comment

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

Looks great!

*/
readonly initializePromise: Promise<void>;
onDidTreatmentsChange: Event<void>;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this event is not used anywhere and it might not be true that treatments have changed on refresh, so this event will be triggered falsely.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sandy081 It is true, the exp package doesn't actually tell us this information, so in order to be really accurate we'd have to keep a list of every queried treatment and a cache of its value and if they are not equivalent, we could fire a more accurate event. However, I don't know how valuable it will be, most consumers can just check the value for free when the event signals and decide if something should happen. The primary consumer of this would be the configuration service, which I tried hooking up, but got into a dependency cycle. Since we don't do that refresh today, I'd like to take that as a second PR.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. That is the reason I thought having this change event is misleading. In VS Code core, I ask for settings related experiments every 60 minutes instead of adding a change event in experiment service.

https://github.com/microsoft/vscode/blob/143bd85516a97ccca08818d6b04cd8ddd8997475/src/vs/workbench/services/configuration/browser/configurationService.ts#L1355

So, I suggest to do the same here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Although config service will be the primary consumer, I won't necessarily be the only consumer as some ExPs don't have settings. Also, we have a separate consideration now introduced in the PR. Your authentication state can cause the treatments to change, not just upon a general refresh. I plan to work with you to bring this behavior to core as well.

Copy link
Member

Choose a reason for hiding this comment

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

But I would not prefer to use the change event if it is not sure about the values being changed or not.

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