-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Adding the client code for supporting experiments #5034
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
AmelBawa-msft
wants to merge
24
commits into
master
Choose a base branch
from
user/amelbawa/experiment
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
20d1d66
Init files
AmelBawa-msft 3e66324
Init experiment
AmelBawa-msft e9d77e9
Add template
AmelBawa-msft f95c26c
Added logs
AmelBawa-msft 1d7fcd0
Add CDN exp
AmelBawa-msft 1720e20
Added UT
AmelBawa-msft 2072721
Store the toggle source
AmelBawa-msft 9a41fff
draft
AmelBawa-msft ff0ac7b
Addressed offline comments
AmelBawa-msft 9dbc7d4
Resolved conflicts
AmelBawa-msft bdf8c90
Addressing comments
AmelBawa-msft dee65a9
Addressing comments
AmelBawa-msft f26ae41
Addressing comments
AmelBawa-msft 0de0174
Include dir
AmelBawa-msft e1bafb4
Added allowExperiments
AmelBawa-msft 7e12f7f
Addressing comments
AmelBawa-msft c76d4d7
Addressing comments
AmelBawa-msft f597690
Added UT
AmelBawa-msft 6c877ed
Addressing comments
AmelBawa-msft 94ce495
Merge branch 'master' of https://github.com/microsoft/winget-cli into…
AmelBawa-msft cb8909e
Fixing build
AmelBawa-msft 733f43a
Empty
AmelBawa-msft 70ddb26
Use experimentation
AmelBawa-msft 2fd7b15
Undo
AmelBawa-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
|
|
||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| #include "pch.h" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,8 +10,8 @@ namespace AppInstaller::Settings | |
| enum ExperimentToggleSource | ||
| { | ||
| Default = 0, | ||
| Policy = 1, | ||
| UserSetting = 2, | ||
| Policy, | ||
| UserSetting, | ||
| }; | ||
|
|
||
| struct ExperimentState | ||
|
|
@@ -30,8 +30,8 @@ namespace AppInstaller::Settings | |
| { | ||
| enum class Key : unsigned | ||
| { | ||
| None = 0x0, | ||
| CDN = 0x1, | ||
| None = 0, | ||
| CDN, | ||
| Max, | ||
|
|
||
| #ifndef AICLI_DISABLE_TEST_HOOKS | ||
|
|
@@ -41,23 +41,23 @@ namespace AppInstaller::Settings | |
|
|
||
| using Key_t = std::underlying_type_t<Key>; | ||
|
|
||
| Experiment(std::string_view name, std::string_view jsonName, std::string_view link, std::string key) : | ||
| m_name(name), m_jsonName(jsonName), m_link(link), m_key(key) {} | ||
| Experiment(std::string name, std::string jsonName, std::string link, std::string key) : | ||
| m_name(std::move(name)), m_jsonName(jsonName), m_link(std::move(link)), m_key(std::move((key))) {} | ||
AmelBawa-msft marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| static ExperimentState GetState(Key feature); | ||
| static ExperimentState GetStateInternal(Key feature); | ||
|
||
| static Experiment GetExperiment(Key key); | ||
| static std::vector<Experiment> GetAllExperiments(); | ||
|
|
||
| std::string_view Name() const { return m_name; } | ||
| std::string Name() const { return m_name; } | ||
AmelBawa-msft marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Utility::LocIndView JsonName() const { return m_jsonName; } | ||
| std::string_view Link() const { return m_link; } | ||
| std::string Link() const { return m_link; } | ||
| std::string GetKey() const { return m_key; } | ||
|
|
||
| private: | ||
| std::string_view m_name; | ||
| std::string m_name; | ||
| Utility::LocIndView m_jsonName; | ||
AmelBawa-msft marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| std::string_view m_link; | ||
| std::string m_link; | ||
| std::string m_key; | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.