Skip to content

Conversation

@jmikola
Copy link
Member

@jmikola jmikola commented May 24, 2018

https://jira.mongodb.org/browse/PHPC-1195

Note: this is waiting on CDRIVER-2661. Once that is merged, this PR can be updated to bump the libmongoc submodule to 1.10-dev (assuming the issue is also backported to the r1.10 branch).

@jmikola jmikola requested a review from derickr May 24, 2018 19:50
@jmikola jmikola changed the title PHPC-1195: BulkWrite::update() should append arrayFilters as array [WAIT] PHPC-1195: BulkWrite::update() should append arrayFilters as array May 24, 2018
Copy link
Contributor

@derickr derickr left a comment

Choose a reason for hiding this comment

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

Added a comment, but haven't LGTM'ed it as it says [WAIT], so I expect more changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain with a comment what a "valid key" is?

These tests were only using Mongo Orchestration to ensure a 3.6 server. skip_if_server_version() can be used instead.
@jmikola jmikola changed the title [WAIT] PHPC-1195: BulkWrite::update() should append arrayFilters as array PHPC-1195: BulkWrite::update() should append arrayFilters as array May 25, 2018
Copy link
Contributor

@derickr derickr left a comment

Choose a reason for hiding this comment

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

Needs the code fix, and I had some questions.

Copy link
Contributor

Choose a reason for hiding this comment

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

This has an extra zend_get_type_by_const — Travis says so too: https://travis-ci.org/mongodb/mongo-php-driver/jobs/383741731#L1198

Copy link
Contributor

Choose a reason for hiding this comment

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

And this is an equivalent to bson-encode.c's php_phongo_is_array_or_document? Should they be placed together perhaps? I don't mind, so please do what makes sense for you.

Copy link
Member Author

Choose a reason for hiding this comment

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

php_phongo_is_array_or_document() operates on a zval, while this validates a bson_t.

We can't work with the zval here, as we're not inspecting it until it's already been converted to a bson_t. In theory, this allows a Serializable value to produce a BSON array for this option.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit misleading, innit? skip_if_not_clean will also clean first?

Copy link
Member Author

Choose a reason for hiding this comment

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

This change was made during #787.

Technically, the function attempts to drop the test collection and skips the test if that fails for some reason. I'll admit it's unlike other skip_if functions because it attempts to change the state of the system; however, it can actually skip if something goes wrong. In the past, CLEAN() ignored any errors.

If you have some ideas for renaming or revising this, a new ticket would be best 👍

Copy link
Contributor

@derickr derickr left a comment

Choose a reason for hiding this comment

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

LGTM

@jmikola jmikola merged commit 3c8fdfd into mongodb:master May 25, 2018
jmikola added a commit that referenced this pull request May 25, 2018
@jmikola jmikola deleted the phpc-1195 branch May 25, 2018 16:19
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.

2 participants