Closed tinchodias closed 6 years ago
It's failing in pharo 4:
Got startup errors:
FileDoesNotExist: File @ /home/travis/build/tinchodias/mongotalk/mc/Mongo-BSON.package/monticello.meta/version
It's true, in this recently merged commit this file and many other .json were deleted: https://github.com/pharo-nosql/mongotalk/commit/74a6255292bd2ace6f539ad50eb1204d074b659b#diff-3a0cef526df4e252a4daa4f6ec449778
Don't know why... Maybe I worked in a version of Pharo that created the commit metadata-less.
In summary, the CI error is independent from this PR. But I would like to know what to do with the error... revert the deletions?
Aha, I see Norbert already had to fix a similar issue with metadata in 36866185175175f8081b3040588e5ff240353c6a
@noha how did you re-create the metadata in https://github.com/pharo-nosql/mongotalk/commit/36866185175175f8081b3040588e5ff240353c6a?
I've just did commit (locally) with Iceberg from Pharo 6.1 (60540) and it doesn't create any metadata files.
However, it'd be great to work without all that metadata to simplify reviews and merges. Do we need to stop Pharo 4 support to achieve that? Is it viable?
I've found "[Pharo-users] Latest Voyage for Pharo4" thread from last year (17/02/2017), so it seems users could appreciate keeping support for Pharo 4.
well, I will merge it
For the record:
IMHO Mongo class shouldn't implement mongodb 2.6 and 3.0. Not sure what's the solution... Maybe it could implement Mongo as an abstract class and Mongo26, Mongo30, etc. as subclasses with the particular stuff. Maybe it's better to ensure master branch is a driver for latest mongodb version, and support for older mongodb versions are other branches.
I've just learnt something: there is a official specification for mongodb drivers, and this "#collections" stuff is defined:
"Drivers MAY implement a method to enumerate all collections, and return only the collection names."
So I understand this fix is right.
I've found how to restore filetree metadata: by doing package-level commits in a Monticello filetree repo. Done in #31 .
MongoDB 3.0 changed the way to get the list of a database's collections, as explained by Udo Schneider (@krodelin) in #12 .
Changes in MongoDatabase:
The old implementation of #collections is now named like this:
and the new implementation to get collection names is:
In fact, this implementation for 3.0 is buggy because it answers only a "first batch" of collections. However, I propose this fix as a workaround to have green tests, and after we can provide a better fix in another PR.