Skip to content
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

PHPC-1805 and PHPC-1910: Implement ServerDescription class and Server::getServerDescription() #1239

Merged
merged 21 commits into from Jul 30, 2021

Conversation

tanlisu
Copy link
Contributor

@tanlisu tanlisu commented Jul 19, 2021

@tanlisu tanlisu requested a review from alcaeus July 19, 2021 21:57
config.m4 Outdated Show resolved Hide resolved
config.w32 Outdated Show resolved Hide resolved
php_phongo.c Outdated Show resolved Hide resolved
php_phongo.c Outdated Show resolved Hide resolved
php_phongo_classes.h Outdated Show resolved Hide resolved
php_phongo_classes.h Outdated Show resolved Hide resolved
php_phongo_structs.h Outdated Show resolved Hide resolved
src/MongoDB/Server.c Outdated Show resolved Hide resolved
src/MongoDB/ServerDescription.c Outdated Show resolved Hide resolved
tests/server/server-getServerDescription-001.phpt Outdated Show resolved Hide resolved
@tanlisu tanlisu force-pushed the phpc-1805 branch 2 times, most recently from 5bb2146 to a8ec9e7 Compare July 23, 2021 20:36
@tanlisu tanlisu marked this pull request as ready for review July 28, 2021 16:07
@tanlisu
Copy link
Contributor Author

tanlisu commented Jul 28, 2021

