Skip to content

Conversation

@jmikola
Copy link
Member

@jmikola jmikola commented Nov 26, 2025

@codecov-commenter
Copy link

codecov-commenter commented Nov 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.74%. Comparing base (004a3c0) to head (911fabc).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               v2.x    #1801      +/-   ##
============================================
+ Coverage     87.72%   87.74%   +0.01%     
+ Complexity     3195     3185      -10     
============================================
  Files           424      424              
  Lines          6296     6289       -7     
============================================
- Hits           5523     5518       -5     
+ Misses          773      771       -2     
Flag Coverage Δ
6.0-replica_set 85.72% <100.00%> (+0.01%) ⬆️
6.0-server 81.71% <100.00%> (+0.01%) ⬆️
6.0-sharded_cluster 85.51% <100.00%> (+0.22%) ⬆️
8.0-replica_set 87.66% <100.00%> (+0.01%) ⬆️
8.0-server 82.55% <100.00%> (+0.01%) ⬆️
8.0-sharded_cluster 87.50% <100.00%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

There is an error with PHPUnit tests (ubuntu-22.04, 8.1, 6.0, sharded_cluster)

UnexpectedValueException: Could not determine server storage engine

Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

One nit, and a request to run phpcbf. Changes themselves LGTM.

/* Server versions >= 4.2.0 raise errors for unsupported update options.
* For previous versions, the CRUD spec requires a client-side error. */
if (isset($this->options['hint']) && ! server_supports_feature($server, self::WIRE_VERSION_FOR_UNSUPPORTED_OPTION_SERVER_SIDE_ERROR)) {
throw UnsupportedException::hintNotSupported();
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Is this method still used after we remove everything? Not sure if we consider this public API, but we can remove the method if we consider it private and it's no longer used.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's still used by the Delete operation: https://github.com/mongodb/mongo-php-library/blob/2.1.2/src/Operation/Delete.php#L126-L133

I don't feel strongly about removing it after we raise the minimum server version to 4.4+, but I'm amenable to leaving it around and deprecated since it's technically public.

alcaeus and others added 4 commits December 15, 2025 11:19
if ($this->isShardedCluster()) {
$this->markTestSkipped('Transactions are only supported on FCV 4.2 or higher');
}
case Server::TYPE_RS_PRIMARY:
Copy link
Member

Choose a reason for hiding this comment

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

The condition on $this->getPrimaryServer()->getType() === Server::TYPE_RS_PRIMARY. I read the following comment, but I don't get the reason of this update.

Copy link
Member

Choose a reason for hiding this comment

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

Previous behaviour was to skip on a standalone server, on sharded clusters (not sure why this was unconditional, it should've only skipped on sharded clusters < 4.2), and on replica sets with a storage engine other than WiredTiger. Since we're now always on 4.2 and higher, we can skip on standalones, check for WiredTiger on a primary, and always support sharded clusters, hence the change.

Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

LGTM.

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.

4 participants