Skip to content

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

Merged
merged 7 commits into from
Jun 22, 2021

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented May 21, 2021

The libmongoc update takes care of PHPC-1840 and PHPC-1803. This PR also brings in changes for PHPC-1836 and PHPC-1842.

@alcaeus alcaeus requested a review from jmikola May 21, 2021 11:52
@alcaeus alcaeus self-assigned this May 21, 2021
@@ -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)) {
Copy link
Member Author

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
Copy link
Member Author

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.

Copy link
Member

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:

So is this pointing to your branch for CDRIVER-3997, for which there is no PR yet?

Copy link
Member Author

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);
Copy link
Member Author

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.

Copy link
Member

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.

@alcaeus alcaeus changed the title PHPC-1841: Remove oppressive terminology from source code PHPC-1842: Remove oppressive terminology from source code May 21, 2021
@alcaeus alcaeus changed the title PHPC-1842: Remove oppressive terminology from source code PHPC-1756: Remove oppressive terminology from source code May 21, 2021
.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
Copy link
Member

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:

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);
Copy link
Member

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) ||
Copy link
Member

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).

Copy link
Member Author

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)
Copy link
Member

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.

Copy link
Member Author

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!

Copy link
Member

@jmikola jmikola left a 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)
Copy link
Member

Choose a reason for hiding this comment

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

@alcaeus
Copy link
Member Author

alcaeus commented May 26, 2021

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.

@alcaeus alcaeus changed the title PHPC-1756: Remove oppressive terminology from source code [WAIT] PHPC-1756: Remove oppressive terminology from source code May 26, 2021
@alcaeus alcaeus changed the title [WAIT] PHPC-1756: Remove oppressive terminology from source code PHPC-1756: Remove oppressive terminology from source code Jun 22, 2021
@alcaeus alcaeus requested a review from jmikola June 22, 2021 08:57
@alcaeus
Copy link
Member Author

alcaeus commented Jun 22, 2021

@jmikola test failures are being fixed in #1225 - should we merge this and fix the build in your PR?

Copy link
Member

@jmikola jmikola left a 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.

@alcaeus alcaeus merged commit a612c37 into mongodb:master Jun 22, 2021
@alcaeus alcaeus deleted the phpc-1841 branch June 22, 2021 17:31
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