The GitHub CI test failure for the PHP 8.1 build environment (https://github.com/mongodb/mongo-php-driver/pull/1239/checks?check_run_id=3183644508) is expected I believe - see https://jira.mongodb.org/browse/PHPC-1849

@jmikola
Copy link
Member

jmikola commented Jul 28, 2021

The GitHub CI test failure for the PHP 8.1 build environment

Please rebase on (or merge in) master to pull in #1241. I think it makes sense to just disable 8.1 until we address PHPC-1849.

@tanlisu tanlisu changed the title PHPC-1805: Implement ServerDescription class and add to monitoring ev… PHPC-1805 and PHPC-1849: Implement ServerDescription class and Server::getServerDescription() Jul 28, 2021
@jmikola jmikola changed the base branch from master to feature/sdam-monitoring July 29, 2021 14:40
php_phongo.c Outdated Show resolved Hide resolved
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.

Some comments on the code. I'll get to the tests afterwards when those points are addressed and I run this locally.

src/MongoDB/Server.c Show resolved Hide resolved
src/MongoDB/ServerDescription.c Outdated Show resolved Hide resolved
src/MongoDB/ServerDescription.c Outdated Show resolved Hide resolved
src/MongoDB/ServerDescription.c Outdated Show resolved Hide resolved
src/MongoDB/ServerDescription.c Outdated Show resolved Hide resolved
src/MongoDB/ServerDescription.c Outdated Show resolved Hide resolved
src/MongoDB/ServerDescription.c Outdated Show resolved Hide resolved
src/MongoDB/ServerDescription.c Show resolved Hide resolved
src/MongoDB/ServerDescription.c Outdated Show resolved Hide resolved
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.

Should be good to go after this round of feedback is addressed.


helloResponse = mongoc_server_description_hello_response(intern->server_description);

php_phongo_bson_state state;
Copy link
Member

@jmikola jmikola Jul 30, 2021

Choose a reason for hiding this comment

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

For consistency we should declare all variables at the top of the scope. Perhaps you don't see this using clang on macOS, but I get the following error compiling with GCC:

src/MongoDB/ServerDescription.c: In function ‘zim_ServerDescription_getHelloResponse’:
src/MongoDB/ServerDescription.c:44:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

Note that newer C standards would permit this (see: https://stackoverflow.com/q/8474100).


I'm not sure why this wasn't caught by CI. Looking at the build status for the PR, only AppVeyor (Windows) appears to have run on the most recent iteration.

src/MongoDB/ServerDescription.c Outdated Show resolved Hide resolved
src/MongoDB/ServerDescription.c Outdated Show resolved Hide resolved
--SKIPIF--
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
<?php skip_if_not_live(); ?>
<?php skip_if_not_clean(); ?>
Copy link
Member

Choose a reason for hiding this comment

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

IIRC, this is only needed if the test is going to read/write data. Since you're just selecting a server here, we don't need to concern ourselves with the collection under test being empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, the same SKIPIF is included in server-debug.phpt - should I make a ticket to remove that?

Copy link
Member

Choose a reason for hiding this comment

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

You can just edit the file in GitHub and generate a PR (instead of directly committing). I don't think we need to track that with a ticket.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Same comment as #1242 (comment)

I was only suggesting that skip_if_not_clean be removed.

tests/serverDescription/serverDescription-getType-001.phpt Outdated Show resolved Hide resolved
tests/serverDescription/serverDescription-getType-001.phpt Outdated Show resolved Hide resolved
@jmikola
Copy link
Member

jmikola commented Jul 30, 2021

I'm not sure why this wasn't caught by CI. Looking at the build status for the PR, only AppVeyor (Windows) appears to have run on the most recent iteration.

I think this is due to the GitHub CI config only expecting certain branches for PRs (see: tests.yml). I just addressed that in 69cc2b5 and merged it into the feature/sdam-monitoring branch. Please rebase and force-push this again to try and trigger a CI build.

The Evergreen config likely has something similar, but it's less flexible as I think we'd need an entirely different project created just for the feature branch. We can do without that for now.

@tanlisu
Copy link
Contributor Author

tanlisu commented Jul 30, 2021

I rebased on the feature/sdam-monitoring branch but I think the GitHub CI is still missing the Coding Standards test.

@jmikola
Copy link
Member

jmikola commented Jul 30, 2021

I rebased on the feature/sdam-monitoring branch but I think the GitHub CI is still missing the Coding Standards test.

I didn't realize we had multiple YML configs. Fixed in f3bf5a3 and just merged into the feature branch.

tanlisu and others added 4 commits July 30, 2021 15:57
Co-authored-by: Andreas Braun <alcaeus@users.noreply.github.com>
Co-authored-by: Andreas Braun <alcaeus@users.noreply.github.com>
@jmikola jmikola changed the title PHPC-1805 and PHPC-1849: Implement ServerDescription class and Server::getServerDescription() PHPC-1805 and PHPC-1910: Implement ServerDescription class and Server::getServerDescription() Jul 30, 2021
@jmikola
Copy link
Member

jmikola commented Jul 30, 2021

The PR description had a reference to PHPC-1849, which I think was incorrect. I changed that to PHPC-1910.

Also, one of the commits says "Implement ServerDescription class and add to monitoring events". Since this PR didn't actually integrate anything with the APM events please make sure that's removed from the message when merging. In fact, I'm not sure any of the individual commit messages need to be kept when squashing, since they don't have any relevance beyond the code review. The PR title sufficiently describes everything in this case.

@tanlisu tanlisu merged commit 693e264 into mongodb:feature/sdam-monitoring Jul 30, 2021
jmikola added a commit to jmikola/mongo-php-driver that referenced this pull request Aug 16, 2021
…::getServerDescription() (mongodb#1239)

Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
jmikola added a commit to jmikola/mongo-php-driver that referenced this pull request Aug 17, 2021
…::getServerDescription() (mongodb#1239)

Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
jmikola added a commit that referenced this pull request Nov 3, 2021
…::getServerDescription() (#1239)

Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
jmikola added a commit that referenced this pull request Dec 30, 2021
…::getServerDescription() (#1239)

Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
jmikola added a commit to jmikola/mongo-php-driver that referenced this pull request Jan 5, 2022
…::getServerDescription() (mongodb#1239)

Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
jmikola added a commit that referenced this pull request Jan 5, 2022
…::getServerDescription() (#1239)

Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
jmikola added a commit to jmikola/mongo-php-driver that referenced this pull request Jan 5, 2022
…::getServerDescription() (mongodb#1239)

Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
jmikola added a commit to jmikola/mongo-php-driver that referenced this pull request Jan 10, 2022
…::getServerDescription() (mongodb#1239)

Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
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.

None yet

3 participants