From 2755fab378ed0778e8b14af3879893d1bb1f6e06 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 27 Mar 2024 11:51:57 -0400 Subject: [PATCH 01/11] Master is now 1.19-dev --- phongo_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phongo_version.h b/phongo_version.h index a13cbee94..5eb7c70f6 100644 --- a/phongo_version.h +++ b/phongo_version.h @@ -22,9 +22,9 @@ * publishing a release. */ /* clang-format off */ -#define PHP_MONGODB_VERSION "1.18.1-dev" +#define PHP_MONGODB_VERSION "1.19.0-dev" #define PHP_MONGODB_STABILITY "devel" -#define PHP_MONGODB_VERSION_DESC 1,18,1,0 +#define PHP_MONGODB_VERSION_DESC 1,19,0,0 /* clang-format on */ #endif /* PHONGO_VERSION_H */ From 6a49ef799309c67628792213cf1e3b22a288250f Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 11 Apr 2024 10:39:07 +0200 Subject: [PATCH 02/11] Back to -dev --- phongo_version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phongo_version.h b/phongo_version.h index a7d6c71ba..277aec328 100644 --- a/phongo_version.h +++ b/phongo_version.h @@ -22,9 +22,9 @@ * publishing a release. */ /* clang-format off */ -#define PHP_MONGODB_VERSION "1.18.1" -#define PHP_MONGODB_STABILITY "stable" -#define PHP_MONGODB_VERSION_DESC 1,18,1,1 +#define PHP_MONGODB_VERSION "1.18.2-dev" +#define PHP_MONGODB_STABILITY "devel" +#define PHP_MONGODB_VERSION_DESC 1,18,2,0 /* clang-format on */ #endif /* PHONGO_VERSION_H */ From c1976285080c5330f5f030a8b6b7e1605cff83b6 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 12 Apr 2024 10:52:48 +0200 Subject: [PATCH 03/11] Disable fail-fast for Windows Tests (#1535) * Disable fail-fast for Windows Tests * Add comment explainin why fail-fast is disabled Co-authored-by: Jeremy Mikola --------- Co-authored-by: Jeremy Mikola --- .github/workflows/windows-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml index e8a7cd422..843b755cb 100644 --- a/.github/workflows/windows-tests.yml +++ b/.github/workflows/windows-tests.yml @@ -86,7 +86,9 @@ jobs: shell: cmd strategy: - fail-fast: true + # Timeouts starting the MongoDB service are common and should not + # interrupt the overall test matrix. + fail-fast: false matrix: php: [ "7.4", "8.0", "8.1", "8.2", "8.3" ] arch: [ x64, x86 ] From 7142daf6f480f2ab282fcd4234c3591eb9cc9082 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 3 May 2024 10:20:52 +0200 Subject: [PATCH 04/11] PHPC-1674: Automate Driver Releases (#1538) * Add script to update version number in phongo_version.h * Add support for release notes in prep_release.php * Add workflow to create PECL package for tags * Use PECL-compatible stability suffixes in version * Add dummy changelog for branch packages * Use package version from phongo_version.h for install * Disable install step as it currently fails * Upload release artifact for tags * Extract linux build to action * Simplify Windows builds * Create packages for Windows in package workflow * Extract and reuse Windows build workflow * Don't create artifacts when not necessary * Remove branch build trigger * Fix errors in packaging workflow * Add release workflow * Update release message * Write changelog file for PECL package * Add more output to build step * Update release documentation * Fix reading changelog for PECL packaging * Remove explicit phpize installation * Remove unnecessary fetch-depth usage * Use script parameter instead of hardcoded changelog file name * Improve update-release-version command names * Remove obsolete comment * Update JIRA version field description * Update release documentation * Fix wrong version number format * Clarify manual release process steps * Add section on announcing releases * Fix wrong heading level * Install PECL package to ensure it's functional * Only install required extensions * Use GFM note syntax * Extract release documentation --- .github/workflows/arginfo-files.yml | 1 - .github/workflows/clang-format.yml | 1 - .github/workflows/linux/build/action.yml | 23 ++ .github/workflows/package-release.yml | 110 +++++++++ .github/workflows/release.yml | 139 +++++++++++ .github/workflows/tests.yml | 15 +- .github/workflows/windows-release-build.yml | 37 --- .github/workflows/windows-tests.yml | 38 +-- .github/workflows/windows/build/action.yml | 30 +++ CONTRIBUTING.md | 257 -------------------- Makefile.frag | 4 +- RELEASING.md | 254 +++++++++++++++++++ bin/package.xml.in | 2 +- bin/prep-release.php | 6 +- bin/update-release-version.php | 173 +++++++++++++ phongo_version.h | 2 +- 16 files changed, 747 insertions(+), 345 deletions(-) create mode 100644 .github/workflows/linux/build/action.yml create mode 100644 .github/workflows/package-release.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/windows-release-build.yml create mode 100644 .github/workflows/windows/build/action.yml create mode 100644 RELEASING.md create mode 100755 bin/update-release-version.php diff --git a/.github/workflows/arginfo-files.yml b/.github/workflows/arginfo-files.yml index f85aeaad6..c0b0a8c0e 100644 --- a/.github/workflows/arginfo-files.yml +++ b/.github/workflows/arginfo-files.yml @@ -32,7 +32,6 @@ jobs: uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" - tools: "phpize" - name: "Run phpize" run: phpize diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index c7a3f0cb4..c1ecb3309 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -32,7 +32,6 @@ jobs: uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" - tools: "phpize" - name: "Configure driver" run: .github/workflows/configure.sh diff --git a/.github/workflows/linux/build/action.yml b/.github/workflows/linux/build/action.yml new file mode 100644 index 000000000..a66462268 --- /dev/null +++ b/.github/workflows/linux/build/action.yml @@ -0,0 +1,23 @@ +name: "Linux Build" +description: "Builds the driver" +inputs: + version: + description: "PHP version to build for" + required: true +runs: + using: composite + steps: + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ inputs.version }}" + # Only install required extensions + extensions: "none,date,json,spl,standard,xml" + + - name: "Configure driver" + run: .github/workflows/configure.sh + shell: bash + + - name: "Build driver" + run: "make all" + shell: bash diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml new file mode 100644 index 000000000..b913658c2 --- /dev/null +++ b/.github/workflows/package-release.yml @@ -0,0 +1,110 @@ +name: "Package Release" +run-name: "Package Release ${{ github.ref_name }}" + +on: + push: + tags: + - "*" + +jobs: + build-pecl: + name: "Create PECL package" + runs-on: "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + with: + # Manually specify a ref. When actions/checkout is run for a tag without a ref, it looks up the underlying + # commit and specifically fetches this to the refs/tags/ ref, which denies us access to the tag message + ref: ${{ github.ref }} + submodules: true + + - name: "Build Driver" + uses: ./.github/workflows/linux/build + with: + version: "8.3" + + - name: "Write changelog file for packaging" + run: git tag -l ${{ github.ref_name }} --format='%(contents)' > changelog + + # This will fill in the release notes from the previously generated changelog + - name: "Build package.xml" + run: "make package.xml RELEASE_NOTES_FILE=$(pwd)/changelog" + + - name: "Build release archive" + run: "make package" + + # PECL always uses the version for the package name. + # Read it from the version file and store in env to use when uploading artifacts + - name: "Read current package version" + run: echo "PACKAGE_VERSION=$(./bin/update-release-version.php get-version)" >> "$GITHUB_ENV" + + - name: "Install release archive to verify correctness" + run: sudo pecl install mongodb-${{ env.PACKAGE_VERSION }}.tgz + + - name: "Upload artifact" + uses: actions/upload-artifact@v4 + with: + name: mongodb-${{ env.PACKAGE_VERSION }}.tgz + path: mongodb-${{ env.PACKAGE_VERSION }}.tgz + retention-days: 3 + + - name: "Upload release artifact" + run: gh release upload ${{ github.ref_name }} mongodb-${{ env.PACKAGE_VERSION }}.tgz + continue-on-error: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build-windows: + name: "Create Windows package" + runs-on: windows-2022 + defaults: + run: + shell: cmd + + strategy: + fail-fast: false + matrix: + # Note: keep this in sync with the Windows matrix in windows-tests.yml + php: [ "7.4", "8.0", "8.1", "8.2", "8.3" ] + arch: [ x64, x86 ] + ts: [ ts, nts ] + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: "Build Driver" + id: build-driver + uses: ./.github/workflows/windows/build + with: + version: ${{ matrix.php }} + arch: ${{ matrix.arch }} + ts: ${{ matrix.ts }} + + - name: "Copy DLL and PDB files to CWD" + run: | + cp %BUILD_DIR%\php_mongodb.dll . + cp %BUILD_DIR%\php_mongodb.pdb . + env: + BUILD_DIR: ${{ steps.build-driver.outputs.build-dir }} + + - name: "Upload DLL and PDB files as build artifacts" + uses: actions/upload-artifact@v4 + with: + name: php_mongodb-${{ github.ref_name }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }} + path: | + php_mongodb.dll + php_mongodb.pdb + retention-days: 3 + + - name: "Create and upload release artifact" + run: | + set ARCHIVE=php_mongodb-${{ github.ref_name }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }}.zip + zip %ARCHIVE% php_mongodb.dll php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES + gh release upload ${{ github.ref_name }} %ARCHIVE% + continue-on-error: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..90f4c1569 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,139 @@ +name: "Release New Version" +run-name: "Release ${{ inputs.version }}" + +on: + workflow_dispatch: + inputs: + version: + description: "The version to be released. This is checked for consistency with the branch name and configuration" + required: true + type: "string" + jira-version-number: + description: "JIRA version ID (e.g. 54321)" + required: true + type: "string" + +env: + # TODO: Use different token + GH_TOKEN: ${{ secrets.MERGE_UP_TOKEN }} + GIT_AUTHOR_NAME: "DBX PHP Release Bot" + GIT_AUTHOR_EMAIL: "dbx-php@mongodb.com" + default-release-message: | + The PHP team is happy to announce that version {0} of the [mongodb](https://pecl.php.net/package/mongodb) PHP extension is now available on PECL. + + **Release Highlights** + + TODO: one or more paragraphs describing important changes in this release + + A complete list of resolved issues in this release may be found in [JIRA](https://jira.mongodb.org/secure/ReleaseNote.jspa?version={1}&projectId=12484). + + **Documentation** + + Documentation is available on [PHP.net](https://php.net/set.mongodb). + + **Installation** + + You can either download and install the source manually, or you can install the extension with: + + ``` + pecl install mongodb-{0} + ``` + + or update with: + + ``` + pecl upgrade mongodb-{0} + ``` + + Windows binaries are attached to the GitHub release notes. + +jobs: + prepare-release: + name: "Prepare release" + runs-on: ubuntu-latest + + steps: + - name: "Create release output" + run: echo '🎬 Release process for version ${{ inputs.version }} started by @${{ github.triggering_actor }}' >> $GITHUB_STEP_SUMMARY + + - uses: actions/checkout@v4 + with: + submodules: true + token: ${{ env.GH_TOKEN }} + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + + - name: "Update version information to stable release" + run: ./bin/update-release-version.php to-stable + + - name: "Read current package version" + run: echo "PACKAGE_VERSION=$(./bin/update-release-version.php get-version)" >> "$GITHUB_ENV" + + # Sanity check - the version from the input and the one determined by phongo_version.h need to be the same + - name: "Check version for consistency" + if: ${{ inputs.version != env.PACKAGE_VERSION }} + # We exit with an error to abort the workflow. This is only run if the versions don't match + run: | + echo '❌ Release failed due to version mismatch: expected ${{ inputs.version }}, got ${{ env.PACKAGE_VERSION }} from code' >> $GITHUB_STEP_SUMMARY + exit 1 + + # + # Preliminary checks done - commence the release process + # + + - name: "Set git author information" + run: | + git config user.name "${GIT_AUTHOR_NAME}" + git config user.email "${GIT_AUTHOR_EMAIL}" + + # Create the "Package x.y.z" commit that will be the base of our tag + - name: "Create release commit" + run: git commit -m "Package ${{ env.PACKAGE_VERSION }}" phongo_version.h + + # Create a draft release with a changelog + # TODO: Consider using the API to generate changelog + - name: "Create draft release with generated changelog" + run: gh release create ${{ env.PACKAGE_VERSION }} --target ${{ github.ref_name }} --generate-notes --draft + + - name: "Read changelog from draft release" + run: gh release view ${{ env.PACKAGE_VERSION }} --json body --template '{{ .body }}' >> changelog + + # TODO: Sign tag + - name: "Create release tag" + run: git tag -a -F changelog ${{ env.PACKAGE_VERSION }} + + - name: "Update version information to next patch development release" + run: | + ./bin/update-release-version.php to-next-patch-dev + git commit -m "Back to -dev" phongo_version.h + + # TODO: Manually merge using ours strategy. This avoids merge-up pull requests being created + # Process is: + # 1. switch to next branch (according to merge-up action) + # 2. merge release branch using --strategy=ours + # 3. push next branch + # 4. switch back to release branch, then push + + - name: "Push changes from release branch" + run: git push + + - name: "Prepare release message" + run: | + echo "${{ format(env.default-release-message, env.PACKAGE_VERSION, inputs.jira-version-number) }}" > release-message + cat changelog >> release-message + + # Update release with correct release information + - name: "Update release information" + run: echo "RELEASE_URL=$(gh release edit ${{ env.PACKAGE_VERSION }} --title "${{ env.PACKAGE_VERSION }}" --notes-file release-message)" >> "$GITHUB_ENV" + + # Pushing the release tag starts build processes that then produce artifacts for the release + - name: "Push release tag" + run: git push origin ${{ env.PACKAGE_VERSION }} + + - name: "Set summary" + run: | + echo '🚀 Created tag and drafted release for version [${{ inputs.version }}](${{ env.RELEASE_URL }})' >> $GITHUB_STEP_SUMMARY + echo '✍️ You may now update the release notes and publish the release when ready' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5bf95ecbb..018ca327f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,7 +54,6 @@ jobs: - name: "Checkout" uses: "actions/checkout@v4" with: - fetch-depth: 2 submodules: true - id: setup-mongodb @@ -63,17 +62,11 @@ jobs: version: ${{ matrix.mongodb-version }} topology: ${{ matrix.topology }} - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" + - name: "Build Driver" + id: build-driver + uses: ./.github/workflows/linux/build with: - php-version: "${{ matrix.php-version }}" - tools: "phpize" - - - name: "Configure driver" - run: .github/workflows/configure.sh - - - name: "Build driver" - run: "make all" + version: ${{ matrix.php-version }} - name: "Run Tests" run: TEST_PHP_ARGS="-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" make test diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml deleted file mode 100644 index 423e91499..000000000 --- a/.github/workflows/windows-release-build.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: "Windows Release Build" - -on: - release: - types: [ published ] - -jobs: - windows-release-build: - strategy: - fail-fast: false - matrix: - # Note: keep this in sync with the Windows matrix in windows-tests.yml - php: [ "7.4", "8.0", "8.1", "8.2", "8.3" ] - arch: [ x64, x86 ] - ts: [ ts, nts ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Download DLL and PDB files - uses: dawidd6/action-download-artifact@v3 - with: - workflow: windows-tests.yml - workflow_conclusion: success - commit: ${{ github.sha }} - # Note: keep this in sync with the uploaded artifact name in windows-tests.yml - name: php_mongodb-${{ github.sha }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }} - - - name: Create and attach release archive - run: | - ARCHIVE=php_mongodb-${{ github.ref_name }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }}.zip - zip $ARCHIVE php_mongodb.dll php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES - gh release upload $GITHUB_REF_NAME $ARCHIVE - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml index 843b755cb..569e47ad7 100644 --- a/.github/workflows/windows-tests.yml +++ b/.github/workflows/windows-tests.yml @@ -7,8 +7,6 @@ on: - "master" - "feature/*" push: - tags: - - "*" branches: - "v*.*" - "master" @@ -33,53 +31,28 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 2 submodules: true - - name: Prepare build environment - id: prepare-build - uses: ./.github/workflows/windows/prepare-build + - name: "Build Driver" + id: build-driver + uses: ./.github/workflows/windows/build with: version: ${{ matrix.php }} arch: ${{ matrix.arch }} ts: ${{ matrix.ts }} - - name: Build driver - run: nmake /nologo - - name: Cache build artifacts for subsequent builds id: cache-build-artifacts uses: actions/cache/save@v4 with: key: ${{ github.sha }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }} path: | - ${{ steps.prepare-build.outputs.build-dir }}\php_mongodb.dll - ${{ steps.prepare-build.outputs.build-dir }}\php_mongodb.pdb - - - name: Copy DLL and PDB files to CWD - if: ${{ github.event_name == 'push' }} - run: | - cp .github/workflows/get-build-dir.bat . - for /F "usebackq tokens=*" %%i in (`get-build-dir.bat`) do set BUILD_DIR=%%i - echo BUILD_DIR=%BUILD_DIR% - cp %BUILD_DIR%\php_mongodb.dll . - cp %BUILD_DIR%\php_mongodb.pdb . - - - name: Upload DLL and PDB files as build artifacts - if: ${{ github.event_name == 'push' }} - uses: actions/upload-artifact@v4 - with: - name: php_mongodb-${{ github.sha }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }} - path: | - php_mongodb.dll - php_mongodb.pdb - retention-days: 3 + ${{ steps.build-driver.outputs.build-dir }}\php_mongodb.dll + ${{ steps.build-driver.outputs.build-dir }}\php_mongodb.pdb test: name: "Windows Tests" runs-on: windows-2022 - # Run tests only when pushing to a branch. When pushing a tag, we're only interested in building the DLLs. - if: ${{ github.ref_type == 'branch' }} needs: build defaults: run: @@ -97,7 +70,6 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 2 submodules: true - name: Prepare build environment diff --git a/.github/workflows/windows/build/action.yml b/.github/workflows/windows/build/action.yml new file mode 100644 index 000000000..ec35bf1bc --- /dev/null +++ b/.github/workflows/windows/build/action.yml @@ -0,0 +1,30 @@ +name: "Build DLL files for Windows" +description: "Prepares the PHP build environment for the MongoDB driver" +inputs: + version: + description: "PHP version to build for" + required: true + arch: + description: "The architecture to build for (x64 or x86)" + required: true + ts: + description: "Thread-safety (nts or ts)" + required: true +outputs: + build-dir: + description: "The build directory to be used" + value: ${{ steps.prepare-build-env.outputs.build-dir }} +runs: + using: composite + steps: + - name: Prepare build environment + id: prepare-build-env + uses: ./.github/workflows/windows/prepare-build + with: + version: ${{ inputs.version }} + arch: ${{ inputs.arch }} + ts: ${{ inputs.ts }} + + - name: Build driver + shell: cmd + run: nmake /nologo diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d726a81f..72186ab09 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -293,260 +293,3 @@ $ make libmongocrypt-version-current Package dependencies in `config.m4` must also be updated (either manually or with `scripts/update-submodule-sources.php`), as do the sources in the PECL generation script. - -## Releasing - -The following steps outline the release process for both new minor versions (e.g. -releasing the `master` branch as X.Y.0) and patch versions (e.g. releasing the -`vX.Y` branch as X.Y.Z). - -The command examples below assume that the canonical "mongodb" repository has -the remote name "mongodb". You may need to adjust these commands if you've given -the remote another name (e.g. "upstream"). The "origin" remote name was not used -as it likely refers to your personal fork. - -It helps to keep your own fork in sync with the "mongodb" repository (i.e. any -branches and tags on the main repository should also exist in your fork). This -is left as an exercise to the reader. - -### Transition JIRA issues and version - -All issues associated with the release version should be in the "Closed" state -and have a resolution of "Fixed". Issues with other resolutions (e.g. -"Duplicate", "Works as Designed") should be removed from the release version so -that they do not appear in the release notes. - -Check the corresponding ".x" fix version to see if it contains any issues that -are resolved as "Fixed" and should be included in this release version. - -Update the version's release date and status from the -[Manage Versions](https://jira.mongodb.org/plugins/servlet/project-config/PHPC/versions) -page. - -### Update version info - -The PHP driver uses [semantic versioning](http://semver.org/). Do not break -backwards compatibility in a non-major release or your users will kill you. - -Before proceeding, ensure that the `master` branch is up-to-date with all code -changes in this maintenance branch. This is important because we will later -merge the ensuing release commits up to master with `--strategy=ours`, which -will ignore changes from the merged commits. - -Update the version and stability constants in `phongo_version.h`. This should -entail removing the version's "-dev" suffix, changing the stability to -"stable", and increasing the last digit for `PHP_MONGO_VERSION_DESC`: - -```diff --#define PHP_MONGODB_VERSION "1.1.8-dev" --#define PHP_MONGODB_STABILITY "devel" --#define PHP_MONGODB_VERSION_DESC 1,1,8,0 -+#define PHP_MONGODB_VERSION "1.1.8" -+#define PHP_MONGODB_STABILITY "stable" -+#define PHP_MONGODB_VERSION_DESC 1,1,8,1 -``` - -The Makefile targets for creating the PECL package depend on these constants, so -you must rebuild the extension after updating `phongo_version.h`. - -> **Note:** If this is an alpha or beta release, the version string should -> include the X.Y.Z version followed by the stability and an increment. For -> instance, the first beta release in the 1.4.0 series would be "1.4.0beta1". -> Alpha and beta releases use "alpha" and "beta" stability strings, -> respectively. Release candidates (e.g. "1.4.0RC1") also use "beta" stability. -> See [Documenting release stability and API stability](https://pear.php.net/manual/en/guide.developers.package2.stability.php) -> for more information. For each change to the suffixes of -> `PHP_MONGODB_VERSION`, increment the last digit of -> `PHP_MONGODB_VERSION_DESC`. - -### Build PECL package - -Create the PECL package description file with `make package.xml`. This creates -a `package.xml` file from a template. Version, author, and file information will -be filled in, but release notes must be copied manually from JIRA. - -After copying release notes, use `make package` to create the package file (e.g. -`mongodb-X.Y.Z.tgz`) and ensure that it can be successfully installed: - -``` -$ pecl install -f mongodb-X.Y.Z.tgz -``` - -### Update version info - -Commit the modified `phongo_version.h` file and push this change: - -``` -$ git add phongo_version.h -$ git commit -m "Package X.Y.Z" -$ git push mongodb -``` - -> **Note:** Pushing this commit independently from the subsequent "Back to -dev" -> commit will ensure that Windows build artifacts are created for the release. - -### Ensure Windows build artifacts exist - -Windows builds are tested by GitHub Actions. Each successful build for a pushed -commit will produce a build artifact consisting of DLL and PDB files for that -environment (e.g. 8.0-nts-x64). These build artifacts are later used to create -release assets (see: -[windows-release-build.yml](.github/workflows/windows-release-build.yml)). - -Before publishing a release in GitHub, ensure that all Windows builds for the -tag's commit have succeeded and that the necessary build artifacts have been -created. This can be done by examining the build artifacts in the workflow run -summary for the "Package X.Y.Z" commit (i.e. tag target). - -> **Note:** the "published" event applies to both releases and pre-releases. See -> [Events that trigger workflows: release](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release) -> for more details. - -### Tag the release - -Create a tag for the release and push: - -``` -$ git tag -a -m "Release X.Y.Z" X.Y.Z -$ git push mongodb --tags -``` - -### Release PECL package - -The PECL package may be published via the -[Release Upload](https://pecl.php.net/release-upload.php) form. You will have -one chance to confirm the package information after uploading. - -### Update version info back to dev - -After tagging, the version and stability constants in `phongo_version.h` should -be updated back to development status. - -```diff --#define PHP_MONGODB_VERSION "1.1.8" --#define PHP_MONGODB_STABILITY "stable" --#define PHP_MONGODB_VERSION_DESC 1,1,8,1 -+#define PHP_MONGODB_VERSION "1.1.9-dev" -+#define PHP_MONGODB_STABILITY "devel" -+#define PHP_MONGODB_VERSION_DESC 1,1,9,0 -``` - -Commit and push this change: - -``` -$ git commit -m "Back to -dev" phongo_version.h -$ git push mongodb -``` - -> **Note:** If this is an alpha, beta, or RC release, the version string should -> increment the stability sequence instead of the patch version. For example, -> if the constants were originally "1.4.0-dev" and "devel" and then changed to -> "1.4.0beta1" and "beta" for the first beta release, this step would see them -> ultimately changed to "1.4.0beta2-dev" and "devel". - -### Branch management - -#### After releasing a new minor version - -After a new minor version is released (i.e. `master` was tagged), a maintenance -branch should be created for future patch releases: - -``` -$ git checkout -b vX.Y -$ git push mongodb vX.Y -``` - -Update `phongo_version.h` for the `master` branch: - -```diff --#define PHP_MONGODB_VERSION "1.15.1-dev" -+#define PHP_MONGODB_VERSION "1.16.0-dev" - #define PHP_MONGODB_STABILITY "devel" --#define PHP_MONGODB_VERSION_DESC 1,15,1,0 -+#define PHP_MONGODB_VERSION_DESC 1,16,0,0 -``` - -Commit and push this change: - -``` -$ git commit -m "Master is now X.Y-dev" phongo_version.h -$ git push mongodb -``` - -#### After releasing a patch version - -If this was a patch release, the maintenance branch must be merged up to master: - -``` -$ git checkout master -$ git pull mongodb master -$ git merge vX.Y --strategy=ours -$ git push mongodb -``` - -The `--strategy=ours` option ensures that all changes from the merged commits -will be ignored. This is OK because we previously ensured that the `master` -branch was up-to-date with all code changes in this maintenance branch before -tagging. - -### Publish release notes - -The following template should be used for creating GitHub release notes via -[this form](https://github.com/mongodb/mongo-php-driver/releases/new). The PECL -package may also be attached to the release notes. - -```markdown -The PHP team is happy to announce that version X.Y.Z of the [mongodb](https://pecl.php.net/package/mongodb) PHP extension is now available on PECL. - -**Release Highlights** - - - -A complete list of resolved issues in this release may be found in [JIRA]($JIRA_URL). - -**Documentation** - -Documentation is available on [PHP.net](https://php.net/set.mongodb). - -**Installation** - -You can either download and install the source manually, or you can install the extension with: - - pecl install mongodb-X.Y.Z - -or update with: - - pecl upgrade mongodb-X.Y.Z - -Windows binaries are attached to the GitHub release notes. -``` - -> **Note:** If this is an alpha or beta release, the installation examples -> should refer to the exact version (e.g. "mongodb-1.8.0beta2"). This is necessary -> because PECL prioritizes recent, stable releases over any stability preferences -> (e.g. "mongodb-beta"). - -The URL for the list of resolved JIRA issues will need to be updated with each -release. You may obtain the list from -[this form](https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12484). - -If commits from community contributors were included in this release, append the -following section: - -```markdown -**Thanks** - -Thanks for our community contributors for X.Y.Z: - - * [$CONTRIBUTOR_NAME](https://github.com/$GITHUB_USERNAME) -``` - -Significant release announcements should also be posted in the -[MongoDB Product & Driver Announcements: Driver Releases](https://www.mongodb.com/community/forums/tags/c/announcements/driver-releases/110/php) forum. - -### Update compatibility tables in MongoDB docs - -For minor releases, create a DOCSP ticket indicating whether there are changes to MongoDB Server or PHP version -compatibility. The [compatibility tables](https://docs.mongodb.com/drivers/driver-compatibility-reference#php-driver-compatibility) -in the MongoDB documentation must be updated to account for new releases. Make sure to update both MongoDB and Language -compatibility tables, as shown in [this pull request](https://github.com/mongodb/docs-ecosystem/pull/642). diff --git a/Makefile.frag b/Makefile.frag index 4800ffe6b..9b181b4a0 100644 --- a/Makefile.frag +++ b/Makefile.frag @@ -20,6 +20,8 @@ help: @echo "" @echo -e "\t$$ make package.xml" @echo -e "\t - Creates a package.xml file with empty release notes" + @echo -e "\t$$ make package.xml RELEASE_NOTES_FILE=changelog" + @echo -e "\t - Creates a package.xml file with release notes read from the indicated file" @echo -e "\t$$ make package" @echo -e "\t - Creates the pecl archive to use for provisioning" @@ -59,7 +61,7 @@ package: pecl package package.xml package.xml: - php bin/prep-release.php $(MONGODB_VERSION) $(MONGODB_STABILITY) + php bin/prep-release.php $(MONGODB_VERSION) $(MONGODB_STABILITY) $(RELEASE_NOTES_FILE) libmongoc-version-current: cd src/libmongoc/ && python build/calc_release_version.py > ../LIBMONGOC_VERSION_CURRENT diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 000000000..14db48599 --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,254 @@ +# Releasing + +## Branch management + +When releasing a new minor version of the driver (i.e. `X.Y.0`), create a new +maintenance branch named `vX.Y` from the default branch. Then, update the +version information in the default branch to the next minor release: + +```shell +$ ./bin/update-release-version.php to-next-minor-dev +``` + +Commit and push the resulting changes: + +```shell +$ git commit -m "Master is now X.Y-dev" phongo_version.h +$ git push mongodb +``` + +Before starting the release process, make sure that all open merge-up pull +requests containing changes from the release branch have been merged. Handling +the merge conflicts resulting from the version updates will be much more +difficult if other changes need merging. + +## Transition JIRA issues and version + +All issues associated with the release version should be in the "Closed" state +and have a resolution of "Fixed". Issues with other resolutions (e.g. +"Duplicate", "Works as Designed") should be removed from the release version so +that they do not appear in the release notes. + +Check the corresponding ".x" fix version to see if it contains any issues that +are resolved as "Fixed" and should be included in this release version. + +Update the version's release date and status from the +[Manage Versions](https://jira.mongodb.org/plugins/servlet/project-config/PHPC/versions) +page. + +## Trigger the release workflow + +Releases are done automatically through a GitHub Action. Visit the corresponding +[Release New Version](https://github.com/mongodb/mongo-php-driver/actions/workflows/release.yml) +workflow page to trigger a new build. Select the correct branch (e.g. `v1.18`) +and trigger a new run using the "Run workflow" button. In the following prompt, +enter the version number and the corresponding JIRA version ID for the release. +This version ID can be obtained from a link in the "Version" column on the +[PHPC releases page](https://jira.mongodb.org/projects/PHPC?selectedItem=com.atlassian.jira.jira-projects-plugin%3Arelease-page&status=unreleased). + +The automation will then create and push the necessary commits and tag, create a +draft release, and trigger the packaging builds for the newly created tag. The +release is created in a draft state and can be published once the release notes +have been updated. + +Alternatively, you may follow the [manual release process](#manual-release-process) +before continuing with the next section. + +## Upload package to PECL + +Once the packaging workflow has finished creating the PECL package, it will be +published as a build artifact of the package workflow, as well as a release +asset in the draft release. This package may be published via the +[Release Upload](https://pecl.php.net/release-upload.php) form. You will have one chance to confirm the package +information after uploading. + +> [!NOTE] +> If downloading the package from the build artifacts, be aware that these are +> always provided as zip files. You'll have to unpack the tgz archive prior to +> uploading it to PECL. This is not the case when downloading the release asset. + +## Update compatibility tables in MongoDB docs + +For minor releases, create a DOCSP ticket indicating whether there are changes +to MongoDB Server or PHP version compatibility. The [compatibility tables](https://docs.mongodb.com/drivers/driver-compatibility-reference#php-driver-compatibility) +in the MongoDB documentation must be updated to account for new releases. Make +sure to update both MongoDB and Language compatibility tables, as shown in +[this pull request](https://github.com/mongodb/docs-ecosystem/pull/642). + +## Handle merge-up pull request + +After the release automation pushes changes to the stable branch the release was +created from, the merge automation will create a new pull request to merge these +changes into the next versioned branch. Since version changes always create a +conflict, follow the "Ignoring Changes" section in the pull request to resolve +the conflicts and merge the pull request once the build completes. + +## Announce release + +Significant release announcements should also be posted in the +[MongoDB Product & Driver Announcements: Driver Releases](https://www.mongodb.com/community/forums/tags/c/announcements/driver-releases/110/php) forum. + +## Manual release process + +The following steps outline the manual release process. These are preserved +for historical reasons and releases that are currently not supported by the +release automation (e.g. beta releases). These steps are meant to be run instead +of [triggering the release workflow](#trigger-the-release-workflow). The +instructions assume that the steps preceding the release workflow have been +completed successfully. + +The command examples below assume that the canonical "mongodb" repository has +the remote name "mongodb". You may need to adjust these commands if you've given +the remote another name (e.g. "upstream"). The "origin" remote name was not used +as it likely refers to your personal fork. + +It helps to keep your own fork in sync with the "mongodb" repository (i.e. any +branches and tags on the main repository should also exist in your fork). This +is left as an exercise to the reader. + +### Update version info + +The PHP driver uses [semantic versioning](http://semver.org/). Do not break +backwards compatibility in a non-major release or your users will kill you. + +Before proceeding, ensure that the `master` branch is up-to-date with all code +changes in this maintenance branch. This is important because we will later +merge the ensuing release commits up to master with `--strategy=ours`, which +will ignore changes from the merged commits. + +Update the version and stability constants in `phongo_version.h` for the stable +release: + +```shell +$ ./bin/update-release-version.php to-stable +``` + +The Makefile targets for creating the PECL package depend on these constants, so +you must rebuild the extension after updating `phongo_version.h`. + +> [!NOTE] +> If this is an alpha or beta release, the version string should include the +> X.Y.Z version followed by the stability and an increment. For instance, the +> first beta release in the 1.4.0 series would be "1.4.0beta1". Alpha and beta +> releases use "alpha" and "beta" stability strings, respectively. Release +> candidates (e.g. "1.4.0RC1") also use "beta" stability. See +> [Documenting release stability and API stability](https://pear.php.net/manual/en/guide.developers.package2.stability.php) +> for more information. For each change to the suffixes of +> `PHP_MONGODB_VERSION`, increment the last digit of +> `PHP_MONGODB_VERSION_DESC`. + +### Build PECL package + +Create the PECL package description file with `make package.xml`. This creates +a `package.xml` file from a template. Version, author, and file information will +be filled in, but release notes must be copied manually from JIRA. + +After copying release notes, use `make package` to create the package file (e.g. +`mongodb-X.Y.Z.tgz`) and ensure that it can be successfully installed: + +``` +$ pecl install -f mongodb-X.Y.Z.tgz +``` + +### Update version info + +Commit the modified `phongo_version.h` file and push this change: + +``` +$ git commit -m "Package X.Y.Z" phongo_version.h +$ git push mongodb +``` + +### Tag the release + +Create a tag for the release and push: + +``` +$ git tag -a -m "Release X.Y.Z" X.Y.Z +$ git push mongodb --tags +``` + +Pushing the new tag will start the packaging process which provides the PECL +and Windows packages that should be attached to the release. + +### Release PECL package + +The PECL package may be published via the +[Release Upload](https://pecl.php.net/release-upload.php) form. You will have +one chance to confirm the package information after uploading. + +### Update version info back to dev + +After tagging, the version and stability constants in `phongo_version.h` should +be updated back to development status: + +```shell +$ ./bin/update-release-version.php to-next-patch-dev +``` + +Commit and push this change: + +``` +$ git commit -m "Back to -dev" phongo_version.h +$ git push mongodb +``` + +> [!NOTE] +> If this is an alpha, beta, or RC release, the version string should increment +> the stability sequence instead of the patch version. For example, if the +> constants were originally "1.4.0-dev" and "devel" and then changed to +> "1.4.0beta1" and "beta" for the first beta release, this step would see them +> ultimately changed to "1.4.0beta2-dev" and "devel". + +### Publish release notes + +The following template should be used for creating GitHub release notes via +[this form](https://github.com/mongodb/mongo-php-driver/releases/new). The PECL +package may also be attached to the release notes. + +```markdown +The PHP team is happy to announce that version X.Y.Z of the [mongodb](https://pecl.php.net/package/mongodb) PHP extension is now available on PECL. + +**Release Highlights** + + + +A complete list of resolved issues in this release may be found in [JIRA]($JIRA_URL). + +**Documentation** + +Documentation is available on [PHP.net](https://php.net/set.mongodb). + +**Installation** + +You can either download and install the source manually, or you can install the extension with: + + pecl install mongodb-X.Y.Z + +or update with: + + pecl upgrade mongodb-X.Y.Z + +Windows binaries are attached to the GitHub release notes. +``` + +> [!NOTE] +> If this is an alpha or beta release, the installation examples should refer to +> the exact version (e.g. "mongodb-1.8.0beta2"). This is necessary because PECL +> prioritizes recent, stable releases over any stability preferences +> (e.g. "mongodb-beta"). + +The URL for the list of resolved JIRA issues will need to be updated with each +release. You may obtain the list from +[this form](https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=12484). + +If commits from community contributors were included in this release, append the +following section: + +```markdown +**Thanks** + +Thanks for our community contributors for X.Y.Z: + +* [$CONTRIBUTOR_NAME](https://github.com/$GITHUB_USERNAME) +``` diff --git a/bin/package.xml.in b/bin/package.xml.in index 11b00fed8..87afd2a01 100644 --- a/bin/package.xml.in +++ b/bin/package.xml.in @@ -50,7 +50,7 @@ necessary to build a fully-functional MongoDB driver. Apache License - +%RELEASE_NOTES% %RELEASE_FILES% diff --git a/bin/prep-release.php b/bin/prep-release.php index 3bbe2cd56..93df6724c 100644 --- a/bin/prep-release.php +++ b/bin/prep-release.php @@ -151,17 +151,18 @@ function usage() { global $argv; echo "Usage:\n\t"; - echo $argv[0], " \n"; + echo $argv[0], " []\n"; exit(1); } -if ($argc != 3) { +if ($argc != 3 && $argc != 4) { usage(); } $VERSION = $argv[1]; $STABILITY = $argv[2]; +$RELEASE_NOTES_FILE = $argv[3] ?? null; /* 0.x.y. are developmental releases and cannot be stable */ if ((int)$VERSION < 1) { @@ -190,6 +191,7 @@ function usage() { "%RELEASE_VERSION%" => $VERSION, "%RELEASE_STABILITY%" => $STABILITY, "%RELEASE_FILES%" => join("\n", $TREE), + "%RELEASE_NOTES%" => is_string($RELEASE_NOTES_FILE) && file_exists($RELEASE_NOTES_FILE) ? file_get_contents($RELEASE_NOTES_FILE) : '', ); $contents = str_replace(array_keys($REPLACE), array_values($REPLACE), $contents); diff --git a/bin/update-release-version.php b/bin/update-release-version.php new file mode 100755 index 000000000..f6d1adfba --- /dev/null +++ b/bin/update-release-version.php @@ -0,0 +1,173 @@ +#!/usr/bin/env php + + +Commands: + to-stable: Mark the current version as stable + to-next-patch-dev: Update to the next patch development version + to-next-minor-dev: Update to the next minor development version + get-version: Print the current version number + +EOT; + + exit(1); +} + +function read_release_version(string $filename): array +{ + if (! is_file($filename)) { + throw new Exception(sprintf('File not found: "%s"', $filename)); + } + + $contents = file_get_contents($filename); + + $versions = []; + + if (! preg_match('/^#define PHP_MONGODB_VERSION "(.*)"$/m', $contents, $matches)) { + throw new Exception('Could not match PHP_MONGODB_VERSION'); + } + $versions['version'] = $matches[1]; + + if (! preg_match('/^#define PHP_MONGODB_STABILITY "(.*)"$/m', $contents, $matches)) { + throw new Exception('Could not match PHP_MONGODB_STABILITY'); + } + $versions['stability'] = $matches[1]; + + if (! preg_match('/^#define PHP_MONGODB_VERSION_DESC (\d+),(\d+),(\d+),(\d+)$/m', $contents, $matches)) { + throw new Exception('Could not match PHP_MONGODB_VERSION_DESC'); + } + $versions['versionComponents'] = array_slice($matches, 1); + + return $versions; +} + +function write_release_version(string $filename, array $version): void +{ + if (! is_file($filename)) { + throw new Exception(sprintf('File not found: "%s"', $filename)); + } + + $contents = file_get_contents($filename); + + $patterns = [ + '/^#define PHP_MONGODB_VERSION "(.*)"$/m', + '/^#define PHP_MONGODB_STABILITY "(.*)"$/m', + '/^#define PHP_MONGODB_VERSION_DESC (\d+),(\d+),(\d+),(\d+)$/m', + ]; + + $replacements = [ + sprintf('#define PHP_MONGODB_VERSION "%s"', $version['version']), + sprintf('#define PHP_MONGODB_STABILITY "%s"', $version['stability']), + sprintf('#define PHP_MONGODB_VERSION_DESC %s,%s,%s,%s', ...$version['versionComponents']), + ]; + + $contents = preg_replace($patterns, $replacements, $contents, -1, $count); + if ($count !== 3) { + throw new Exception('Could not properly replace contents in file'); + } + + file_put_contents($filename, $contents); +} + +function get_version_string_from_components(array $versionComponents): string +{ + return implode('.', array_slice($versionComponents, 0, 3)); +} + +function get_stable_version(array $versions): array +{ + if (! preg_match('/^(\d+\.\d+\.\d+)/', $versions['version'], $matches)) { + throw new Exception(sprintf('Version "%s" is not in the expected format', $versions['version'])); + } + + $version = $matches[1]; + + $expectedVersionString = get_version_string_from_components($versions['versionComponents']); + + if ($expectedVersionString !== $version) { + throw new Exception(sprintf('Version "%s" does not match version from components ("%s")', $version, $expectedVersionString)); + } + + $newVersions = [ + 'version' => $version, + 'stability' => 'stable', + 'versionComponents' => $versions['versionComponents'], + ]; + + // Increase build number + $newVersions['versionComponents'][3]++; + + return $newVersions; +} + +function get_next_patch_version(array $versions): array +{ + $versionComponents = $versions['versionComponents']; + + // Increase patch version, set build number to 0 + $versionComponents[2] += 1; + $versionComponents[3] = 0; + + return [ + 'version' => get_version_string_from_components($versionComponents) . 'dev', + 'stability' => 'devel', + 'versionComponents' => $versionComponents, + ]; +} + +function get_next_minor_version(array $versions): array +{ + $versionComponents = $versions['versionComponents']; + + // Increase minor version, set patch and build number to 0 + $versionComponents[1] += 1; + $versionComponents[2] = 0; + $versionComponents[3] = 0; + + return [ + 'version' => get_version_string_from_components($versionComponents) . 'dev', + 'stability' => 'devel', + 'versionComponents' => $versionComponents, + ]; +} + +if ($argc !== 2) { + usage(); +} + +$currentVersion = read_release_version(VERSION_FILENAME); + +switch ($argv[1] ?? null) { + case 'get-version': + echo $currentVersion['version']; + exit(0); + + case 'to-stable': + $newVersion = get_stable_version($currentVersion); + break; + + case 'to-next-patch-dev': + $newVersion = get_next_patch_version($currentVersion); + break; + + case 'to-next-minor-dev': + $newVersion = get_next_minor_version($currentVersion); + break; + + default: + usage(); +} + +write_release_version(VERSION_FILENAME, $newVersion); + +printf("Updated version number in version file from %s to %s\n", $currentVersion['version'], $newVersion['version']); + diff --git a/phongo_version.h b/phongo_version.h index 277aec328..6f19ddc67 100644 --- a/phongo_version.h +++ b/phongo_version.h @@ -22,7 +22,7 @@ * publishing a release. */ /* clang-format off */ -#define PHP_MONGODB_VERSION "1.18.2-dev" +#define PHP_MONGODB_VERSION "1.18.2dev" #define PHP_MONGODB_STABILITY "devel" #define PHP_MONGODB_VERSION_DESC 1,18,2,0 /* clang-format on */ From 49c520fbfa73beb6ba61a5ba58b48882ac4eb7a9 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 7 May 2024 10:37:11 -0400 Subject: [PATCH 05/11] PHPC-2373 and PHPC-2374: Upgrade libmongoc 1.27.0 and libmongocrypt 1.10.0 (#1540) * PHPC-2373: Update libmongoc to 1.27.0 config.w32 requires an additional include path ("./src/libmongoc/src/libmongoc/src/mongoc") due to usage of angle bracket includes in mcd-nsinfo.c and utlist.h. * PHPC-2374: Update libmongocrypt to 1.10.0 --- .../config/generated/build/build-libmongoc-8.3.yml | 4 ++-- .evergreen/config/templates/build/build-libmongoc.yml | 4 ++-- config.m4 | 11 ++++++----- config.w32 | 4 +++- src/LIBMONGOCRYPT_VERSION_CURRENT | 2 +- src/LIBMONGOC_VERSION_CURRENT | 2 +- src/libmongoc | 2 +- src/libmongocrypt | 2 +- 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.evergreen/config/generated/build/build-libmongoc-8.3.yml b/.evergreen/config/generated/build/build-libmongoc-8.3.yml index b1d695baf..d5a174930 100644 --- a/.evergreen/config/generated/build/build-libmongoc-8.3.yml +++ b/.evergreen/config/generated/build/build-libmongoc-8.3.yml @@ -12,7 +12,7 @@ tasks: - func: "compile driver" vars: PHP_VERSION: "8.3" - LIBMONGOC_VERSION: "1.26.2" + LIBMONGOC_VERSION: "1.27.0" - func: "upload build" - name: "build-php-8.3-libmongoc-next-stable" @@ -21,7 +21,7 @@ tasks: - func: "compile driver" vars: PHP_VERSION: "8.3" - LIBMONGOC_VERSION: "r1.26" + LIBMONGOC_VERSION: "r1.27" - func: "upload build" - name: "build-php-8.3-libmongoc-latest" diff --git a/.evergreen/config/templates/build/build-libmongoc.yml b/.evergreen/config/templates/build/build-libmongoc.yml index e7e7b1831..4e36c8815 100644 --- a/.evergreen/config/templates/build/build-libmongoc.yml +++ b/.evergreen/config/templates/build/build-libmongoc.yml @@ -11,7 +11,7 @@ tasks: - func: "compile driver" vars: PHP_VERSION: "%phpVersion%" - LIBMONGOC_VERSION: "1.26.2" + LIBMONGOC_VERSION: "1.27.0" - func: "upload build" - name: "build-php-%phpVersion%-libmongoc-next-stable" @@ -20,7 +20,7 @@ tasks: - func: "compile driver" vars: PHP_VERSION: "%phpVersion%" - LIBMONGOC_VERSION: "r1.26" + LIBMONGOC_VERSION: "r1.27" - func: "upload build" - name: "build-php-%phpVersion%-libmongoc-latest" diff --git a/config.m4 b/config.m4 index 8ce37947c..ea86476eb 100644 --- a/config.m4 +++ b/config.m4 @@ -270,7 +270,7 @@ if test "$PHP_MONGODB" != "no"; then PHP_MONGODB_MONGOCRYPT_VERSION_STRING="None" if test "$PHP_MONGODB_SYSTEM_LIBS" != "no"; then - PKG_CHECK_MODULES([PHP_MONGODB_BSON], [libbson-1.0 >= 1.26.2], [ + PKG_CHECK_MODULES([PHP_MONGODB_BSON], [libbson-1.0 >= 1.27.0], [ PHP_MONGODB_BSON_VERSION=`$PKG_CONFIG libbson-1.0 --modversion` PHP_MONGODB_BSON_VERSION_STRING="System ($PHP_MONGODB_BSON_VERSION)" @@ -278,10 +278,10 @@ if test "$PHP_MONGODB" != "no"; then PHP_EVAL_LIBLINE($PHP_MONGODB_BSON_LIBS, MONGODB_SHARED_LIBADD) AC_DEFINE(HAVE_SYSTEM_LIBBSON, 1, [Use system libbson]) ],[ - AC_MSG_ERROR([Could not find system library for libbson >= 1.26.2]) + AC_MSG_ERROR([Could not find system library for libbson >= 1.27.0]) ]) - PKG_CHECK_MODULES([PHP_MONGODB_MONGOC], [libmongoc-1.0 >= 1.26.2], [ + PKG_CHECK_MODULES([PHP_MONGODB_MONGOC], [libmongoc-1.0 >= 1.27.0], [ PHP_MONGODB_BSON_VERSION=`$PKG_CONFIG libbson-1.0 --modversion` PHP_MONGODB_BSON_VERSION_STRING="System ($PHP_MONGODB_BSON_VERSION)" @@ -289,7 +289,7 @@ if test "$PHP_MONGODB" != "no"; then PHP_EVAL_LIBLINE($PHP_MONGODB_MONGOC_LIBS, MONGODB_SHARED_LIBADD) AC_DEFINE(HAVE_SYSTEM_LIBMONGOC, 1, [Use system libmongoc]) ],[ - AC_MSG_ERROR(Could not find system library for libmongoc >= 1.26.2) + AC_MSG_ERROR(Could not find system library for libmongoc >= 1.27.0) ]) if test "$PHP_MONGODB_CLIENT_SIDE_ENCRYPTION" != "no"; then @@ -387,7 +387,7 @@ if test "$PHP_MONGODB" != "no"; then PHP_MONGODB_KMS_MESSAGE_SOURCES="hexlify.c kms_azure_request.c kms_b64.c kms_caller_identity_request.c kms_crypto_apple.c kms_crypto_libcrypto.c kms_crypto_none.c kms_crypto_windows.c kms_decrypt_request.c kms_encrypt_request.c kms_gcp_request.c kms_kmip_reader_writer.c kms_kmip_request.c kms_kmip_response.c kms_kmip_response_parser.c kms_kv_list.c kms_message.c kms_port.c kms_request.c kms_request_opt.c kms_request_str.c kms_response.c kms_response_parser.c sort.c" PHP_MONGODB_BSON_SOURCES="bcon.c bson-atomic.c bson.c bson-clock.c bson-context.c bson-decimal128.c bson-error.c bson-iso8601.c bson-iter.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version-functions.c bson-writer.c" PHP_MONGODB_JSONSL_SOURCES="jsonsl.c" - PHP_MONGODB_MONGOC_SOURCES="mcd-azure.c mcd-rpc.c mongoc-aggregate.c mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-change-stream.c mongoc-client.c mongoc-client-pool.c mongoc-client-session.c mongoc-client-side-encryption.c mongoc-cluster-aws.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.c mongoc-crypt.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-change-stream.c mongoc-cursor-cmd.c mongoc-cursor-cmd-deprecated.c mongoc-cursor-find.c mongoc-cursor-find-cmd.c mongoc-cursor-find-opquery.c mongoc-cursor-legacy.c mongoc-cyrus.c mongoc-database.c mongoc-deprioritized-servers.c mongoc-error.c mongoc-find-and-modify.c mongoc-flags.c mongoc-generation-map.c mongoc-gridfs-bucket.c mongoc-gridfs-bucket-file.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-http.c mongoc-index.c mongoc-init.c mongoc-interrupt.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-ocsp-cache.c mongoc-opcode.c mongoc-openssl.c mongoc-optional.c mongoc-opts.c mongoc-opts-helpers.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-api.c mongoc-server-description.c mongoc-server-monitor.c mongoc-server-stream.c mongoc-set.c mongoc-shared.c mongoc-socket.c mongoc-ssl.c mongoc-sspi.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-gridfs-download.c mongoc-stream-gridfs-upload.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-timeout.c mongoc-topology-background-monitoring.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-ts-pool.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-concern.c service-gcp.c" + PHP_MONGODB_MONGOC_SOURCES="mcd-azure.c mcd-nsinfo.c mcd-rpc.c mongoc-aggregate.c mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-change-stream.c mongoc-client.c mongoc-client-pool.c mongoc-client-session.c mongoc-client-side-encryption.c mongoc-cluster-aws.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.c mongoc-crypt.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-change-stream.c mongoc-cursor-cmd.c mongoc-cursor-cmd-deprecated.c mongoc-cursor-find.c mongoc-cursor-find-cmd.c mongoc-cursor-find-opquery.c mongoc-cursor-legacy.c mongoc-cyrus.c mongoc-database.c mongoc-deprioritized-servers.c mongoc-error.c mongoc-find-and-modify.c mongoc-flags.c mongoc-generation-map.c mongoc-gridfs-bucket.c mongoc-gridfs-bucket-file.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-http.c mongoc-index.c mongoc-init.c mongoc-interrupt.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-ocsp-cache.c mongoc-opcode.c mongoc-openssl.c mongoc-optional.c mongoc-opts.c mongoc-opts-helpers.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-api.c mongoc-server-description.c mongoc-server-monitor.c mongoc-server-stream.c mongoc-set.c mongoc-shared.c mongoc-socket.c mongoc-ssl.c mongoc-sspi.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-gridfs-download.c mongoc-stream-gridfs-upload.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-timeout.c mongoc-topology-background-monitoring.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-ts-pool.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-concern.c service-gcp.c" PHP_MONGODB_UTF8PROC_SOURCES="utf8proc.c" PHP_MONGODB_ZLIB_SOURCES="adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c" @@ -397,6 +397,7 @@ if test "$PHP_MONGODB" != "no"; then PHP_MONGODB_ADD_SOURCES([src/libmongoc/src/libmongoc/src/mongoc/], $PHP_MONGODB_MONGOC_SOURCES, $PHP_MONGODB_BUNDLED_CFLAGS) PHP_MONGODB_ADD_INCLUDE([src/libmongoc/src/common/]) + PHP_MONGODB_ADD_INCLUDE([src/libmongoc/src/uthash/]) PHP_MONGODB_ADD_INCLUDE([src/libmongoc/src/libbson/src/]) PHP_MONGODB_ADD_INCLUDE([src/libmongoc/src/libbson/src/jsonsl/]) PHP_MONGODB_ADD_INCLUDE([src/libmongoc/src/libmongoc/src/]) diff --git a/config.w32 b/config.w32 index e0ce9da60..bb46052fc 100644 --- a/config.w32 +++ b/config.w32 @@ -103,9 +103,11 @@ if (PHP_MONGODB != "no") { /I" + configure_module_dirname + "/src/MongoDB/Monitoring \ /I" + configure_module_dirname + "/src/contrib \ /I" + configure_module_dirname + "/src/libmongoc/src/common \ + /I" + configure_module_dirname + "/src/libmongoc/src/uthash \ /I" + configure_module_dirname + "/src/libmongoc/src/libbson/src \ /I" + configure_module_dirname + "/src/libmongoc/src/libbson/src/jsonsl \ /I" + configure_module_dirname + "/src/libmongoc/src/libmongoc/src \ + /I" + configure_module_dirname + "/src/libmongoc/src/libmongoc/src/mongoc \ /I" + configure_module_dirname + "/src/libmongoc/src/utf8proc-2.8.0 \ "; @@ -117,7 +119,7 @@ if (PHP_MONGODB != "no") { var PHP_MONGODB_KMS_MESSAGE_SOURCES="hexlify.c kms_azure_request.c kms_b64.c kms_caller_identity_request.c kms_crypto_apple.c kms_crypto_libcrypto.c kms_crypto_none.c kms_crypto_windows.c kms_decrypt_request.c kms_encrypt_request.c kms_gcp_request.c kms_kmip_reader_writer.c kms_kmip_request.c kms_kmip_response.c kms_kmip_response_parser.c kms_kv_list.c kms_message.c kms_port.c kms_request.c kms_request_opt.c kms_request_str.c kms_response.c kms_response_parser.c sort.c"; var PHP_MONGODB_BSON_SOURCES="bcon.c bson-atomic.c bson.c bson-clock.c bson-context.c bson-decimal128.c bson-error.c bson-iso8601.c bson-iter.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version-functions.c bson-writer.c"; var PHP_MONGODB_JSONSL_SOURCES="jsonsl.c"; - var PHP_MONGODB_MONGOC_SOURCES="mcd-azure.c mcd-rpc.c mongoc-aggregate.c mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-change-stream.c mongoc-client.c mongoc-client-pool.c mongoc-client-session.c mongoc-client-side-encryption.c mongoc-cluster-aws.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.c mongoc-crypt.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-change-stream.c mongoc-cursor-cmd.c mongoc-cursor-cmd-deprecated.c mongoc-cursor-find.c mongoc-cursor-find-cmd.c mongoc-cursor-find-opquery.c mongoc-cursor-legacy.c mongoc-cyrus.c mongoc-database.c mongoc-deprioritized-servers.c mongoc-error.c mongoc-find-and-modify.c mongoc-flags.c mongoc-generation-map.c mongoc-gridfs-bucket.c mongoc-gridfs-bucket-file.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-http.c mongoc-index.c mongoc-init.c mongoc-interrupt.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-ocsp-cache.c mongoc-opcode.c mongoc-openssl.c mongoc-optional.c mongoc-opts.c mongoc-opts-helpers.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-api.c mongoc-server-description.c mongoc-server-monitor.c mongoc-server-stream.c mongoc-set.c mongoc-shared.c mongoc-socket.c mongoc-ssl.c mongoc-sspi.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-gridfs-download.c mongoc-stream-gridfs-upload.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-timeout.c mongoc-topology-background-monitoring.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-ts-pool.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-concern.c service-gcp.c"; + var PHP_MONGODB_MONGOC_SOURCES="mcd-azure.c mcd-nsinfo.c mcd-rpc.c mongoc-aggregate.c mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-change-stream.c mongoc-client.c mongoc-client-pool.c mongoc-client-session.c mongoc-client-side-encryption.c mongoc-cluster-aws.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.c mongoc-crypt.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-change-stream.c mongoc-cursor-cmd.c mongoc-cursor-cmd-deprecated.c mongoc-cursor-find.c mongoc-cursor-find-cmd.c mongoc-cursor-find-opquery.c mongoc-cursor-legacy.c mongoc-cyrus.c mongoc-database.c mongoc-deprioritized-servers.c mongoc-error.c mongoc-find-and-modify.c mongoc-flags.c mongoc-generation-map.c mongoc-gridfs-bucket.c mongoc-gridfs-bucket-file.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-http.c mongoc-index.c mongoc-init.c mongoc-interrupt.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-ocsp-cache.c mongoc-opcode.c mongoc-openssl.c mongoc-optional.c mongoc-opts.c mongoc-opts-helpers.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-api.c mongoc-server-description.c mongoc-server-monitor.c mongoc-server-stream.c mongoc-set.c mongoc-shared.c mongoc-socket.c mongoc-ssl.c mongoc-sspi.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-gridfs-download.c mongoc-stream-gridfs-upload.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-timeout.c mongoc-topology-background-monitoring.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-ts-pool.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-concern.c service-gcp.c"; var PHP_MONGODB_UTF8PROC_SOURCES="utf8proc.c"; EXTENSION("mongodb", "php_phongo.c", null, PHP_MONGODB_CFLAGS); diff --git a/src/LIBMONGOCRYPT_VERSION_CURRENT b/src/LIBMONGOCRYPT_VERSION_CURRENT index 9ab8337f3..81c871de4 100644 --- a/src/LIBMONGOCRYPT_VERSION_CURRENT +++ b/src/LIBMONGOCRYPT_VERSION_CURRENT @@ -1 +1 @@ -1.9.1 +1.10.0 diff --git a/src/LIBMONGOC_VERSION_CURRENT b/src/LIBMONGOC_VERSION_CURRENT index c7c3f3333..5db08bf2d 100644 --- a/src/LIBMONGOC_VERSION_CURRENT +++ b/src/LIBMONGOC_VERSION_CURRENT @@ -1 +1 @@ -1.26.2 +1.27.0 diff --git a/src/libmongoc b/src/libmongoc index 586171d66..dfd3aece9 160000 --- a/src/libmongoc +++ b/src/libmongoc @@ -1 +1 @@ -Subproject commit 586171d661f584d841bdc32fc998e9f6cf903228 +Subproject commit dfd3aece9e46ffcfac3e41cc147036872757c2c2 diff --git a/src/libmongocrypt b/src/libmongocrypt index 475deb754..940cdb252 160000 --- a/src/libmongocrypt +++ b/src/libmongocrypt @@ -1 +1 @@ -Subproject commit 475deb7544381fb0b8f361e8c80948c8d67cc4cd +Subproject commit 940cdb252c3c21ab15984a070ddca70806d4c63f From d66f63b3460e2185f47034ac55e878b1161d528b Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 7 May 2024 13:12:50 -0400 Subject: [PATCH 06/11] PHPC-2378: Update libmongoc to 1.27.1 (#1545) --- .evergreen/config/generated/build/build-libmongoc-8.3.yml | 2 +- .evergreen/config/templates/build/build-libmongoc.yml | 2 +- config.m4 | 8 ++++---- src/libmongoc | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.evergreen/config/generated/build/build-libmongoc-8.3.yml b/.evergreen/config/generated/build/build-libmongoc-8.3.yml index d5a174930..ac086f248 100644 --- a/.evergreen/config/generated/build/build-libmongoc-8.3.yml +++ b/.evergreen/config/generated/build/build-libmongoc-8.3.yml @@ -12,7 +12,7 @@ tasks: - func: "compile driver" vars: PHP_VERSION: "8.3" - LIBMONGOC_VERSION: "1.27.0" + LIBMONGOC_VERSION: "1.27.1" - func: "upload build" - name: "build-php-8.3-libmongoc-next-stable" diff --git a/.evergreen/config/templates/build/build-libmongoc.yml b/.evergreen/config/templates/build/build-libmongoc.yml index 4e36c8815..1db85c3f7 100644 --- a/.evergreen/config/templates/build/build-libmongoc.yml +++ b/.evergreen/config/templates/build/build-libmongoc.yml @@ -11,7 +11,7 @@ tasks: - func: "compile driver" vars: PHP_VERSION: "%phpVersion%" - LIBMONGOC_VERSION: "1.27.0" + LIBMONGOC_VERSION: "1.27.1" - func: "upload build" - name: "build-php-%phpVersion%-libmongoc-next-stable" diff --git a/config.m4 b/config.m4 index ea86476eb..c5ddc7dc7 100644 --- a/config.m4 +++ b/config.m4 @@ -270,7 +270,7 @@ if test "$PHP_MONGODB" != "no"; then PHP_MONGODB_MONGOCRYPT_VERSION_STRING="None" if test "$PHP_MONGODB_SYSTEM_LIBS" != "no"; then - PKG_CHECK_MODULES([PHP_MONGODB_BSON], [libbson-1.0 >= 1.27.0], [ + PKG_CHECK_MODULES([PHP_MONGODB_BSON], [libbson-1.0 >= 1.27.1], [ PHP_MONGODB_BSON_VERSION=`$PKG_CONFIG libbson-1.0 --modversion` PHP_MONGODB_BSON_VERSION_STRING="System ($PHP_MONGODB_BSON_VERSION)" @@ -278,10 +278,10 @@ if test "$PHP_MONGODB" != "no"; then PHP_EVAL_LIBLINE($PHP_MONGODB_BSON_LIBS, MONGODB_SHARED_LIBADD) AC_DEFINE(HAVE_SYSTEM_LIBBSON, 1, [Use system libbson]) ],[ - AC_MSG_ERROR([Could not find system library for libbson >= 1.27.0]) + AC_MSG_ERROR([Could not find system library for libbson >= 1.27.1]) ]) - PKG_CHECK_MODULES([PHP_MONGODB_MONGOC], [libmongoc-1.0 >= 1.27.0], [ + PKG_CHECK_MODULES([PHP_MONGODB_MONGOC], [libmongoc-1.0 >= 1.27.1], [ PHP_MONGODB_BSON_VERSION=`$PKG_CONFIG libbson-1.0 --modversion` PHP_MONGODB_BSON_VERSION_STRING="System ($PHP_MONGODB_BSON_VERSION)" @@ -289,7 +289,7 @@ if test "$PHP_MONGODB" != "no"; then PHP_EVAL_LIBLINE($PHP_MONGODB_MONGOC_LIBS, MONGODB_SHARED_LIBADD) AC_DEFINE(HAVE_SYSTEM_LIBMONGOC, 1, [Use system libmongoc]) ],[ - AC_MSG_ERROR(Could not find system library for libmongoc >= 1.27.0) + AC_MSG_ERROR(Could not find system library for libmongoc >= 1.27.1) ]) if test "$PHP_MONGODB_CLIENT_SIDE_ENCRYPTION" != "no"; then diff --git a/src/libmongoc b/src/libmongoc index dfd3aece9..d6f093cd4 160000 --- a/src/libmongoc +++ b/src/libmongoc @@ -1 +1 @@ -Subproject commit dfd3aece9e46ffcfac3e41cc147036872757c2c2 +Subproject commit d6f093cd4f42b026266e3e6734813c0eaf10b571 From ef9abb18eabf160d88014bd3d37b1acdc4fabfa5 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 8 May 2024 09:40:07 -0400 Subject: [PATCH 07/11] PHPC-2255: Add database name to CommandFailedEvent and CommandSucceededEvent (#1543) --- src/MongoDB/Monitoring/CommandFailedEvent.c | 16 ++++ .../Monitoring/CommandFailedEvent.stub.php | 2 + .../Monitoring/CommandFailedEvent_arginfo.h | 6 +- .../Monitoring/CommandSucceededEvent.c | 16 ++++ .../Monitoring/CommandSucceededEvent.stub.php | 2 + .../CommandSucceededEvent_arginfo.h | 6 +- src/phongo_apm.c | 4 +- src/phongo_structs.h | 4 +- tests/apm/commandFailedEvent-001.phpt | 76 +++++++++---------- tests/apm/commandStartedEvent-001.phpt | 61 +++++++-------- tests/apm/commandSucceededEvent-001.phpt | 66 ++++++++-------- 11 files changed, 150 insertions(+), 109 deletions(-) diff --git a/src/MongoDB/Monitoring/CommandFailedEvent.c b/src/MongoDB/Monitoring/CommandFailedEvent.c index e491c0817..75a8e3e2e 100644 --- a/src/MongoDB/Monitoring/CommandFailedEvent.c +++ b/src/MongoDB/Monitoring/CommandFailedEvent.c @@ -43,6 +43,18 @@ static PHP_METHOD(MongoDB_Driver_Monitoring_CommandFailedEvent, getCommandName) RETVAL_STRING(intern->command_name); } +/* Returns the database name for this event */ +static PHP_METHOD(MongoDB_Driver_Monitoring_CommandFailedEvent, getDatabaseName) +{ + php_phongo_commandfailedevent_t* intern; + + intern = Z_COMMANDFAILEDEVENT_OBJ_P(getThis()); + + PHONGO_PARSE_PARAMETERS_NONE(); + + RETVAL_STRING(intern->database_name); +} + /* Returns the event's duration in microseconds */ static PHP_METHOD(MongoDB_Driver_Monitoring_CommandFailedEvent, getDurationMicros) { @@ -192,6 +204,10 @@ static void php_phongo_commandfailedevent_free_object(zend_object* object) if (intern->command_name) { efree(intern->command_name); } + + if (intern->database_name) { + efree(intern->database_name); + } } static zend_object* php_phongo_commandfailedevent_create_object(zend_class_entry* class_type) diff --git a/src/MongoDB/Monitoring/CommandFailedEvent.stub.php b/src/MongoDB/Monitoring/CommandFailedEvent.stub.php index 547966da5..9c8c9041b 100644 --- a/src/MongoDB/Monitoring/CommandFailedEvent.stub.php +++ b/src/MongoDB/Monitoring/CommandFailedEvent.stub.php @@ -13,6 +13,8 @@ final private function __construct() {} final public function getCommandName(): string {} + final public function getDatabaseName(): string {} + final public function getDurationMicros(): int {} final public function getError(): \Exception {} diff --git a/src/MongoDB/Monitoring/CommandFailedEvent_arginfo.h b/src/MongoDB/Monitoring/CommandFailedEvent_arginfo.h index f54f36966..d193f7075 100644 --- a/src/MongoDB/Monitoring/CommandFailedEvent_arginfo.h +++ b/src/MongoDB/Monitoring/CommandFailedEvent_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 90ab50ac51a3bb8853e6dd06fc673ce7b4051d28 */ + * Stub hash: 6fd7c6597ad8e67b399cf4e7c41bb6cc5e6666d6 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -7,6 +7,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent_getCommandName, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() +#define arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent_getDatabaseName arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent_getCommandName + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent_getDurationMicros, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -32,6 +34,7 @@ ZEND_END_ARG_INFO() static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandFailedEvent, __construct); static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandFailedEvent, getCommandName); +static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandFailedEvent, getDatabaseName); static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandFailedEvent, getDurationMicros); static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandFailedEvent, getError); static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandFailedEvent, getOperationId); @@ -45,6 +48,7 @@ static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandFailedEvent, getServerConnec static const zend_function_entry class_MongoDB_Driver_Monitoring_CommandFailedEvent_methods[] = { ZEND_ME(MongoDB_Driver_Monitoring_CommandFailedEvent, __construct, arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent___construct, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) ZEND_ME(MongoDB_Driver_Monitoring_CommandFailedEvent, getCommandName, arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent_getCommandName, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_ME(MongoDB_Driver_Monitoring_CommandFailedEvent, getDatabaseName, arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent_getDatabaseName, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) ZEND_ME(MongoDB_Driver_Monitoring_CommandFailedEvent, getDurationMicros, arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent_getDurationMicros, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) ZEND_ME(MongoDB_Driver_Monitoring_CommandFailedEvent, getError, arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent_getError, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) ZEND_ME(MongoDB_Driver_Monitoring_CommandFailedEvent, getOperationId, arginfo_class_MongoDB_Driver_Monitoring_CommandFailedEvent_getOperationId, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) diff --git a/src/MongoDB/Monitoring/CommandSucceededEvent.c b/src/MongoDB/Monitoring/CommandSucceededEvent.c index a533c9a73..e635850a1 100644 --- a/src/MongoDB/Monitoring/CommandSucceededEvent.c +++ b/src/MongoDB/Monitoring/CommandSucceededEvent.c @@ -43,6 +43,18 @@ static PHP_METHOD(MongoDB_Driver_Monitoring_CommandSucceededEvent, getCommandNam RETVAL_STRING(intern->command_name); } +/* Returns the database name for this event */ +static PHP_METHOD(MongoDB_Driver_Monitoring_CommandSucceededEvent, getDatabaseName) +{ + php_phongo_commandsucceededevent_t* intern; + + intern = Z_COMMANDSUCCEEDEDEVENT_OBJ_P(getThis()); + + PHONGO_PARSE_PARAMETERS_NONE(); + + RETVAL_STRING(intern->database_name); +} + /* Returns the event's duration in microseconds */ static PHP_METHOD(MongoDB_Driver_Monitoring_CommandSucceededEvent, getDurationMicros) { @@ -176,6 +188,10 @@ static void php_phongo_commandsucceededevent_free_object(zend_object* object) if (intern->command_name) { efree(intern->command_name); } + + if (intern->database_name) { + efree(intern->database_name); + } } static zend_object* php_phongo_commandsucceededevent_create_object(zend_class_entry* class_type) diff --git a/src/MongoDB/Monitoring/CommandSucceededEvent.stub.php b/src/MongoDB/Monitoring/CommandSucceededEvent.stub.php index 64788bf56..e671c06b6 100644 --- a/src/MongoDB/Monitoring/CommandSucceededEvent.stub.php +++ b/src/MongoDB/Monitoring/CommandSucceededEvent.stub.php @@ -13,6 +13,8 @@ final private function __construct() {} final public function getCommandName(): string {} + final public function getDatabaseName(): string {} + final public function getDurationMicros(): int {} final public function getOperationId(): string {} diff --git a/src/MongoDB/Monitoring/CommandSucceededEvent_arginfo.h b/src/MongoDB/Monitoring/CommandSucceededEvent_arginfo.h index c726cf52d..8ccdb3bb5 100644 --- a/src/MongoDB/Monitoring/CommandSucceededEvent_arginfo.h +++ b/src/MongoDB/Monitoring/CommandSucceededEvent_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 02437c642fbb49fc7d6294168f82b41c2249f923 */ + * Stub hash: 86e4fd7aeffe8b4d03c32f4221450d80b3f322a9 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -7,6 +7,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent_getCommandName, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() +#define arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent_getDatabaseName arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent_getCommandName + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent_getDurationMicros, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -29,6 +31,7 @@ ZEND_END_ARG_INFO() static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandSucceededEvent, __construct); static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandSucceededEvent, getCommandName); +static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandSucceededEvent, getDatabaseName); static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandSucceededEvent, getDurationMicros); static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandSucceededEvent, getOperationId); static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandSucceededEvent, getReply); @@ -41,6 +44,7 @@ static ZEND_METHOD(MongoDB_Driver_Monitoring_CommandSucceededEvent, getServerCon static const zend_function_entry class_MongoDB_Driver_Monitoring_CommandSucceededEvent_methods[] = { ZEND_ME(MongoDB_Driver_Monitoring_CommandSucceededEvent, __construct, arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent___construct, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) ZEND_ME(MongoDB_Driver_Monitoring_CommandSucceededEvent, getCommandName, arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent_getCommandName, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_ME(MongoDB_Driver_Monitoring_CommandSucceededEvent, getDatabaseName, arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent_getDatabaseName, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) ZEND_ME(MongoDB_Driver_Monitoring_CommandSucceededEvent, getDurationMicros, arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent_getDurationMicros, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) ZEND_ME(MongoDB_Driver_Monitoring_CommandSucceededEvent, getOperationId, arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent_getOperationId, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) ZEND_ME(MongoDB_Driver_Monitoring_CommandSucceededEvent, getReply, arginfo_class_MongoDB_Driver_Monitoring_CommandSucceededEvent_getReply, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) diff --git a/src/phongo_apm.c b/src/phongo_apm.c index 6659716b4..b0c3d1a6c 100644 --- a/src/phongo_apm.c +++ b/src/phongo_apm.c @@ -144,11 +144,11 @@ static void phongo_apm_command_started(const mongoc_apm_command_started_t* event p_event = Z_COMMANDSTARTEDEVENT_OBJ_P(&z_event); p_event->command_name = estrdup(mongoc_apm_command_started_get_command_name(event)); + p_event->database_name = estrdup(mongoc_apm_command_started_get_database_name(event)); p_event->server_id = mongoc_apm_command_started_get_server_id(event); p_event->operation_id = mongoc_apm_command_started_get_operation_id(event); p_event->request_id = mongoc_apm_command_started_get_request_id(event); p_event->command = bson_copy(mongoc_apm_command_started_get_command(event)); - p_event->database_name = estrdup(mongoc_apm_command_started_get_database_name(event)); p_event->server_connection_id = mongoc_apm_command_started_get_server_connection_id_int64(event); p_event->has_service_id = mongoc_apm_command_started_get_service_id(event) != NULL; @@ -190,6 +190,7 @@ static void phongo_apm_command_succeeded(const mongoc_apm_command_succeeded_t* e p_event = Z_COMMANDSUCCEEDEDEVENT_OBJ_P(&z_event); p_event->command_name = estrdup(mongoc_apm_command_succeeded_get_command_name(event)); + p_event->database_name = estrdup(mongoc_apm_command_succeeded_get_database_name(event)); p_event->server_id = mongoc_apm_command_succeeded_get_server_id(event); p_event->operation_id = mongoc_apm_command_succeeded_get_operation_id(event); p_event->request_id = mongoc_apm_command_succeeded_get_request_id(event); @@ -237,6 +238,7 @@ static void phongo_apm_command_failed(const mongoc_apm_command_failed_t* event) p_event = Z_COMMANDFAILEDEVENT_OBJ_P(&z_event); p_event->command_name = estrdup(mongoc_apm_command_failed_get_command_name(event)); + p_event->database_name = estrdup(mongoc_apm_command_failed_get_database_name(event)); p_event->server_id = mongoc_apm_command_failed_get_server_id(event); p_event->operation_id = mongoc_apm_command_failed_get_operation_id(event); p_event->request_id = mongoc_apm_command_failed_get_request_id(event); diff --git a/src/phongo_structs.h b/src/phongo_structs.h index 264af1cc4..3d1f508a2 100644 --- a/src/phongo_structs.h +++ b/src/phongo_structs.h @@ -283,6 +283,7 @@ typedef struct { typedef struct { zval manager; char* command_name; + char* database_name; uint32_t server_id; int64_t operation_id; int64_t request_id; @@ -298,11 +299,11 @@ typedef struct { typedef struct { zval manager; char* command_name; + char* database_name; uint32_t server_id; int64_t operation_id; int64_t request_id; bson_t* command; - char* database_name; bool has_service_id; bson_oid_t service_id; int64_t server_connection_id; @@ -312,6 +313,7 @@ typedef struct { typedef struct { zval manager; char* command_name; + char* database_name; uint32_t server_id; int64_t operation_id; int64_t request_id; diff --git a/tests/apm/commandFailedEvent-001.phpt b/tests/apm/commandFailedEvent-001.phpt index 4e5121abe..14b409a9b 100644 --- a/tests/apm/commandFailedEvent-001.phpt +++ b/tests/apm/commandFailedEvent-001.phpt @@ -8,14 +8,10 @@ MongoDB\Driver\Monitoring\CommandFailedEvent getCommandName(), "\n"; - /* bson_get_monotonic_time() may only have 10-16 millisecond precision * on Windows. Sleep to ensure that a non-zero value is reported for * CommandFailedEvent's duration. */ @@ -24,51 +20,51 @@ class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber } } - public function commandSucceeded( \MongoDB\Driver\Monitoring\CommandSucceededEvent $event ): void + public function commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event): void { } - public function commandFailed( \MongoDB\Driver\Monitoring\CommandFailedEvent $event ): void + public function commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event): void { - echo "failed: ", $event->getCommandName(), "\n"; - echo "- getError() returns an object: ", is_object( $event->getError() ) ? 'yes' : 'no', "\n"; - echo "- getError() returns an MongoDB\Driver\Exception\Exception object: ", $event->getError() instanceof MongoDB\Driver\Exception\Exception ? 'yes' : 'no', "\n"; - echo "- getDurationMicros() returns an integer: ", is_integer( $event->getDurationMicros() ) ? 'yes' : 'no', "\n"; - echo "- getDurationMicros() returns > 0: ", $event->getDurationMicros() > 0 ? 'yes' : 'no', "\n"; - echo "- getCommandName() returns a string: ", is_string( $event->getCommandName() ) ? 'yes' : 'no', "\n"; - echo "- getCommandName() returns '", $event->getCommandName(), "'\n"; - echo "- getServer() returns an object: ", is_object( $event->getServer() ) ? 'yes' : 'no', "\n"; - echo "- getServer() returns a Server object: ", $event->getServer() instanceof MongoDB\Driver\Server ? 'yes' : 'no', "\n"; - echo "- getOperationId() returns a string: ", is_string( $event->getOperationId() ) ? 'yes' : 'no', "\n"; - echo "- getRequestId() returns a string: ", is_string( $event->getRequestId() ) ? 'yes' : 'no', "\n"; + var_dump($event->getCommandName()); + var_dump($event->getDatabaseName()); + var_dump($event->getDurationMicros()); + echo "getDurationMicros() returns > 0: ", $event->getDurationMicros() > 0 ? 'yes' : 'no', "\n"; + var_dump($event->getError() instanceof MongoDB\Driver\Exception\Exception); + var_dump($event->getOperationId()); + var_dump($event->getReply()); + var_dump($event->getRequestId()); + var_dump($event->getServer()); + + /* Note: getServerConnectionId() and getServiceId() have more stringent + * requirements and are tested separately. */ } } -$subscriber = new MySubscriber; +$manager = create_test_manager(); + +$subscriber = new MySubscriber(); +MongoDB\Driver\Monitoring\addSubscriber($subscriber); -MongoDB\Driver\Monitoring\addSubscriber( $subscriber ); +$command = new MongoDB\Driver\Command(['unsupportedCommand' => 1]); -$primary = get_primary_server(URI); -$command = new \MongoDB\Driver\Command([ - 'aggregate' => COLLECTION_NAME, - 'pipeline' => [['$unsupported' => 1]] -]); try { - $primary->executeCommand(DATABASE_NAME, $command); + $manager->executeCommand('admin', $command); } catch (Exception $e) { - /* Swallow */ } + ?> ---EXPECT-- -started: aggregate -failed: aggregate -- getError() returns an object: yes -- getError() returns an MongoDB\Driver\Exception\Exception object: yes -- getDurationMicros() returns an integer: yes -- getDurationMicros() returns > 0: yes -- getCommandName() returns a string: yes -- getCommandName() returns 'aggregate' -- getServer() returns an object: yes -- getServer() returns a Server object: yes -- getOperationId() returns a string: yes -- getRequestId() returns a string: yes +--EXPECTF-- +string(18) "unsupportedCommand" +string(5) "admin" +int(%d) +getDurationMicros() returns > 0: yes +bool(true) +string(%d) "%d" +object(stdClass)#%d (%d) { + %A +} +string(%d) "%d" +object(MongoDB\Driver\Server)#%d (%d) { + %A +} diff --git a/tests/apm/commandStartedEvent-001.phpt b/tests/apm/commandStartedEvent-001.phpt index 24ed6f63f..4c240cbe5 100644 --- a/tests/apm/commandStartedEvent-001.phpt +++ b/tests/apm/commandStartedEvent-001.phpt @@ -8,50 +8,47 @@ MongoDB\Driver\Monitoring\CommandStartedEvent getCommandName(), "\n"; - echo "- getCommand() returns an object: ", is_object( $event->getCommand() ) ? 'yes' : 'no', "\n"; - echo "- getCommand() returns a stdClass object: ", $event->getCommand() instanceof stdClass ? 'yes' : 'no', "\n"; - echo "- getDatabaseName() returns a string: ", is_string( $event->getDatabaseName() ) ? 'yes' : 'no', "\n"; - echo "- getDatabaseName() returns '", $event->getDatabaseName(), "'\n"; - echo "- getCommandName() returns a string: ", is_string( $event->getCommandName() ) ? 'yes' : 'no', "\n"; - echo "- getCommandName() returns '", $event->getCommandName(), "'\n"; - echo "- getServer() returns an object: ", is_object( $event->getServer() ) ? 'yes' : 'no', "\n"; - echo "- getServer() returns a Server object: ", $event->getServer() instanceof MongoDB\Driver\Server ? 'yes' : 'no', "\n"; - echo "- getOperationId() returns a string: ", is_string( $event->getOperationId() ) ? 'yes' : 'no', "\n"; - echo "- getRequestId() returns a string: ", is_string( $event->getRequestId() ) ? 'yes' : 'no', "\n"; + var_dump($event->getCommand()); + var_dump($event->getCommandName()); + var_dump($event->getDatabaseName()); + var_dump($event->getOperationId()); + var_dump($event->getRequestId()); + var_dump($event->getServer()); + + /* Note: getServerConnectionId() and getServiceId() have more stringent + * requirements and are tested separately. */ } - public function commandSucceeded( \MongoDB\Driver\Monitoring\CommandSucceededEvent $event ): void + public function commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event): void { } - public function commandFailed( \MongoDB\Driver\Monitoring\CommandFailedEvent $event ): void + public function commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event): void { } } -$query = new MongoDB\Driver\Query( [] ); -$subscriber = new MySubscriber; +$manager = create_test_manager(); + +$subscriber = new MySubscriber(); +MongoDB\Driver\Monitoring\addSubscriber($subscriber); -MongoDB\Driver\Monitoring\addSubscriber( $subscriber ); +$command = new MongoDB\Driver\Command(['ping' => 1]); +$manager->executeCommand('admin', $command); -$cursor = $m->executeQuery( "demo.test", $query ); ?> ---EXPECT-- -started: find -- getCommand() returns an object: yes -- getCommand() returns a stdClass object: yes -- getDatabaseName() returns a string: yes -- getDatabaseName() returns 'demo' -- getCommandName() returns a string: yes -- getCommandName() returns 'find' -- getServer() returns an object: yes -- getServer() returns a Server object: yes -- getOperationId() returns a string: yes -- getRequestId() returns a string: yes +--EXPECTF-- +object(stdClass)#%d (%d) { + %A +} +string(4) "ping" +string(5) "admin" +string(%d) "%d" +string(%d) "%d" +object(MongoDB\Driver\Server)#%d (%d) { + %A +} diff --git a/tests/apm/commandSucceededEvent-001.phpt b/tests/apm/commandSucceededEvent-001.phpt index 81f394081..c502dac4d 100644 --- a/tests/apm/commandSucceededEvent-001.phpt +++ b/tests/apm/commandSucceededEvent-001.phpt @@ -12,10 +12,8 @@ $m = create_test_manager(); class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber { - public function commandStarted( \MongoDB\Driver\Monitoring\CommandStartedEvent $event ): void + public function commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void { - echo "started: ", $event->getCommandName(), "\n"; - /* bson_get_monotonic_time() may only have 10-16 millisecond precision * on Windows. Sleep to ensure that a non-zero value is reported for * CommandSucceededEvent's duration. */ @@ -24,43 +22,45 @@ class MySubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber } } - public function commandSucceeded( \MongoDB\Driver\Monitoring\CommandSucceededEvent $event ): void + public function commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event): void { - echo "succeeded: ", $event->getCommandName(), "\n"; - echo "- getReply() returns an object: ", is_object( $event->getReply() ) ? 'yes' : 'no', "\n"; - echo "- getReply() returns a stdClass object: ", $event->getReply() instanceof stdClass ? 'yes' : 'no', "\n"; - echo "- getDurationMicros() returns an integer: ", is_integer( $event->getDurationMicros() ) ? 'yes' : 'no', "\n"; - echo "- getDurationMicros() returns > 0: ", $event->getDurationMicros() > 0 ? 'yes' : 'no', "\n"; - echo "- getCommandName() returns a string: ", is_string( $event->getCommandName() ) ? 'yes' : 'no', "\n"; - echo "- getCommandName() returns '", $event->getCommandName(), "'\n"; - echo "- getServer() returns an object: ", is_object( $event->getServer() ) ? 'yes' : 'no', "\n"; - echo "- getServer() returns a Server object: ", $event->getServer() instanceof MongoDB\Driver\Server ? 'yes' : 'no', "\n"; - echo "- getOperationId() returns a string: ", is_string( $event->getOperationId() ) ? 'yes' : 'no', "\n"; - echo "- getRequestId() returns a string: ", is_string( $event->getRequestId() ) ? 'yes' : 'no', "\n"; + var_dump($event->getCommandName()); + var_dump($event->getDatabaseName()); + var_dump($event->getDurationMicros()); + echo "getDurationMicros() returns > 0: ", $event->getDurationMicros() > 0 ? 'yes' : 'no', "\n"; + var_dump($event->getOperationId()); + var_dump($event->getReply()); + var_dump($event->getRequestId()); + var_dump($event->getServer()); + + /* Note: getServerConnectionId() and getServiceId() have more stringent + * requirements and are tested separately. */ } - public function commandFailed( \MongoDB\Driver\Monitoring\CommandFailedEvent $event ): void + public function commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event): void { } } -$query = new MongoDB\Driver\Query( [] ); -$subscriber = new MySubscriber; +$manager = create_test_manager(); + +$subscriber = new MySubscriber(); +MongoDB\Driver\Monitoring\addSubscriber($subscriber); -MongoDB\Driver\Monitoring\addSubscriber( $subscriber ); +$command = new MongoDB\Driver\Command(['ping' => 1]); +$manager->executeCommand('admin', $command); -$cursor = $m->executeQuery( "demo.test", $query ); ?> ---EXPECT-- -started: find -succeeded: find -- getReply() returns an object: yes -- getReply() returns a stdClass object: yes -- getDurationMicros() returns an integer: yes -- getDurationMicros() returns > 0: yes -- getCommandName() returns a string: yes -- getCommandName() returns 'find' -- getServer() returns an object: yes -- getServer() returns a Server object: yes -- getOperationId() returns a string: yes -- getRequestId() returns a string: yes +--EXPECTF-- +string(4) "ping" +string(5) "admin" +int(%d) +getDurationMicros() returns > 0: yes +string(%d) "%d" +object(stdClass)#%d (%d) { + %A +} +string(%d) "%d" +object(MongoDB\Driver\Server)#%d (%d) { + %A +} From 26d2f52cc1a26a35afaf94844117b4c12a3bb66d Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 10 May 2024 09:26:57 +0200 Subject: [PATCH 08/11] Enable auto-merge in merge-up workflow (#1546) --- .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 From df3e69dd1304dd6b4a34d5cedea2599a6855a083 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 10 May 2024 10:29:10 +0200 Subject: [PATCH 09/11] PHPC-1584: Sign releases (#1544) * Create signed git artifacts upon release * Generate signature for PECL package * Fix writing release message to file * Remove unnecessary pip install * Change image variable usage * Sign Windows DLLs * Move composite actions to separate directory * Extract signing functionality to composite actions * Add release integrity information * Use garasign actions from drivers-github-tools * Add comment explaining cross-os cache * Remove submodule install for Windows signing job * Fix name and contents of Windows build artifacts" * Don't hardcode tag message file name * Restore original tag message * Add newline to tag message --- .../linux/build/action.yml | 0 .../windows/build/action.yml | 2 +- .../windows/prepare-build/action.yml | 0 .github/workflows/commit-and-tag.sh | 16 ++++ .github/workflows/package-release.yml | 95 ++++++++++++++++--- .github/workflows/release.yml | 47 ++++++--- .github/workflows/tests.yml | 2 +- .github/workflows/windows-tests.yml | 4 +- README.md | 48 +++++++++- 9 files changed, 184 insertions(+), 30 deletions(-) rename .github/{workflows => actions}/linux/build/action.yml (100%) rename .github/{workflows => actions}/windows/build/action.yml (93%) rename .github/{workflows => actions}/windows/prepare-build/action.yml (100%) create mode 100755 .github/workflows/commit-and-tag.sh diff --git a/.github/workflows/linux/build/action.yml b/.github/actions/linux/build/action.yml similarity index 100% rename from .github/workflows/linux/build/action.yml rename to .github/actions/linux/build/action.yml diff --git a/.github/workflows/windows/build/action.yml b/.github/actions/windows/build/action.yml similarity index 93% rename from .github/workflows/windows/build/action.yml rename to .github/actions/windows/build/action.yml index ec35bf1bc..e32153426 100644 --- a/.github/workflows/windows/build/action.yml +++ b/.github/actions/windows/build/action.yml @@ -19,7 +19,7 @@ runs: steps: - name: Prepare build environment id: prepare-build-env - uses: ./.github/workflows/windows/prepare-build + uses: ./.github/actions/windows/prepare-build with: version: ${{ inputs.version }} arch: ${{ inputs.arch }} diff --git a/.github/workflows/windows/prepare-build/action.yml b/.github/actions/windows/prepare-build/action.yml similarity index 100% rename from .github/workflows/windows/prepare-build/action.yml rename to .github/actions/windows/prepare-build/action.yml diff --git a/.github/workflows/commit-and-tag.sh b/.github/workflows/commit-and-tag.sh new file mode 100755 index 000000000..fb6bf9978 --- /dev/null +++ b/.github/workflows/commit-and-tag.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -e + +PACKAGE_VERSION=$1 +GPG_KEY_ID=$2 +TAG_MESSAGE_FILE=$3 + +gpgloader + +# Create signed "Package x.y.z" commit +echo "Create package commit" +git commit -m "Package ${PACKAGE_VERSION}" -s --gpg-sign=${GPG_KEY_ID} phongo_version.h + +# Create signed "Release x.y.z" tag +echo "Create release tag" +git tag -F ${TAG_MESSAGE_FILE} -s --local-user=${GPG_KEY_ID} ${PACKAGE_VERSION} diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index b913658c2..d87baadb2 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -21,7 +21,7 @@ jobs: submodules: true - name: "Build Driver" - uses: ./.github/workflows/linux/build + uses: ./.github/actions/linux/build with: version: "8.3" @@ -38,27 +38,43 @@ jobs: # PECL always uses the version for the package name. # Read it from the version file and store in env to use when uploading artifacts - name: "Read current package version" - run: echo "PACKAGE_VERSION=$(./bin/update-release-version.php get-version)" >> "$GITHUB_ENV" + run: | + PACKAGE_VERSION=$(./bin/update-release-version.php get-version) + echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> "$GITHUB_ENV" + echo "PACKAGE_FILE=mongodb-${PACKAGE_VERSION}.tgz" >> "$GITHUB_ENV" + + - name: "Create detached signature for PECL package" + uses: mongodb-labs/drivers-github-tools/garasign/gpg-sign@main + with: + filenames: ${{ env.PACKAGE_FILE }} + garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }} + garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }} + artifactory_username: ${{ secrets.ARTIFACTORY_USER }} + artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }} - name: "Install release archive to verify correctness" - run: sudo pecl install mongodb-${{ env.PACKAGE_VERSION }}.tgz + run: sudo pecl install ${{ env.PACKAGE_FILE }} - - name: "Upload artifact" + - name: "Upload artifacts" uses: actions/upload-artifact@v4 with: - name: mongodb-${{ env.PACKAGE_VERSION }}.tgz - path: mongodb-${{ env.PACKAGE_VERSION }}.tgz + name: ${{ env.PACKAGE_FILE }} + path: | + ${{ env.PACKAGE_FILE }} + ${{ env.PACKAGE_FILE }}.sig retention-days: 3 - - name: "Upload release artifact" - run: gh release upload ${{ github.ref_name }} mongodb-${{ env.PACKAGE_VERSION }}.tgz + - name: "Upload release artifacts" + run: gh release upload ${{ github.ref_name }} ${{ env.PACKAGE_FILE }} ${{ env.PACKAGE_FILE }}.sig continue-on-error: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} build-windows: name: "Create Windows package" - runs-on: windows-2022 + # windows-latest is required to use enableCrossOsArchive with Ubuntu in the + # next step. See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cross-os-cache + runs-on: windows-latest defaults: run: shell: cmd @@ -78,7 +94,7 @@ jobs: - name: "Build Driver" id: build-driver - uses: ./.github/workflows/windows/build + uses: ./.github/actions/windows/build with: version: ${{ matrix.php }} arch: ${{ matrix.arch }} @@ -91,20 +107,73 @@ jobs: env: BUILD_DIR: ${{ steps.build-driver.outputs.build-dir }} + - name: "Cache build artifacts for subsequent builds" + uses: actions/cache/save@v4 + with: + key: ${{ github.sha }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }} + enableCrossOsArchive: true + path: | + php_mongodb.dll + php_mongodb.pdb + + sign-and-publish-windows: + name: "Sign and Publish Windows package" + needs: [build-windows] + # ubuntu-latest is required to use enableCrossOsArchive + # See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cross-os-cache + runs-on: "ubuntu-latest" + + strategy: + fail-fast: false + matrix: + # Note: keep this in sync with the Windows matrix in windows-tests.yml + php: [ "7.4", "8.0", "8.1", "8.2", "8.3" ] + arch: [ x64, x86 ] + ts: [ ts, nts ] + + steps: + - uses: actions/checkout@v4 + + - name: Restore cached build artifacts + id: cache-build-artifacts + uses: actions/cache/restore@v4 + with: + fail-on-cache-miss: true + key: ${{ github.sha }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }} + enableCrossOsArchive: true + path: | + php_mongodb.dll + php_mongodb.pdb + + - name: "Create detached DLL signature" + uses: mongodb-labs/drivers-github-tools/garasign/gpg-sign@main + with: + filenames: php_mongodb.dll + garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }} + garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }} + artifactory_username: ${{ secrets.ARTIFACTORY_USER }} + artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }} + - name: "Upload DLL and PDB files as build artifacts" uses: actions/upload-artifact@v4 with: name: php_mongodb-${{ github.ref_name }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }} path: | php_mongodb.dll + php_mongodb.dll.sig php_mongodb.pdb + CREDITS + CONTRIBUTING.md + LICENSE + README.md + THIRD_PARTY_NOTICES retention-days: 3 - name: "Create and upload release artifact" run: | - set ARCHIVE=php_mongodb-${{ github.ref_name }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }}.zip - zip %ARCHIVE% php_mongodb.dll php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES - gh release upload ${{ github.ref_name }} %ARCHIVE% + ARCHIVE=php_mongodb-${{ github.ref_name }}-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.arch }}.zip + zip ${ARCHIVE} php_mongodb.dll php_mongodb.dll.sig php_mongodb.pdb CREDITS CONTRIBUTING.md LICENSE README.md THIRD_PARTY_NOTICES + gh release upload ${{ github.ref_name }} ${ARCHIVE} continue-on-error: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90f4c1569..cd1a0e67d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,10 +89,6 @@ jobs: git config user.name "${GIT_AUTHOR_NAME}" git config user.email "${GIT_AUTHOR_EMAIL}" - # Create the "Package x.y.z" commit that will be the base of our tag - - name: "Create release commit" - run: git commit -m "Package ${{ env.PACKAGE_VERSION }}" phongo_version.h - # Create a draft release with a changelog # TODO: Consider using the API to generate changelog - name: "Create draft release with generated changelog" @@ -101,14 +97,39 @@ jobs: - name: "Read changelog from draft release" run: gh release view ${{ env.PACKAGE_VERSION }} --json body --template '{{ .body }}' >> changelog - # TODO: Sign tag - - name: "Create release tag" - run: git tag -a -F changelog ${{ env.PACKAGE_VERSION }} - - - name: "Update version information to next patch development release" + - name: "Prepare tag message" run: | - ./bin/update-release-version.php to-next-patch-dev - git commit -m "Back to -dev" phongo_version.h + echo -e "Release ${PACKAGE_VERSION}\n" > tag-message + cat changelog >> tag-message + + # This step creates the "Package x.y.z" commit that will be the base of + # our tag and creates the release tag. This is run inside the container in + # order to create signed git artifacts + - name: "Create package commit and release tag" + uses: mongodb-labs/drivers-github-tools/garasign/git-sign@main + with: + command: "$(pwd)/.github/workflows/commit-and-tag.sh ${{ env.PACKAGE_VERSION }} ${{ vars.GPG_KEY_ID }} tag-message" + garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }} + garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }} + artifactory_username: ${{ secrets.ARTIFACTORY_USER }} + artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # This step needs to happen outside of the container, as PHP is not + # available within. + - name: "Bump to next development release" + run: ./bin/update-release-version.php to-next-patch-dev + + # Create a signed "back to -dev" commit, again inside the container + - name: "Create dev commit" + uses: mongodb-labs/drivers-github-tools/garasign/git-sign@main + with: + # Setup can be skipped as it was already done before + skip_setup: true + command: "git commit -m 'Back to -dev' -s --gpg-sign=${{ vars.GPG_KEY_ID }} phongo_version.h" + garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }} + garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }} + artifactory_username: ${{ secrets.ARTIFACTORY_USER }} + artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }} # TODO: Manually merge using ours strategy. This avoids merge-up pull requests being created # Process is: @@ -122,7 +143,9 @@ jobs: - name: "Prepare release message" run: | - echo "${{ format(env.default-release-message, env.PACKAGE_VERSION, inputs.jira-version-number) }}" > release-message + cat > release-message <<'EOL' + ${{ format(env.default-release-message, env.PACKAGE_VERSION, inputs.jira-version-number) }} + EOL cat changelog >> release-message # Update release with correct release information diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 018ca327f..74306605c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -64,7 +64,7 @@ jobs: - name: "Build Driver" id: build-driver - uses: ./.github/workflows/linux/build + uses: ./.github/actions/linux/build with: version: ${{ matrix.php-version }} diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml index 569e47ad7..ea2021f14 100644 --- a/.github/workflows/windows-tests.yml +++ b/.github/workflows/windows-tests.yml @@ -35,7 +35,7 @@ jobs: - name: "Build Driver" id: build-driver - uses: ./.github/workflows/windows/build + uses: ./.github/actions/windows/build with: version: ${{ matrix.php }} arch: ${{ matrix.arch }} @@ -74,7 +74,7 @@ jobs: - name: Prepare build environment id: prepare-build - uses: ./.github/workflows/windows/prepare-build + uses: ./.github/actions/windows/prepare-build with: version: ${{ matrix.php }} arch: ${{ matrix.arch }} diff --git a/README.md b/README.md index 928f37e43..2ad1d104c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,53 @@ This extension is intended to be used alongside the [MongoDB PHP Library](https://github.com/mongodb/mongo-php-library), which is distributed as the [`mongodb/mongodb`](https://packagist.org/packages/mongodb/mongodb) package for -for [Composer](https://getcomposer.org). +[Composer](https://getcomposer.org). + +## Release Integrity + +Releases are created automatically and signed using the +[PHP team's GPG key](https://pgp.mongodb.com/php-driver.asc). This applies to +the git tag as well as all release packages provided as part of a +[GitHub release](https://github.com/mongodb/mongo-php-library/releases). To +verify the provided packages, download the key and import it using `gpg`: + +```shell +gpg --import php-driver.asc +``` + +### PECL package + +PECL packages are made available as release artifacts on GitHub, as well as on +the [PECL homepage](https://pecl.php.net/mongodb). The GitHub release will also +contain a detached signature file for the PECL package (named +`mongodb-X.Y.Z.tgz.sig`). + +To verify the integrity of the downloaded package, run the following command: + +```shell +gpg --verify mongodb-X.Y.Z.tgz.sig mongodb-X.Y.Z.tgz +``` + +> [!NOTE] +> No verification is done when using `pecl` to install the package. To ensure +> release integrity when using `pecl`, download the tarball manually from the +> GitHub release, verify the signature, then install the package from the +> downloaded tarball using `pecl install mongodb-X.Y.Z.tgz`. + +### Windows + +Windows binaries distributed through GitHub releases contain a detached +signature for the `php_mongodb.dll` file named `php_mongodb.dll.sig`. To verify +the integrity of the DLL, run the following command: + +```shell +gpg --verify php_mongodb.dll.sig php_mongodb.dll.tgz +``` + +> [!NOTE] +> Windows binaries distributed directly through PECL are not signed by MongoDB +> and cannot be verified. If you need to verify the integrity of the downloaded +> binary, always download them from the GitHub release. ## Reporting Issues From a496f5ac28ad4f18a95e66679a076853137067ea Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 13 May 2024 10:13:57 -0400 Subject: [PATCH 10/11] PHPC-2373: Include uthash in PECL package (#1552) --- bin/prep-release.php | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/prep-release.php b/bin/prep-release.php index 93df6724c..aa9882e3c 100644 --- a/bin/prep-release.php +++ b/bin/prep-release.php @@ -57,6 +57,7 @@ function get_files() { "src/libmongoc/src/libmongoc/src/mongoc/*.{c,def,defs,h,h.in}", "src/libmongoc/src/zlib-1.*/*.{c,h,h.in}", "src/libmongoc/src/utf8proc-2.*/*.{c,h}", + "src/libmongoc/src/uthash/uthash-2.*/*.h", "src/libmongoc/VERSION*", "src/libmongocrypt-compat/*.{c,h}", From ddcca3378a98aafb540e89850b4694bd3bb77ce6 Mon Sep 17 00:00:00 2001 From: DBX PHP Release Bot Date: Mon, 13 May 2024 14:18:01 +0000 Subject: [PATCH 11/11] Package 1.19.0 Signed-off-by: DBX PHP Release Bot --- phongo_version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phongo_version.h b/phongo_version.h index b194cce5f..750dd4728 100644 --- a/phongo_version.h +++ b/phongo_version.h @@ -22,9 +22,9 @@ * publishing a release. */ /* clang-format off */ -#define PHP_MONGODB_VERSION "1.19.0dev" -#define PHP_MONGODB_STABILITY "devel" -#define PHP_MONGODB_VERSION_DESC 1,19,0,0 +#define PHP_MONGODB_VERSION "1.19.0" +#define PHP_MONGODB_STABILITY "stable" +#define PHP_MONGODB_VERSION_DESC 1,19,0,1 /* clang-format on */ #endif /* PHONGO_VERSION_H */