Skip to content

fix(datafile-parsing): Prevent newer versions datafile #124

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 2 commits into from
Sep 5, 2018

Conversation

rashidsp
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Aug 30, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling fbf3910 on rashid/datafile-supported-versions into ffb910c on master.

@msohailhussain msohailhussain requested a review from a team August 30, 2018 20:56
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.

Looks good mostly. Just one fix required.

@@ -64,17 +64,15 @@ def initialize(datafile, event_dispatcher = nil, logger = nil, error_handler = n

begin
@config = ProjectConfig.new(datafile, @logger, @error_handler)
rescue
rescue InvalidDatafileVersionError => e
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 as on the Python PR, please consolidate into one rescue and change the message based on the type of the exception

@is_valid = false
@logger = SimpleLogger.new
@logger.log(Logger::ERROR, InvalidDatafileVersionError.new.message)
@logger.log(Logger::ERROR, InvalidInputError.new('datafile').message)
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, please pass the error to the error_handler instance

@mikeproeng37
Copy link
Contributor

Ran these compat-suite tests locally and they pass: https://github.com/optimizely/fullstack-sdk-compatibility-suite/pull/134

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.

lgtm

@mikeproeng37 mikeproeng37 merged commit e91cd75 into master Sep 5, 2018
@mikeproeng37 mikeproeng37 deleted the rashid/datafile-supported-versions branch September 7, 2018 22:40
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.

3 participants