Commit Graph

3944 Commits

Author SHA1 Message Date
Jeremy Mikola
96bbdab677 PHPC-1835: Rotate credentials for Atlas connectivity tests (#1220)
* Use ping instead of isMaster in Atlas connectivity tests

* PHPC-1835: Rotate credentials for Atlas connectivity tests

This corresponds with a change to the project's Evergreen config to rotate keys for decrypting atlas-uris.txt.enc.

Additionally, this adds comments atlas-uris.txt and atlas.phpt test output for improved readability.
2021-05-11 13:09:58 -04:00
Alexander Golin
68019a258a PHPC-1792: Change all copyrights to be <year>-present (#1217) 2021-05-03 09:04:08 -04:00
Andreas Braun
6764eeffef PHPC-1809 Replace travis-ci status badge 2021-04-29 10:11:43 +02:00
Jeremy Mikola
c1960f330f PHPC-1813: Unpin session after aborting a transaction (#1219)
* PHPC-1813: Unpin session after aborting a transaction

Bumps libmongoc dependency to pull in changes from CDRIVER-3949

* Revise Extended JSON tests for CDRIVER-3958
2021-04-26 16:57:59 -04:00
Jeremy Mikola
919fe150ea Add external links to new issue workflow (#1218) 2021-04-20 09:20:56 -04:00
Jeremy Mikola
324182a8e6 PHPC-1804: Manager::addSubscriber and removeSubscriber (#1213)
* Use zend_exception_ce instead of zend_exception_get_default()

zend_exception_get_default() has been deprecated since PHP 7.0. See: php/php-src@f9e9d3a437

* Check retval from php_phongo_set_monitoring_callbacks

This ensures that php_phongo_client_register is never called in the event this method fails (however unlikely).

* Index subscriber HashTable by numeric object handles

This also updates add/removeSubscriber to use the new argument parsing macros from deead9687e.

* PHPC-1804: Manager::addSubscriber and removeSubscriber

Implements per-client event subscribers. Moves existing APM code to a new phongo_apm.c module and adds logic to coordinate dispatching between global and per-client subscribers.
2021-04-09 08:55:44 -04:00
Andreas Braun
4ba48e5f6f Back to -dev 2021-04-09 13:58:06 +02:00
Andreas Braun
d60d99e98c Package 1.10.0alpha1 1.10.0alpha1 2021-04-09 13:56:53 +02:00
Andreas Braun
3baacb85ee Add missing file mask to packaging script 2021-04-09 13:56:42 +02:00
Andreas Braun
b29806d0b8 Update libmongoc to 1.18.0-alpha (#1216) 2021-04-09 12:24:13 +02:00
Jeremy Mikola
c4d994bacd Merge branch 'v1.9' 2021-04-07 13:44:34 -04:00
Jeremy Mikola
8d2a4c3b8c Back to -dev 2021-04-07 12:29:13 -04:00
Jeremy Mikola
60163e64ef Package 1.9.1 1.9.1 2021-04-07 12:28:24 -04:00
Jeremy Mikola
fbb8918c87 Merge branch 'v1.9' 2021-04-07 12:11:06 -04:00
Jeremy Mikola
01e8a6f9c8 PHPC-1808: Bump libmongoc to 1.17.4 (#1214) 2021-04-07 12:06:38 -04:00
Jeremy Mikola
adcd45030c Merge branch 'v1.9' 2021-03-31 11:49:16 -04:00
Jeremy Mikola
5d3e61672f PHPC-1801: Fix arginfo for Manager::selectServer (#1211) 2021-03-31 11:48:39 -04:00
Andreas Braun
c6d763a835 PHPC-1795 Remove xtrace from build scripts (#1212) 2021-03-31 14:22:24 +02:00
Andreas Braun
deead9687e PHPC-1716 Allow configuring server API version in manager (#1204)
* Introduce MongoDB\Driver\ServerApi

* Accept serverApi driver option

* Introduce create_test_manager factory to create manager

A centralised entry point is required to inject the API_VERSION env variable later.

* Add build variant to test with requireApiVersion=true

* Fix wrong configuration for auth variable

This changed when migrating from our own scripts to drivers-evergreen-tools and was not updated properly, causing all tests to run with auth disabled.

* Declare ZEND_PARSE_PARAMETERS_NONE macro

This macro is missing on PHP < 7.3

* Remove duplicated API param storage

* Add missing semicolons

* Add ZEND_PARSE_PARAMETERS_NON_EX macro

* Extract error handling functionality to separate macros

* Throw if internal mongoc_server_api_t is already initialised

* Use imported namespaces in tools file

* Fix type info for reflection

* Use American English spelling

* Only use typed serialize signature on PHP 8+

* Update PHONGO_PARSE_PARAMETERS_NONE macro for PHP < 7.3

* Remove usage of ZEND_STRL within zend_hash_str_add

This causes compile failures on PHP < 7.3 that I have yet to understand.

* Fix errors in new PHONGO_PARSE_PARAMETERS macros
2021-03-26 15:43:48 +01:00
Andreas Braun
9f854a43f7 PHPC-1681 Support parsing $uuid as extended JSON representation for subtype 4 binary (#1208)
* Update to latest version of libmongoc

* Support parse error tests for binary types

* Sync bson-corpus spec tests for binary
2021-03-26 10:04:18 +01:00
Jeremy Mikola
87790d6569 Merge branch 'v1.9' 2021-03-25 10:01:54 -04:00
Andreas Braun
de42fabc14 Add PHP 8.1 to GitHub Actions workflows 2021-03-25 10:01:28 -04:00
Jeremy Mikola
00e8f089e2 PHPC-1793: Use zend_ce_countable for PHP 8.1+ compat
zend_ce_countable was introduced in PHP 7.2 (see: php/php-src@27e7aea412) and spl_ce_Countable was removed in PHP 8.1 (see: php/php-src@4f4c031f62).
2021-03-25 10:01:28 -04:00
Andreas Braun
ddfe1c3321 Fix running auth tests (#1206)
* Fix running auth tests

* Fix flaky tests on replica sets

* Remove arbiters from replica set config

This was done for auth due to a bug fixed in 3.7.7, but the change was not reverted (see https://github.com/mongodb-labs/drivers-evergreen-tools/pull/38).

* Harden test against non-deterministic return order
2021-03-25 10:25:42 +01:00
Andreas Braun
fa45c5452c Update libmongoc to latest version (#1205) 2021-03-18 10:09:43 +01:00
Andreas Braun
a6e9c507cd Fix clang-format violation 2021-03-01 12:41:05 +01:00
Andreas Braun
37408e1ccf Merge branch 'v1.9'
* v1.9:
  PHPC-1739 Move from travis-ci to GitHub Actions (#1199)
  PHPC-1774 Fix truncation of PHP_VERSION constant in handshake metadata (#1202)
  PHPC-1775 Use correct size for strncpy in when initialising DBPointer (#1203)
2021-02-23 14:52:15 +01:00
Andreas Braun
ed31cba5cb PHPC-1739 Move from travis-ci to GitHub Actions (#1199)
* Add GitHub Action workflow for tests

* Add workflow to check formatting

* Remove travis-ci config

* Fix clang-format error

* Add shared json extension for tests

* Hide output for xfail tests

* Use mongo-orchestration configs from drivers-evergreen-tools

* Drop obsolete test scripts

This drops the legacy VM environment and remnants of the travis-ci config

* Remove obsolete server_id config

* Add note about MONGO_ORCHESTRATION_URI to contribution docs

* Restore previous XFAIL behaviour

This did not have the expected effect of preventing diff output for tests that expect failures, so it can be reverted.

* Make SSL certificate path configurable for tests

Since mongo-orchestration will always bring its own certificates, we need to set the correct SSL certificate directory for our tests. This is skipped on GitHub Actions as we don't test SSL builds there (yet). If SSL_DIR was not set, tests requiring SSL will be skipped.

* Fix code review nits
2021-02-23 14:49:54 +01:00
Andreas Braun
ef28066d84 PHPC-1774 Fix truncation of PHP_VERSION constant in handshake metadata (#1202)
* PHPC-1774 Fix truncation of PHP_VERSION constant in handshake metadata

* Work around libmongoc issue that concatenates platform without whitespace
2021-02-23 13:50:26 +01:00
Andreas Braun
d5b11f4a0b PHPC-1775 Use correct size for strncpy in when initialising DBPointer (#1203) 2021-02-23 08:13:11 +01:00
Andreas Braun
f1bdaa4bb9 Write test results to junit log file (#1200) 2021-02-17 10:19:54 +01:00
Andreas Braun
500cc8254e Autodetect PHP patch version (#1201) 2021-02-17 10:19:10 +01:00
Andreas Braun
23714f8e19 PHPC-1684 Support Azure and GCP for FLE keystores (#1196)
* Update to latest libmongoc dev version

* Update to libmongocrypt 1.2.1-dev
2021-02-09 11:18:03 +01:00
Jeremy Mikola
63a479103e PHPC-1720: Move mongoc_client_set_error_api after check for null client pointer (#1197) 2021-02-08 08:58:29 -05:00
Andreas Braun
9c51b70e60 Merge branch 'v1.9'
* v1.9:
  Fix build failures with clang 12 (#1193)
  PHPC-1748 Fix wrong return value of Cursor::key when iterator is not valid (#1192)
2021-01-26 07:55:36 +01:00
Andreas Braun
35e5b6cbcb Fix build failures with clang 12 (#1193) 2021-01-26 07:55:22 +01:00
Andreas Braun
24eb9bc37a PHPC-1748 Fix wrong return value of Cursor::key when iterator is not valid (#1192)
* PHPC-1748 Fix wrong return value of Cursor::key when iterator is not valid

* Inline single-use iterator handlers
2021-01-25 12:44:03 +01:00
Andreas Braun
032af9a8ef PHPC-1529: Reset libmongocrypt key vault client after forking (#1189)
* PHPC-1529: Reset libmongocrypt key vault client after forking

* Run ping command instead of find

* Update wrong comment

* Only run tests when libmongocrypt is present

* Add mongocryptd.pid to gitignore

* Fix test failures due to missing mongocryptd
2021-01-20 19:30:39 +01:00
Jeremy Mikola
69efd5cee4 PHPC-1737: Use zend_hash_graceful_reverse_destroy for persistent client HashTable (#1191)
Also improve comments for request-scoped HashTables
2021-01-20 07:42:11 -05:00
Jeremy Mikola
5959c50fcb PHPC-1367: Move libmongoc init/cleanup within scope of custom libbson vtable 2021-01-20 00:54:57 -05:00
Jeremy Mikola
19cf10110c PHPC-1366: Declare libbson vtable in MINIT instead of using a global 2021-01-20 00:54:57 -05:00
Jeremy Mikola
6e7eb34dab PHPC-1722: Destroy persistent clients in GSHUTDOWN
This ensures persistent clients in all threads are freed, not just those in the main thread. Doing so also required that we call mongoc_cleanup and bson_mem_restore_vtable in the final GSHUTDOWN (tracked by an atomic counter).
2021-01-20 00:54:57 -05:00
Andreas Braun
9da82d3425 Merge branch 'v1.9'
* v1.9:
  PHPC-1713: Ensure Cursor::current returns null on invalid positions (#1186)
2021-01-13 11:00:09 +01:00
Jeremy Mikola
5e2f7b5461 PHPC-1645: Allow disabling of libmongoc client persistence (#1187)
* Replace client pointers on object structs with Manager references

* Request-scoped Manager registry for APM events

* Ensure Manager is registered regardless of persistent client

* Reset request-scoped clients when forking

* Test for freeing Manager during RSHUTDOWN via subscriber reference

Co-authored-by: Andreas Braun <git@alcaeus.org>
2021-01-12 08:27:32 -05:00
Andreas Braun
70a097e5a1 PHPC-1713: Ensure Cursor::current returns null on invalid positions (#1186)
* Ensure Cursor::current returns null on invalid positions

* Addressed code review feedback
2020-12-22 14:37:19 +01:00
Andreas Braun
d291960231 PHPC-1717: Add note about filing docs ticket for compatibility changes 2020-12-16 18:41:02 +01:00
Andreas Braun
ac5b032696 Merge branch 'v1.9'
* v1.9:
  Back to -dev
  Package 1.9.0
2020-11-25 13:16:56 +01:00
Andreas Braun
90a57cd550 Back to -dev 2020-11-25 13:16:26 +01:00
Andreas Braun
142a2c9972 Package 1.9.0 1.9.0 2020-11-25 13:10:49 +01:00
Andreas Braun
6d550cb934 Merge branch 'v1.9'
* v1.9:
  PHPC-1700: Fix memory leak when read preference is invalid (#1179)
  PHPC-1706: Don't try linking against libresolv on AIX (#1172)
2020-11-25 13:10:33 +01:00