Skip to content
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

Adding the client code for supporting experiments #5034

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

AmelBawa-msft
Copy link
Contributor

@AmelBawa-msft AmelBawa-msft commented Dec 3, 2024

Adding the client-side code for supporting running experiments in winget-cli.

Group policy:

  • EnableExperimentation: Disabling this group policy will prevent any experiment from running.

User settings:

  • "experimentation": Enable the user to control whether or not an experiment should run or not.

  • I have signed the Contributor License Agreement.

  • This pull request is related to an issue.


Microsoft Reviewers: Open in CodeFlow

@AmelBawa-msft AmelBawa-msft marked this pull request as ready for review December 9, 2024 21:26
@AmelBawa-msft AmelBawa-msft requested a review from a team as a code owner December 9, 2024 21:26
src/Internal/Experiment/Experiment.vcxproj Outdated Show resolved Hide resolved
src/Internal/Experiment/Experiment.vcxproj Outdated Show resolved Hide resolved
src/Internal/Experiment/Experiment.h Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/Experiment.cpp Show resolved Hide resolved
doc/admx/en-US/DesktopAppInstaller.adml Outdated Show resolved Hide resolved
src/AppInstallerRepositoryCore/SourceList.cpp Outdated Show resolved Hide resolved
src/AppInstallerRepositoryCore/SourceList.cpp Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/Experiment.cpp Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/Public/winget/Experiment.h Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/Experiment.cpp Outdated Show resolved Hide resolved
@microsoft-github-policy-service microsoft-github-policy-service bot added the Issue-Feature This is a feature request for the Windows Package Manager client. label Dec 10, 2024
doc/admx/en-US/DesktopAppInstaller.adml Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/AppInstallerTelemetry.cpp Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/AppInstallerTelemetry.cpp Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/AppInstallerTelemetry.cpp Outdated Show resolved Hide resolved
@@ -77,6 +80,19 @@ namespace AppInstaller::Logging
return "unknown"sv;
}
}

std::string GetExperimentsJson(const std::map<Experiment::Key, ExperimentState>& experiments)
Copy link
Member

Choose a reason for hiding this comment

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

Please create an ExperimentStateCache so that this code and the lookup can live in Experiment.cpp.

Copy link
Member

Choose a reason for hiding this comment

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

Still feel this should be done.

src/AppInstallerCommonCore/Experiment.cpp Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/UserSettings.cpp Outdated Show resolved Hide resolved
src/AppInstallerRepositoryCore/SourceList.cpp Outdated Show resolved Hide resolved
src/AppInstallerSharedLib/JsonUtil.cpp Show resolved Hide resolved
src/AppInstallerSharedLib/JsonUtil.cpp Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

I imagine there is already a policy to disable experimentation across Windows as a whole. I found AllowExperimentation but I'm not sure if it does what I think.

If there is such a policy, I think we would be better off not having our own and just pointing people to that one. If somebody disables it system-wide, then our policy won't do anything because the infrastructure we use will be disabled. The only case where it would be useful to have both is if somebody wants to have experimentation in Windows as a whole, but not on winget specifically, which I don't think is a common scenario

@@ -25,6 +25,12 @@ If you disable this setting, users will not be able to change settings for the W
If you enable or do not configure this setting, users will be able to enable experimental features for the Windows Package Manager.

If you disable this setting, users will not be able to enable experimental features for the Windows Package Manager.</string>
<string id="EnableExperiments">Enable Windows Package Manager Experiments</string>
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest the policy be called "Allow" instead of "Enable" even if it is not consistent with the other policies.
To me, "Enable" means that the experiments will be turned on but that's not what happens. What happens is that experiments may be turned on depending on the control/treatment groups; which is better described by "Allow"

It probably should also mention that they are Microsoft-run experiments for new features/changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remember discussing this with Roy offline last Wednesday, but tagging him here in case he wants to add further information. Correct me if I am wrong Roy, but we will keep this Enable instead to align with the other policies.

CC: @RDMacLachlan

src/AppInstallerCommonCore/Experiment.cpp Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/Experiment.cpp Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/Public/winget/Experiment.h Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/Public/winget/Experiment.h Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/Public/winget/Experiment.h Outdated Show resolved Hide resolved
schemas/JSON/settings/settings.schema.0.2.json Outdated Show resolved Hide resolved
src/AppInstallerCommonCore/Public/winget/Experiment.h Outdated Show resolved Hide resolved
src/AppInstallerCLITests/Experiment.cpp Outdated Show resolved Hide resolved
src/AppInstallerCLITests/Experiment.cpp Show resolved Hide resolved
@AmelBawa-msft
Copy link
Contributor Author

/az run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature This is a feature request for the Windows Package Manager client.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(GPO) Group Policy Object - Enable Experimentation Support experimentation
5 participants