-
Notifications
You must be signed in to change notification settings - Fork 20
feat(OptimizelyConfig): Add new fields to OptimizelyConfig #266
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
98dcba5
Added new Optimizely config fields
mnoman09 41e684b
Added delivery rules
mnoman09 c6ad489
Added optimizelyAudience and rollout featureVariables fix
mnoman09 9973794
Added new line at end
mnoman09 665c553
Added audiences and fixed tests
mnoman09 3c04342
Net 3.5 deserializing fix
mnoman09 1c0bf1a
Used string builder instead of string
mnoman09 ef6218b
Added OptimizelyProjectConfigTest file in tests
mnoman09 9fc9d54
Moved getEvent After GetFeaturesMap
mnoman09 53fbc69
Resolved comments and refactored logic
mnoman09 c8ccfca
Fixed space was added before NOT condition in audiences
mnoman09 b85ae86
Resolved comments
mnoman09 22a2039
Resolved unitTest issue
mnoman09 9ace97f
removed two additional tests for testing
mnoman09 621e62c
Merge branch 'master' into mnoman/optimizelyConfigNewFields
mnoman09 ce2505b
Audience array merge fix Unit test fix
mnoman09 b362593
Condition simplified
mnoman09 cb47e3c
Added OptimizelyEvent and OptimizelyAttribute Class
mnoman09 8ba7fe5
Added $opt_dummy_audience in datafile to verify that it is getting ig…
mnoman09 62ed97f
Added serializedAudiences Tests cases
mnoman09 c685c61
refactored little bit.
msohailhussain 7351048
Refactored comments
mnoman09 f1e684f
added unit tests for multiple experiment and removed sdk and env key.
msohailhussain b5d3383
Setting sdkKey and environment key default value as empty string
mnoman09 1e9d40f
fixed sorting issue
msohailhussain 6a8dafa
corrected sequence of audiences
msohailhussain 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
Added OptimizelyEvent and OptimizelyAttribute Class
- Loading branch information
commit cb47e3c2c0e5e8c59754f76c125e58339c8d497c
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
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright 2021, Optimizely | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
using OptimizelySDK.Entity; | ||
|
||
namespace OptimizelySDK.OptlyConfig | ||
{ | ||
public class OptimizelyAttribute : IdKeyEntity | ||
{ | ||
} | ||
} |
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 |
---|---|---|
|
@@ -51,9 +51,18 @@ public OptimizelyConfigService(ProjectConfig projectConfig) | |
projectConfig.ToDatafile()); | ||
} | ||
|
||
private Entity.Event[] GetEvents(ProjectConfig projectConfig) | ||
private OptimizelyEvent[] GetEvents(ProjectConfig projectConfig) | ||
{ | ||
return projectConfig.Events ?? new Entity.Event[0]; | ||
var optimizelyEvents = new List<OptimizelyEvent>(); | ||
foreach (var ev in projectConfig.Events) | ||
{ | ||
var optimizelyEvent = new OptimizelyEvent(); | ||
10000 optimizelyEvent.Id = ev.Id; | ||
optimizelyEvent.Key = ev.Key; | ||
optimizelyEvent.ExperimentIds = ev.ExperimentIds; | ||
optimizelyEvents.Add(optimizelyEvent); | ||
} | ||
return optimizelyEvents.ToArray(); | ||
} | ||
|
||
private OptimizelyAudience[] GetAudiences(ProjectConfig projectConfig) | ||
|
@@ -63,9 +72,17 @@ private OptimizelyAudience[] GetAudiences(ProjectConfig projectConfig) | |
return audiencesArr.Select(aud => new OptimizelyAudience(aud.Id, aud.Name, aud.Conditions)).ToArray<OptimizelyAudience>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. may be you should override implicit equal operator. |
||
} | ||
|
||
private Entity.Attribute[] GetAttributes(ProjectConfig projectConfig) | ||
private OptimizelyAttribute[] GetAttributes(ProjectConfig projectConfig) | ||
{ | ||
return projectConfig.Attributes; | ||
var attributes = new List<OptimizelyAttribute>(); | ||
foreach (var attr in projectConfig.Attributes) | ||
{ | ||
var attribute = new OptimizelyAttribute(); | ||
attribute.Id = attr.Id; | ||
attribute.Key = attr.Key; | ||
attributes.Add(attribute); | ||
} | ||
return attributes.ToArray(); | ||
} | ||
|
||
/// <summary> | ||
|
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2021, Optimizely | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
using OptimizelySDK.Entity; | ||
|
||
namespace OptimizelySDK.OptlyConfig | ||
{ | ||
public class OptimizelyEvent : IdKeyEntity | ||
{ | ||
/// <summary> | ||
/// Associated Experiment with this Event | ||
/// </summary> | ||
public string[] ExperimentIds { get; set; } | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need validate "$opt_dummy_audience" audience is filtered out. See TDD.