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

feat: add datafile accessor #290

Merged
merged 4 commits into from
Aug 21, 2020
Merged

feat: add datafile accessor #290

merged 4 commits into from
Aug 21, 2020

Conversation

yasirfolio3
Copy link
Contributor

Summary

  • Add datafile accessor methods/functionalities

Testing

  • Ran manual tests

Copy link
Contributor

@msohailhussain msohailhussain left a comment

Choose a reason for hiding this comment

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

please address.

pkg/config/datafileprojectconfig/config.go Show resolved Hide resolved
@@ -48,6 +49,11 @@ type DatafileProjectConfig struct {
botFiltering bool
}

// GetDatafile returns a JSON string representation of the environment's datafile
Copy link
Contributor

Choose a reason for hiding this comment

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

returns a string representation, datafile is itself in JSON, don't need to add that.

datafile string
}

// GetDatafile returns a JSON string representation of the environment's datafile
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment.

@@ -17,13 +17,21 @@
// Package config //
package config

import "github.com/optimizely/go-sdk/pkg/entities"
import (
Copy link
Contributor

Choose a reason for hiding this comment

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

please update header.

@@ -62,17 +62,22 @@ func (s *OptimizelyConfigTestSuite) TestOptlyConfig() {
s.Equal(s.expectedOptimizelyConfig.FeaturesMap, optimizelyConfig.FeaturesMap)
s.Equal(s.expectedOptimizelyConfig.ExperimentsMap, optimizelyConfig.ExperimentsMap)
s.Equal(s.expectedOptimizelyConfig.Revision, optimizelyConfig.Revision)

s.Equal(s.expectedOptimizelyConfig, *optimizelyConfig)
Copy link
Contributor

Choose a reason for hiding this comment

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

why removed?

@@ -48,7 +48,9 @@ func TestNewStaticProjectConfigManagerFromPayload(t *testing.T) {

func TestStaticGetOptimizelyConfig(t *testing.T) {

mockDatafile := []byte(`{"accountId":"42","projectId":"123","version":"4"}`)
// since marshalling changes the order of keys in jsonString everytime, using json with a single key
Copy link
Contributor

Choose a reason for hiding this comment

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

why changed the payload, we are not supposed to change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted this change.

Copy link
Contributor

@msohailhussain msohailhussain left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@pawels-optimizely pawels-optimizely left a comment

Choose a reason for hiding this comment

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

lgtm

@pawels-optimizely pawels-optimizely merged commit 9c75529 into master Aug 21, 2020
@pawels-optimizely pawels-optimizely deleted the yasir/get-datafile branch August 21, 2020 19:59
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.

4 participants