From 4657988ba093df9d25e8be042ff6f3eb91dfc912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Mon, 17 Feb 2025 13:34:35 +0100 Subject: [PATCH 1/6] PHPC-2510 Install evergreen tools using git submodule Update drivers-evergreen-tools --- .evergreen/README.md | 4 ++-- .evergreen/config/functions.yml | 13 ++++--------- .github/dependabot.yml | 4 ++++ .github/workflows/tests.yml | 5 +++-- .github/workflows/windows-tests.yml | 5 +++-- .gitmodules | 3 +++ tests/drivers-evergreen-tools | 1 + 7 files changed, 20 insertions(+), 15 deletions(-) create mode 160000 tests/drivers-evergreen-tools diff --git a/.evergreen/README.md b/.evergreen/README.md index d5439e6a3..12ec34bbf 100644 --- a/.evergreen/README.md +++ b/.evergreen/README.md @@ -12,5 +12,5 @@ hosts. [mongodb-labs/drivers-evergreen-tools](https://github.com/mongodb-labs/drivers-evergreen-tools) consists of common scripts used by many drivers (e.g. starting -[mongo-orchestration](https://github.com/10gen/mongo-orchestration)). The PHP -driver clones this during the build process. +[mongo-orchestration](https://github.com/10gen/mongo-orchestration)). This package is installed as a Git submodule +in the `tests` repository. diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index a59363aa2..6484eafe9 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -9,7 +9,7 @@ functions: params: working_dir: "src" script: | - git submodule update --init + git submodule update --init --depth 1 # Make an evergreen expansion file with dynamic values - command: shell.exec params: @@ -22,7 +22,7 @@ functions: CURRENT_VERSION=latest fi - export DRIVERS_TOOLS="$(pwd)/../drivers-tools" + export DRIVERS_TOOLS="$(pwd)/tests/drivers-evergreen-tools" export PROJECT_DIRECTORY="$(pwd)" # Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory @@ -72,15 +72,10 @@ functions: "prepare resources": - command: shell.exec params: + working_dir: src script: | ${PREPARE_SHELL} - rm -rf $DRIVERS_TOOLS - if [ "${project}" = "drivers-tools" ]; then - # If this was a patch build, doing a fresh clone would not actually test the patch - cp -R ${PROJECT_DIRECTORY}/ $DRIVERS_TOOLS - else - git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS - fi + git submodule update --init --depth 1 echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5ace4600a..43883f148 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,7 @@ updates: directory: "/" schedule: interval: "weekly" + - package-ecosystem: "gitsubmodule" + directory: "/tests/" + schedule: + interval: "weekly" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8fb2368e4..7bba58447 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,8 +57,9 @@ jobs: with: python-version: '3.13' - - id: setup-mongodb - uses: mongodb-labs/drivers-evergreen-tools@master + - name: Setup MongoDB + id: setup-mongodb + uses: ./tests/drivers-evergreen-tools with: version: ${{ matrix.mongodb-version }} topology: ${{ matrix.topology }} diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml index b1e6dd544..337c92042 100644 --- a/.github/workflows/windows-tests.yml +++ b/.github/workflows/windows-tests.yml @@ -64,8 +64,9 @@ jobs: with: submodules: true - - id: setup-mongodb - uses: mongodb-labs/drivers-evergreen-tools@master + - name: Setup MongoDB + id: setup-mongodb + uses: ./tests/drivers-evergreen-tools with: version: "7.0" topology: "server" diff --git a/.gitmodules b/.gitmodules index 82028d60e..9cf4ed272 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,3 +6,6 @@ path = src/libmongocrypt url = https://github.com/mongodb/libmongocrypt.git ignore = untracked +[submodule "tests/drivers-evergreen-tools"] + path = tests/drivers-evergreen-tools + url = https://github.com/mongodb-labs/drivers-evergreen-tools.git diff --git a/tests/drivers-evergreen-tools b/tests/drivers-evergreen-tools new file mode 160000 index 000000000..4a84579f6 --- /dev/null +++ b/tests/drivers-evergreen-tools @@ -0,0 +1 @@ +Subproject commit 4a84579f625b92f982bce1a058518a23962935cf From 90b6920ec43758c0982094e0140986b689dafa42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Wed, 19 Mar 2025 15:38:09 +0100 Subject: [PATCH 2/6] Update .evergreen/README.md Co-authored-by: Jeremy Mikola --- .evergreen/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/README.md b/.evergreen/README.md index 12ec34bbf..bae5616ef 100644 --- a/.evergreen/README.md +++ b/.evergreen/README.md @@ -13,4 +13,4 @@ hosts. [mongodb-labs/drivers-evergreen-tools](https://github.com/mongodb-labs/drivers-evergreen-tools) consists of common scripts used by many drivers (e.g. starting [mongo-orchestration](https://github.com/10gen/mongo-orchestration)). This package is installed as a Git submodule -in the `tests` repository. +in the `tests` directory. From 81bdd27de8c64ba3faff864f93c171eb1b2199b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 21 Mar 2025 15:54:53 +0100 Subject: [PATCH 3/6] Track submodule precisely --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 43883f148..3547ac743 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,6 +5,6 @@ updates: schedule: interval: "weekly" - package-ecosystem: "gitsubmodule" - directory: "/tests/" + directory: "/tests/drivers-evergreen-tools" schedule: interval: "weekly" From 90e7904e8c31aed06a6327049f08b03745cc209f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 21 Mar 2025 16:20:15 +0100 Subject: [PATCH 4/6] Full history must be fetched --- .evergreen/config/functions.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 6484eafe9..54fcb2701 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -4,12 +4,12 @@ functions: - command: git.get_project params: directory: "src" - # Fetch the libmongoc submodule + # Fetch the submodules - command: shell.exec params: working_dir: "src" script: | - git submodule update --init --depth 1 + git submodule update --init # Make an evergreen expansion file with dynamic values - command: shell.exec params: @@ -75,7 +75,6 @@ functions: working_dir: src script: | ${PREPARE_SHELL} - git submodule update --init --depth 1 echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config From 6715e019d8e9f1c5cc1f791e0cfb764c70a10f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 11 Apr 2025 09:04:52 +0200 Subject: [PATCH 5/6] Update submodule --- tests/drivers-evergreen-tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/drivers-evergreen-tools b/tests/drivers-evergreen-tools index 4a84579f6..f53da283a 160000 --- a/tests/drivers-evergreen-tools +++ b/tests/drivers-evergreen-tools @@ -1 +1 @@ -Subproject commit 4a84579f625b92f982bce1a058518a23962935cf +Subproject commit f53da283a45de61a6b2d278a31454c57ceab9104 From 084bb1db3bc3bf2608e2324a5489aa9aef405f36 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 19 May 2025 16:10:24 +0200 Subject: [PATCH 6/6] Fix paths for drivers-evergreen-tools when fetching build --- .evergreen/config/functions.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 54fcb2701..4b66cc675 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -126,6 +126,9 @@ functions: script: | ${PREPARE_SHELL} perl -p -i -e "s|/data/mci/[0-9a-z]+/src|${PROJECT_DIRECTORY}|g" Makefile + for filename in $(find ${DRIVERS_TOOLS} -name \*.json); do + perl -p -i -e "s|/data/mci/[0-9a-z]+/src|${PROJECT_DIRECTORY}|g" $filename + done "compile driver" : - command: shell.exec