-
-
Notifications
You must be signed in to change notification settings - Fork 8
Adds PHP 8 support and Laminas CI workflow #6
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
Conversation
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Filippo Tessarotto <[email protected]>
3e78f4e
to
866656d
Compare
Rebase done, now an approval is needed |
The build fails on What should I do @boesing ? Generate a lock for by PHP 5.6? I'd prefer remove it altogether, I don't see how it can help on such a wide range of PHP versions that, ndr, compile good on both |
Oh by the way, please remove the You may have a look at how I've done that for the redis adapter: Maybe #1 can help to make some tests pass as I've experienced issues in v1.0.0 already but that version was meant to be a 1:1 copy of the original |
Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boesing So, this is a tough one. I had no prior knowledge of MongoDB before this PR, please be forgiving.
I've managed to get 414 out of 416 tests pass, with only 2 failures, regarding binary data:
There was 1 error:
1) LaminasTest\Cache\Psr\SimpleCache\ExtMongoDbIntegrationTest::testBinaryData
Laminas\Cache\Psr\SimpleCache\SimpleCacheException: Detected invalid UTF-8 for field path "value": s:256:"
/vendor/laminas/laminas-cache/src/Psr/SimpleCache/SimpleCacheDecorator.php:307
/vendor/laminas/laminas-cache/src/Psr/SimpleCache/SimpleCacheDecorator.php:125
/vendor/cache/integration-tests/src/SimpleCacheTest.php:694
Caused by
Laminas\Cache\Exception\RuntimeException: Detected invalid UTF-8 for field path "value": s:256:"
/src/ExtMongoDb.php:214
/vendor/laminas/laminas-cache/src/Storage/Adapter/AbstractAdapter.php:673
/vendor/laminas/laminas-cache/src/Psr/SimpleCache/SimpleCacheDecorator.php:123
/vendor/cache/integration-tests/src/SimpleCacheTest.php:694
Caused by
MongoDB\Driver\Exception\UnexpectedValueException: Detected invalid UTF-8 for field path "value": s:256:"
/vendor/mongodb/mongodb/src/Operation/InsertOne.php:132
/vendor/mongodb/mongodb/src/Collection.php:931
/src/ExtMongoDb.php:212
/vendor/laminas/laminas-cache/src/Storage/Adapter/AbstractAdapter.php:673
/vendor/laminas/laminas-cache/src/Psr/SimpleCache/SimpleCacheDecorator.php:123
/vendor/cache/integration-tests/src/SimpleCacheTest.php:694
--
There was 1 failure:
1) LaminasTest\Cache\Psr\CacheItemPool\ExtMongoDbIntegrationTest::testBinaryData
Binary data must survive a round trip.
Failed asserting that false is true.
/vendor/cache/integration-tests/src/CachePoolTest.php:763
I'm not able to go further 😞
runs-on: ${{ matrix.operatingSystem }} | ||
services: | ||
mongo: | ||
image: mongo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea what health check to use for MongoDB.
@@ -16,13 +16,15 @@ | |||
"laminas/laminas-cache-storage-implementation": "1.0" | |||
}, | |||
"require-dev": { | |||
"laminas/laminas-cache": "^2.10", | |||
"laminas/laminas-cache-storage-adapter-test": "^1.0@dev", | |||
"mongodb/mongodb": "^1.8.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was surprised this requirement wasn't there before: without it no test passes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was required by the travis configuration as there were different versions used for different php versions.
@@ -134,6 +134,8 @@ protected function internalGetItem(& $normalizedKey, & $success = null, & $casTo | |||
return; | |||
} | |||
|
|||
self::ensureArrayType($result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed not only for the following array_key_exists
call, but also for array subtypes which, without it, are kept \MongoDB\Model\BSONDocument
@@ -51,8 +51,7 @@ public function setResource($id, $resource) | |||
{ | |||
if ($resource instanceof Collection) { | |||
$this->resources[$id] = [ | |||
'db' => (string) $resource->db, | |||
'db_instance' => $resource->db, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea what db
was in the past, but now it's not alive anymore 🤷
I saw |
I've never used mongo aswell ;-) I've created #1 months ago to fix that BSON problem but as it is not fixed at the moment, I would dev-require that version which was used in travis as the highest version. After this, we create a feature PR where we are supporting old and newer versions of the extension.
Doing this, we can ensure that we create the same "deps" as done in the travis build. |
Gosh I completely missed this reference 😭
What do you mean "it is not fixed at the moment"? This is the purpose of #1 a this PR, isn't it?
I'm sorry I don't get this: "I would dev-require that version" of what?
I think this is enough to let us ignore multiple
I miss the PR you are referring to :\ |
Yes but that PR is kinda outdated. And this is why the bug is still present when
|
I'm sorry I'm more confused than ever.
Why not? I mean, I understand we are looking for atomic PR, but as we decided to drop PHP <7.3, we might as well make it compatible with PHP >= 7.3
Buy why? Why not simply have |
https://github.com/mongodb/mongo-php-library/releases/tag/1.5.0 That version is absolutely compatible with PHP 7.3 & PHP 7.4.
I think that would be indeed possible. But a concern I have: there might be projects which update this package and end up having another unused dependency just because we still require this package in This is why I've added Maybe @Ocramius has a view on this. I'd prefer having no new hard requirements for the satellites (in v1.x) to avoid potential fuckups in upstream projects which do not even use this component. |
Seems a correct concern and a good solution to me: what about a |
That could be a way, but what if someone depends on that library in another use-case? Sounds good enough to me. Go for it 👍🏼 |
Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
Signed-off-by: Filippo Tessarotto <[email protected]>
Thanks @Slamdunk! |
|
🤦🏼♂️ I definitely have to be more focused these days. |
No description provided.