Skip to content

Commit d94dead

Browse files
committed
Merge branch 'master' into godriver3285v2
2 parents 5a87ba9 + cf0348c commit d94dead

File tree

240 files changed

+10157
-7343
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+10157
-7343
lines changed

.evergreen/config.yml

Lines changed: 466 additions & 821 deletions
Large diffs are not rendered by default.

.evergreen/run-deployed-lambda-aws-tests.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

.evergreen/run-task.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Source the env.sh file and run the given task
4+
set -eu
5+
6+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
7+
PROJECT_DIRECTORY=$(dirname $SCRIPT_DIR)
8+
pushd ${PROJECT_DIRECTORY} > /dev/null
9+
10+
source env.sh
11+
task "$@"
12+
13+
popd > /dev/null

.evergreen/run-tests.sh

Lines changed: 0 additions & 102 deletions
This file was deleted.

.evergreen/setup-system.sh

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Set up environment and write env.sh and expansion.yml files.
4+
set -eu
5+
6+
# Set up default environment variables.
7+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
8+
PROJECT_DIRECTORY=$(dirname $SCRIPT_DIR)
9+
pushd $PROJECT_DIRECTORY
10+
ROOT_DIR=$(dirname $PROJECT_DIRECTORY)
11+
DRIVERS_TOOLS=${DRIVERS_TOOLS:-${ROOT_DIR}/drivers-evergreen-tools}
12+
MONGO_ORCHESTRATION_HOME="${DRIVERS_TOOLS}/.evergreen/orchestration"
13+
MONGODB_BINARIES="${DRIVERS_TOOLS}/mongodb/bin"
14+
OS="${OS:-""}"
15+
16+
# Set Golang environment vars. GOROOT is wherever current Go distribution is, and is set in evergreen config.
17+
# GOPATH is always 3 directories up from pwd on EVG; GOCACHE is under .cache in the pwd.
18+
GOROOT=${GOROOT:-$(dirname "$(dirname "$(which go)")")}
19+
export GOPATH=${GOPATH:-$ROOT_DIR}
20+
export GOCACHE="${GO_CACHE:-$PROJECT_DIRECTORY/.cache}"
21+
22+
# Handle paths on Windows.
23+
if [ "Windows_NT" = "${OS:-}" ]; then # Magic variable in cygwin
24+
GOPATH=$(cygpath -m $GOPATH)
25+
GOCACHE=$(cygpath -w $GOCACHE)
26+
DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
27+
PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY)
28+
EXTRA_PATH=/cygdrive/c/libmongocrypt/bin
29+
MONGO_ORCHESTRATION_HOME=$(cygpath -m $MONGO_ORCHESTRATION_HOME)
30+
MONGODB_BINARIES=$(cygpath -m $MONGODB_BINARIES)
31+
# Set home variables for Windows, too.
32+
USERPROFILE=$(cygpath -w "$ROOT_DIR")
33+
HOME=$USERPROFILE
34+
else
35+
EXTRA_PATH=${GCC:-}
36+
fi
37+
38+
# Add binaries to the path.
39+
PATH="${GOROOT}/bin:${GOPATH}/bin:${MONGODB_BINARIES}:${EXTRA_PATH}:${PATH}"
40+
41+
# Get the current unique version of this checkout.
42+
if [ "${IS_PATCH:-}" = "true" ]; then
43+
CURRENT_VERSION=$(git describe)-patch-${VERSION_ID}
44+
else
45+
CURRENT_VERSION=latest
46+
fi
47+
48+
# Ensure a checkout of drivers-tools.
49+
if [ ! -d "$DRIVERS_TOOLS" ]; then
50+
git clone https://github.com/mongodb-labs/drivers-evergreen-tools $DRIVERS_TOOLS
51+
fi
52+
53+
# Write the .env file for drivers-tools.
54+
cat <<EOT > ${DRIVERS_TOOLS}/.env
55+
SKIP_LEGACY_SHELL=1
56+
DRIVERS_TOOLS="$DRIVERS_TOOLS"
57+
MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME"
58+
MONGODB_BINARIES="$MONGODB_BINARIES"
59+
TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
60+
EOT
61+
62+
# Check Go installation.
63+
go version
64+
go env
65+
66+
# Install taskfile.
67+
go install github.com/go-task/task/v3/cmd/[email protected]
68+
69+
# Write our own env file.
70+
cat <<EOT > env.sh
71+
export GOROOT="$GOROOT"
72+
export GOPATH="$GOPATH"
73+
export GOCACHE="$GOCACHE"
74+
export DRIVERS_TOOLS="$DRIVERS_TOOLS"
75+
export PROJECT_DIRECTORY="$PROJECT_DIRECTORY"
76+
export MONGODB_BINARIES="$MONGODB_BINARIES"
77+
export PATH="$PATH"
78+
EOT
79+
80+
if [ "Windows_NT" = "$OS" ]; then
81+
echo "export USERPROFILE=$USERPROFILE" >> env.sh
82+
echo "export HOME=$HOME" >> env.sh
83+
fi
84+
85+
# source the env.sh file and write the expansion file.
86+
cat <<EOT > expansion.yml
87+
CURRENT_VERSION: "$CURRENT_VERSION"
88+
DRIVERS_TOOLS: "$DRIVERS_TOOLS"
89+
PROJECT_DIRECTORY: "$PROJECT_DIRECTORY"
90+
RUN_TASK: "$PROJECT_DIRECTORY/.evergreen/run-task.sh"
91+
EOT
92+
93+
cat env.sh
94+
popd

