Skip to content

Commit e230a32

Browse files
committed
Merge branch 'master' into godriver3140
2 parents a2e8ac9 + f7f3635 commit e230a32

File tree

1,440 files changed

+73672
-153071
lines changed

Some content is hidden

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

1,440 files changed

+73672
-153071
lines changed

.evergreen/config.yml

Lines changed: 661 additions & 1029 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-mongodb-aws-ecs-test.sh

100644100755
File mode changed.

.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 & 103 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/task@v3.39.1
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/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @mongodb/dbx-go

.github/dependabot.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ updates:
1111
- package-ecosystem: gomod
1212
directory: /
1313
schedule:
14-
interval: "weekly"
14+
interval: "weekly"
15+
- package-ecosystem: "gitsubmodule"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"

.github/workflows/codeql.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,13 @@ on:
1515

1616
jobs:
1717
analyze:
18-
name: Analyze (${{ matrix.language }})
19-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
20-
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
18+
name: Analyze (go)
19+
runs-on: 'ubuntu-latest'
20+
timeout-minutes: 360
2121
permissions:
2222
# required for all workflows
2323
security-events: write
2424

25-
strategy:
26-
fail-fast: false
27-
matrix:
28-
include:
29-
- language: go
30-
build-mode: manual
31-
3225
steps:
3326
- name: Checkout repository
3427
uses: actions/checkout@v4
@@ -37,15 +30,16 @@ jobs:
3730
- name: Initialize CodeQL
3831
uses: github/codeql-action/init@v3
3932
with:
40-
languages: ${{ matrix.language }}
41-
build-mode: ${{ matrix.build-mode }}
33+
languages: go
34+
build-mode: manual
35+
36+
- name: Install Taskfile support
37+
uses: arduino/setup-task@v2
4238

43-
- if: matrix.build-mode == 'manual'
44-
shell: bash
45-
run: |
46-
make build
39+
- shell: bash
40+
run: task build
4741

4842
- name: Perform CodeQL Analysis
4943
uses: github/codeql-action/analyze@v3
5044
with:
51-
category: "/language:${{matrix.language}}"
45+
category: "/language:go"
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/merge-up.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Merge up
2+
3+
on:
4+
push:
5+
branches:
6+
- release/*.*
7+
- v*
8+
9+
permissions:
10+
id-token: write
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
merge-up:
16+
name: Create merge up pull request
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: mongodb-labs/drivers-github-tools/secure-checkout@v2
21+
with:
22+
app_id: ${{ vars.PR_APP_ID }}
23+
private_key: ${{ secrets.PR_APP_PRIVATE_KEY }}
24+
# Make sure to include fetch-depth 0 so all branches are fetched, not
25+
# just the current one
26+
fetch-depth: 0
27+
28+
- name: Create pull request
29+
id: create-pull-request
30+
uses: alcaeus/automatic-merge-up-action@main
31+
with:
32+
ref: ${{ github.ref_name }}
33+
branchNamePattern: 'release/<major>.<minor>'
34+
devBranchNamePattern: 'v<major>'
35+
fallbackBranch: 'master'
36+
enableAutoMerge: true

0 commit comments

Comments
 (0)