-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-1756: Remove oppressive terminology from source code #1221
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
Conversation
@@ -1811,19 +1810,6 @@ static bool php_phongo_apply_rp_options_to_uri(mongoc_uri_t* uri, bson_t* option | |||
while (bson_iter_next(&iter)) { | |||
const char* key = bson_iter_key(&iter); | |||
|
|||
if (!ignore_slaveok && !strcasecmp(key, MONGOC_URI_SLAVEOK)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See PHPC-1836
.gitmodules
Outdated
@@ -1,6 +1,6 @@ | |||
[submodule "src/libmongoc"] | |||
path = src/libmongoc | |||
url = https://github.com/mongodb/mongo-c-driver.git | |||
url = https://github.com/alcaeus/mongo-c-driver.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update this PR once all the pull requests in libmongoc have been merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only libmongoc PR I found open is for CDRIVER-3985, which seems unrelated (just internal to libmongoc).
For the two PHPC tickets referenced in this PR that you said are covered by libmongoc:
- PHPC-1803 depends on CDRIVER-3947, which is already merged.
- PHPC-1840 depends on CDRIVER-3997, which is just "in progress" with no PR.
So is this pointing to your branch for CDRIVER-3997, for which there is no PR yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the change also includes my work done for CDRIVER-3997, which is ready but was already building on 2 PRs that were in review, so I held off on creating the PR for that.
zval_ptr_dtor(&state.zchild); | ||
return false; | ||
} | ||
|
||
ADD_ASSOC_ZVAL_EX(retval, "last_is_master", &state.zchild); | ||
ADD_ASSOC_ZVAL_EX(retval, "last_hello_response", &state.zchild); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we never documented the returned fields, I decided to drop the old field entirely. Let me know if you think we should keep it in for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just used for debug output, since Manager and Server are not serializable. No objections to changing this, since we don't document debug output at all.
.gitmodules
Outdated
@@ -1,6 +1,6 @@ | |||
[submodule "src/libmongoc"] | |||
path = src/libmongoc | |||
url = https://github.com/mongodb/mongo-c-driver.git | |||
url = https://github.com/alcaeus/mongo-c-driver.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only libmongoc PR I found open is for CDRIVER-3985, which seems unrelated (just internal to libmongoc).
For the two PHPC tickets referenced in this PR that you said are covered by libmongoc:
- PHPC-1803 depends on CDRIVER-3947, which is already merged.
- PHPC-1840 depends on CDRIVER-3997, which is just "in progress" with no PR.
So is this pointing to your branch for CDRIVER-3997, for which there is no PR yet?
zval_ptr_dtor(&state.zchild); | ||
return false; | ||
} | ||
|
||
ADD_ASSOC_ZVAL_EX(retval, "last_is_master", &state.zchild); | ||
ADD_ASSOC_ZVAL_EX(retval, "last_hello_response", &state.zchild); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just used for debug output, since Manager and Server are not serializable. No objections to changing this, since we don't document debug output at all.
php_phongo.c
Outdated
@@ -1553,7 +1553,7 @@ static bool php_phongo_apply_options_to_uri(mongoc_uri_t* uri, bson_t* options) | |||
!strcasecmp(key, MONGOC_URI_READPREFERENCE) || | |||
!strcasecmp(key, MONGOC_URI_READPREFERENCETAGS) || | |||
!strcasecmp(key, MONGOC_URI_SAFE) || | |||
!strcasecmp(key, MONGOC_URI_SLAVEOK) || | |||
!strcasecmp(key, MONGOC_URI_SECONDARYOK) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If slaveOk
handling was removed entirely from php_phongo_apply_rp_options_to_uri
, what's the reason for renaming it to a new constant here?
This seems like it's related to PHPC-1836 and CDRIVER-3989 (removing slaveOk
URI handling), but I don't see this constant in the corresponding libmongoc PR: mongodb/mongo-c-driver#794
I found a reference to this in your cdriver-3997 branch, but it's still defined to "slaveok". Was there a more recent decision to continue parsing the legacy URI option and only rename the constant?
I didn't take a look at libmongoc's URI string parsing (not sure where to look as this work is split between so many tickets), but if PHP needs to explicitly ignore it here that suggests that libmongoc would otherwise still accept it by mongoc_uri_option_is_bool
in the code down below.
What's the reason for libmongoc continuing to parse this if we're dropping it entirely in PHP? I realize they might not be able to drop the old constant due to ABI, but I expect they could stop using it and allow slaveOk
in a URI string to start raising warnings for unsupported URI options (something we don't surface through PHP).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this can be removed as libmongoc ignores the option completely
OK: Got MongoDB\Driver\Exception\RuntimeException | ||
not master | ||
not (primary|master) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a regex within EXPECTF requires wrapping the pattern with %r
. I think this might be responsible for the CI test failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I assumed they could be added directly, so I didn't bother to run them. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once regex patterns in EXPECTF are fixed.
OK: Got MongoDB\Driver\Exception\RuntimeException | ||
not master | ||
not (primary|master) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test failures are due to 5.0 behaving differently. I'm fixing those in PHPC-1848. Waiting for mongodb/mongo-c-driver#797 to be merged before proceeding here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK to sort out test failures in #1225.
The libmongoc update takes care of PHPC-1840 and PHPC-1803. This PR also brings in changes for PHPC-1836 and PHPC-1842.