Skip to content

Merge v2.2 into v2.x#1976

Merged
mongodb-php-bot merged 1 commit intov2.xfrom
merge-v2.2-into-v2.x-1775634457629
Apr 8, 2026
Merged

Merge v2.2 into v2.x#1976
mongodb-php-bot merged 1 commit intov2.xfrom
merge-v2.2-into-v2.x-1775634457629

Conversation

@mongodb-php-bot
Copy link
Copy Markdown
Collaborator

Merge new changes from v2.2 into v2.x.

Commits

Resolving conflicts

To resolve any conflicts, check out the temporary branch and run the following command:
git merge v2.x -m "Resolve conflicts in v2.x"

Ignoring changes

To ignore from the remote branch, first reset the temporary branch to v2.x and manually merge using the `ours` merge strategy:
git reset --hard v2.x
git merge --strategy=ours v2.2 -m "Ignore changes from v2.2"

Then, push the temporary branch to upate the pull request.

* Add tests to improve coverage of untested or under-tested APIs

- Session::getServer() — no test existed; documents that the method
  returns null when the session is not pinned to a server (pinning
  was removed for sharded clusters in MongoDB 6.0+)
- Session::startTransaction() with all options combined — each option
  (maxCommitTimeMS, readConcern, readPreference, writeConcern) was
  only tested in isolation; this test verifies they coexist correctly
  and are all reflected by getTransactionOptions()
- ExecutionTimeoutException::hasErrorLabel() — hasErrorLabel() was
  tested on RuntimeException and BulkWriteException but not on this
  subclass
- ConnectionTimeoutException::hasErrorLabel() — same gap as above
- BulkWriteCommandException::getWriteConcernErrors() — the method
  appeared in debug output but was never explicitly asserted; this
  test verifies it returns an empty array when only write errors occur
- Query construction with maxAwaitTimeMS — only error/range validation
  tests existed; this test verifies valid values are accepted
- BulkWriteCommand constructor with multiple options combined — each
  option (ordered, comment, verboseResults) was tested in isolation;
  this test verifies they work together
- Command construction with invalid maxAwaitTimeMS — the >= 0
  validation existed in Command.c but had no corresponding test

* Address Copilot review comments

- query-ctor-maxAwaitTimeMS-001: remove UINT32_MAX case (4294967295
  overflows PHP_INT_MAX on 32-bit platforms, causing float coercion)
- session-getServer-001: update comment to accurately reflect that
  mongos pinning was removed in MongoDB 6.0+

* Merge new tests into existing files where appropriate

- bulkwritecommand-ctor-ordered-002: add getWriteConcernErrors() assertion
  (verifies empty array when only write errors occur); removes the need
  for a separate bulkwritecommandexception-getwriteconcernerrors-001.phpt
- session-getTransactionOptions-001: add combined-options case (all four
  transaction options together); removes the need for a separate
  session-startTransaction-002.phpt
@mongodb-php-bot mongodb-php-bot requested a review from a team as a code owner April 8, 2026 07:47
@mongodb-php-bot mongodb-php-bot requested review from paulinevos and removed request for a team April 8, 2026 07:47
@mongodb-php-bot mongodb-php-bot merged commit 7a83670 into v2.x Apr 8, 2026
78 of 79 checks passed
@mongodb-php-bot mongodb-php-bot deleted the merge-v2.2-into-v2.x-1775634457629 branch April 8, 2026 08:09
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