Skip to content

feat: add valid datafile version check #234

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 3 commits into from
Jan 23, 2020
Merged

Conversation

pawels-optimizely
Copy link
Contributor

Summary

to be compatible with other sdk's, we are adding a check for a valid version of datafile. go-sdk supports only version 4 of datafile, same as the family of more recent sdk's.

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

Mostly ok, just have a suggestion


if !inSlice(datafileVersions, datafile.Version) {
err = errors.New("unsupported datafile version")
logger.Error(fmt.Sprintf("Version %s of datafile not supported", datafile.Version), err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Will be useful to say unable to initialize/update or something along those lines.

Copy link
Contributor

@mikecdavis mikecdavis left a comment

Choose a reason for hiding this comment

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

One suggestion to use a map as opposed to a slice based off a SO article. Also standardizing on assert.Error and assert.NoError when checking for errors.

@pawels-optimizely pawels-optimizely merged commit 952241f into master Jan 23, 2020
@pawels-optimizely pawels-optimizely deleted the pawel/OASIS-5903 branch January 23, 2020 18:16
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