.github/reviewers.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
qingyang-hu
22
matthewdale
33
prestonvasquez
4-
blink1073

.github/workflows/codeql.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ jobs:
3333
languages: go
3434
build-mode: manual
3535

36+
- name: Install Taskfile support
37+
uses: arduino/setup-task@v2
38+
3639
- shell: bash
37-
run: |
38-
make build
40+
run: task build
3941

4042
- name: Perform CodeQL Analysis
4143
uses: github/codeql-action/analyze@v3
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Create Release Branch
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch_name:
7+
description: The name of the new branch
8+
required: true
9+
version:
10+
description: The version to set on the branch
11+
required: true
12+
base_ref:
13+
description: The base reference for the branch
14+
push_changes:
15+
description: Whether to push the changes
16+
default: "true"
17+
18+
concurrency:
19+
group: create-branch-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
defaults:
23+
run:
24+
shell: bash -eux {0}
25+
26+
jobs:
27+
create-branch:
28+
environment: release
29+
runs-on: ubuntu-latest
30+
permissions:
31+
id-token: write
32+
contents: write
33+
outputs:
34+
version: ${{ steps.pre-publish.outputs.version }}
35+
steps:
36+
- uses: mongodb-labs/drivers-github-tools/secure-checkout@v2
37+
with:
38+
app_id: ${{ vars.APP_ID }}
39+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
40+
- uses: mongodb-labs/drivers-github-tools/setup@v2
41+
with:
42+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
43+
aws_region_name: ${{ vars.AWS_REGION_NAME }}
44+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
45+
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }}
46+
- uses: mongodb-labs/drivers-github-tools/create-branch@v2
47+
id: create-branch
48+
with:
49+
branch_name: ${{ inputs.branch_name }}
50+
version: ${{ inputs.version }}
51+
base_ref: ${{ inputs.base_ref }}
52+
push_changes: ${{ inputs.push_changes }}
53+
version_bump_script: "go run ${{ github.action_path }}/bump-version.go"
54+
evergreen_project: mongo-go-driver-release
55+
release_workflow_path: ./.github/workflows/release.yml

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: actions/setup-python@v5
21+
- uses: actions/setup-go@v5
22+
with:
23+
go-version: 'stable'
2124
- uses: pre-commit/[email protected]

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ debug
99
*.sublime-workspace
1010
driver-test-data.tar.gz
1111
perf
12+
perf.json
13+
perf.suite
1214
**mongocryptd.pid
1315
*.test
1416
.DS_Store
@@ -20,6 +22,9 @@ libmongocrypt
2022
venv
2123
test.suite
2224
go.work.sum
25+
.task
26+
env.sh
27+
expansion.yml
2328

2429
# AWS SAM-generated files
2530
internal/cmd/faas/awslambda/.aws-sam
@@ -36,3 +41,4 @@ api-report.txt
3641
# Ignore secrets files
3742
secrets-expansion.yml
3843
secrets-export.sh
44+
.test.env

0 commit comments

Comments
 (0)