From 53b9c23ed8ee878471708645ec35d5b4e01e5746 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 8 May 2024 15:43:28 +0200 Subject: [PATCH 1/3] Fix build (#1291) * Remove failing build docs workflow * Run static analysis for docs to satisfy required checks * Fix checkstyle violation --- .github/workflows/docs.yml | 60 --------------------------- .github/workflows/static-analysis.yml | 4 -- src/GridFS/ReadableStream.php | 1 - 3 files changed, 65 deletions(-) delete mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index a7a1413a8..000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: "Docs" - -on: - pull_request: - branches: - - "v*.*" - - "master" - - "feature/*" - paths: - - "docs/**" - push: - branches: - - "v*.*" - - "master" - - "feature/*" - paths: - - "docs/**" - -jobs: - giza: - name: "Build Docs" - runs-on: "ubuntu-20.04" - - steps: - - name: "Checkout library" - uses: "actions/checkout@v3" - with: - path: library - fetch-depth: 2 - - - name: "Checkout docs" - uses: "actions/checkout@v3" - with: - repository: mongodb/docs-php-library - path: docs - fetch-depth: 2 - - - name: "Setup python" - uses: actions/setup-python@v4 - with: - python-version: '2.7' - - # The requirements file installs urllib3 with an incompatible version; we replace it with one that works - - name: "Install giza" - run: | - pip install -r https://raw.githubusercontent.com/mongodb/docs-tools/master/giza/requirements.txt - pip install urllib3==1.25.2 - - - name: "Sync documentation" - run: "rsync -a library/docs/ docs/source/" - - - name: "Run Giza" - run: "giza make publish" - working-directory: docs - - - name: "Upload built documentation" - uses: actions/upload-artifact@v3 - with: - name: php-library-docs.tar.gz - path: docs/build/public/master/php-library.tar.gz diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 8f9c45019..cc0668d7f 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -6,15 +6,11 @@ on: - "v*.*" - "master" - "feature/*" - paths-ignore: - - "docs/**" push: branches: - "v*.*" - "master" - "feature/*" - paths-ignore: - - "docs/**" env: PHP_VERSION: "8.2" diff --git a/src/GridFS/ReadableStream.php b/src/GridFS/ReadableStream.php index 7c3d8be4b..3c9f91641 100644 --- a/src/GridFS/ReadableStream.php +++ b/src/GridFS/ReadableStream.php @@ -106,7 +106,6 @@ public function __construct(CollectionWrapper $collectionWrapper, object $file) * Return internal properties for debugging purposes. * * @see https://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo - * @return array */ public function __debugInfo(): array { From 3ced650db00c8e5e7fff090ede20f3fab47878e5 Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Thu, 9 May 2024 13:27:57 -0400 Subject: [PATCH 2/3] DOCSP-37027: Fix 1.16 build errors (#1290) --- docs/includes/extracts-option-requires.yaml | 21 +++++++++---------- docs/reference.txt | 2 -- .../method/MongoDBCollection-bulkWrite.txt | 12 +++++------ .../method/MongoDBCollection-dropIndex.txt | 3 +-- .../method/MongoDBCollection-dropIndexes.txt | 2 +- .../method/MongoDBCollection-explain.txt | 2 +- .../MongoDBCollection-findOneAndUpdate.txt | 2 +- .../method/MongoDBCollection-updateMany.txt | 2 +- .../method/MongoDBCollection-updateOne.txt | 2 +- .../MongoDBDatabase-createCollection.txt | 2 +- docs/reference/result-classes.txt | 2 +- docs/tutorial/gridfs.txt | 2 +- 12 files changed, 25 insertions(+), 29 deletions(-) diff --git a/docs/includes/extracts-option-requires.yaml b/docs/includes/extracts-option-requires.yaml index 3b65fbbab..edc1c0d37 100644 --- a/docs/includes/extracts-option-requires.yaml +++ b/docs/includes/extracts-option-requires.yaml @@ -1,48 +1,47 @@ +ref: _option-requires-version +content: | + This option is available since MongoDB {{version}} and will result in an + exception at execution time if specified for an older server version. --- ref: option-requires-4.2 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "4.2" --- ref: option-requires-4.4 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "4.4" --- ref: option-requires-5.0 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "5.0" --- ref: option-requires-5.3 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "5.3" --- ref: option-requires-6.0 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "6.0" --- ref: option-requires-7.0 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "7.0" ---- -ref: option-requires-version -content: | - This option is available since MongoDB {{version}} and will result in an - exception at execution time if specified for an older server version. ... diff --git a/docs/reference.txt b/docs/reference.txt index 1d2c76db3..48ec340b7 100644 --- a/docs/reference.txt +++ b/docs/reference.txt @@ -12,8 +12,6 @@ Reference /reference/class/MongoDBDatabase /reference/class/MongoDBCollection /reference/class/MongoDBGridFSBucket - /reference/write-result-classes /reference/result-classes - /reference/enumeration-classes /reference/functions /reference/exception-classes diff --git a/docs/reference/method/MongoDBCollection-bulkWrite.txt b/docs/reference/method/MongoDBCollection-bulkWrite.txt index f76d6ca68..f7defc12d 100644 --- a/docs/reference/method/MongoDBCollection-bulkWrite.txt +++ b/docs/reference/method/MongoDBCollection-bulkWrite.txt @@ -30,12 +30,12 @@ Parameters ``$operations`` : array An array containing the write operations to perform. :phpmethod:`MongoDB\Collection::bulkWrite()` supports - :phpmethod:`deleteMany() `, - :phpmethod:`deleteOne() `, - :phpmethod:`insertOne() `, - :phpmethod:`replaceOne() `, - :phpmethod:`updateMany() `, and - :phpmethod:`updateOne() ` operations in the + :phpmethod:`MongoDB\Collection::deleteMany()`, + :phpmethod:`MongoDB\Collection::deleteOne()`, + :phpmethod:`MongoDB\Collection::insertOne()`, + :phpmethod:`MongoDB\Collection::replaceOne()`, + :phpmethod:`MongoDB\Collection::updateMany()`, and + :phpmethod:`MongoDB\Collection::updateOne()` operations in the following array structure: .. code-block:: php diff --git a/docs/reference/method/MongoDBCollection-dropIndex.txt b/docs/reference/method/MongoDBCollection-dropIndex.txt index 67ba427e3..d1aa937cb 100644 --- a/docs/reference/method/MongoDBCollection-dropIndex.txt +++ b/docs/reference/method/MongoDBCollection-dropIndex.txt @@ -29,8 +29,7 @@ Parameters ``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo` The name or model object of the index to drop. View the existing indexes on - the collection using the :phpmethod:`listIndexes() - ` method. + the collection by using the :phpmethod:`MongoDB\Collection::listIndexes()` method. ``$options`` : array An array specifying the desired options. diff --git a/docs/reference/method/MongoDBCollection-dropIndexes.txt b/docs/reference/method/MongoDBCollection-dropIndexes.txt index 52595c71e..6e052cb27 100644 --- a/docs/reference/method/MongoDBCollection-dropIndexes.txt +++ b/docs/reference/method/MongoDBCollection-dropIndexes.txt @@ -28,7 +28,7 @@ Parameters ``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo` The name or model object of the index to drop. View the existing indexes on the collection using the :phpmethod:`listIndexes() - ` method. + ` method. ``$options`` : array An array specifying the desired options. diff --git a/docs/reference/method/MongoDBCollection-explain.txt b/docs/reference/method/MongoDBCollection-explain.txt index 592f717e0..03619755a 100644 --- a/docs/reference/method/MongoDBCollection-explain.txt +++ b/docs/reference/method/MongoDBCollection-explain.txt @@ -29,7 +29,7 @@ Definition Parameters ---------- -``$explainable`` : :phpclass:`MongoDB\Operation\Explainable` +``$explainable`` : ``MongoDB\Operation\Explainable`` The command to explain. ``$options`` : array diff --git a/docs/reference/method/MongoDBCollection-findOneAndUpdate.txt b/docs/reference/method/MongoDBCollection-findOneAndUpdate.txt index f4077b344..19849ad3c 100644 --- a/docs/reference/method/MongoDBCollection-findOneAndUpdate.txt +++ b/docs/reference/method/MongoDBCollection-findOneAndUpdate.txt @@ -33,7 +33,7 @@ Parameters ``$update`` : array|object Specifies the field and value combinations to update and any relevant update - operators. ``$update`` uses MongoDB's :method:`update operators + operators. ``$update`` uses MongoDB's :manual:`update operators `. Starting with MongoDB 4.2, an `aggregation pipeline `_ can be passed as this parameter. diff --git a/docs/reference/method/MongoDBCollection-updateMany.txt b/docs/reference/method/MongoDBCollection-updateMany.txt index 2b0772209..9d567ec34 100644 --- a/docs/reference/method/MongoDBCollection-updateMany.txt +++ b/docs/reference/method/MongoDBCollection-updateMany.txt @@ -33,7 +33,7 @@ Parameters ``$update`` : array|object Specifies the field and value combinations to update and any relevant update - operators. ``$update`` uses MongoDB's :method:`update operators + operators. ``$update`` uses MongoDB's :manual:`update operators `. Starting with MongoDB 4.2, an `aggregation pipeline `_ can be passed as this parameter. diff --git a/docs/reference/method/MongoDBCollection-updateOne.txt b/docs/reference/method/MongoDBCollection-updateOne.txt index 321103c24..42877e730 100644 --- a/docs/reference/method/MongoDBCollection-updateOne.txt +++ b/docs/reference/method/MongoDBCollection-updateOne.txt @@ -35,7 +35,7 @@ Parameters ``$update`` : array|object Specifies the field and value combinations to update and any relevant update - operators. ``$update`` uses MongoDB's :method:`update operators + operators. ``$update`` uses MongoDB's :manual:`update operators `. Starting with MongoDB 4.2, an `aggregation pipeline `_ can be passed as this parameter. diff --git a/docs/reference/method/MongoDBDatabase-createCollection.txt b/docs/reference/method/MongoDBDatabase-createCollection.txt index 3c45debc9..8b49e901b 100644 --- a/docs/reference/method/MongoDBDatabase-createCollection.txt +++ b/docs/reference/method/MongoDBDatabase-createCollection.txt @@ -296,7 +296,7 @@ Parameters rules or expressions. You can specify the expressions using the same operators as MongoDB's :manual:`query operators ` with the - exception of :query:`$geoNear`, :query:`$near`, :query:`$nearSphere`, + exception of :query:`$near`, :query:`$nearSphere`, :query:`$text`, and :query:`$where`. .. note:: diff --git a/docs/reference/result-classes.txt b/docs/reference/result-classes.txt index db5ff7590..b59f480cd 100644 --- a/docs/reference/result-classes.txt +++ b/docs/reference/result-classes.txt @@ -10,7 +10,7 @@ Result Classes BulkWriteResult Class DeleteResult Class InsertManyResult Class - InsertOneResult Class + InsertOneResult Class UpdateResult Class ChangeStream Class MapReduceResult Class diff --git a/docs/tutorial/gridfs.txt b/docs/tutorial/gridfs.txt index 4688aefb3..dc6afa15d 100644 --- a/docs/tutorial/gridfs.txt +++ b/docs/tutorial/gridfs.txt @@ -35,7 +35,7 @@ The bucket can be constructed with various options: needed. The default size is ``261120`` (i.e. 255 KiB). - ``readConcern``, ``readPreference`` and ``writeConcern`` options can be used to specify defaults for read and write operations, much like the - :phpclass:`MongoDB\GridFS\Collection` options. + :phpclass:`MongoDB\Collection` options. Uploading Files with Writable Streams ------------------------------------- From 811eff61c69e7754d8b4fe61a55e0fb7299146ee Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 10 May 2024 09:27:10 +0200 Subject: [PATCH 3/3] Enable auto-merge in merge-up workflow (#1295) --- .github/workflows/merge-up.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/merge-up.yml b/.github/workflows/merge-up.yml index 4abb8dc0c..cb5a3df02 100644 --- a/.github/workflows/merge-up.yml +++ b/.github/workflows/merge-up.yml @@ -29,3 +29,4 @@ jobs: ref: ${{ github.ref_name }} branchNamePattern: 'v.' fallbackBranch: 'master' + enableAutoMerge: true