Skip to content

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

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

Conversation

rashidsp
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Aug 31, 2018

Coverage Status

Coverage increased (+0.6%) to 97.712% when pulling a542d0e on rashid/datafile-supported-versions into a223fe9 on master.

@msohailhussain msohailhussain requested a review from a team August 31, 2018 17:08
@@ -127,12 +128,13 @@ public function __construct(

try {
$this->_config = new ProjectConfig($datafile, $this->_logger, $this->_errorHandler);
} catch (Throwable $exception) {
} catch (InvalidDatafileVersionException $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 as Python PR, please consolidate these two cases into one.

And pass the exception to the errorHandler

public function testInitUnSupportedDatafileVersion()
{
$datafile = json_decode($this->datafile, true);
$datafile['version'] = '5';
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of doing this, let's create a small unsupported_datafile that has one running experiment in it and use that here.

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

Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

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

LGTM after making the recommended change.

@@ -196,6 +200,13 @@ public function __construct($datafile, $logger, $errorHandler)
$this->_revision = $config['revision'];
$this->_forcedVariationMap = [];

$supportedVersions = array(self::V2, self::V3, self::V4);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend setting this up at the top of this method. It is extremely hard to read it here.

@mikeproeng37
Copy link
Contributor

build

@mikeproeng37 mikeproeng37 merged commit fdc28fe into master Sep 7, 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.

4 participants