Skip to content

Commit 4beefe6

Browse files
committed
Merge branch 'master' into godriver2976
2 parents fba7c47 + d33301f commit 4beefe6

File tree

243 files changed

+4602
-4432
lines changed

Some content is hidden

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

243 files changed

+4602
-4432
lines changed

.evergreen/config.yml

Lines changed: 76 additions & 229 deletions
Large diffs are not rendered by default.

.evergreen/ocsp-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
asn1crypto==1.3.0
22
bottle==0.12.20
3-
oscrypto==1.2.0
3+
oscrypto==1.2.0

.evergreen/run-fuzz.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ do
4444
for CORPUS_FILE in $PARENTDIR/testdata/fuzz/$FUNC/*
4545
do
4646
# Check to see if the value for CORPUS_FILE is in cset.
47-
if [[ ! " ${cset[@]} " =~ " ${CORPUS_FILE} " ]]; then
47+
if [[ ! " ${cset[*]} " =~ " ${CORPUS_FILE} " ]]; then
4848
# Create the directory if it doesn't exist.
4949
if [ ! -d $PROJECT_DIRECTORY/fuzz/$FUNC ]; then
5050
mkdir -p $PROJECT_DIRECTORY/fuzz/$FUNC
@@ -69,4 +69,3 @@ if [ -d $PROJECT_DIRECTORY/fuzz ]; then
6969
# This will trigger a notification to be sent to the Go Driver team.
7070
exit 1
7171
fi
72-

.evergreen/run-mongodb-aws-test.sh

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,9 @@ set -o errexit # Exit the script with error if any of the commands fail
1212
# mechanism.
1313

1414
echo "Running MONGODB-AWS authentication tests"
15-
# ensure no secrets are printed in log files
16-
set +x
1715

18-
# load the script
19-
shopt -s expand_aliases # needed for `urlencode` alias
20-
[ -s "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" ] && source "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
21-
22-
MONGODB_URI=${MONGODB_URI:-"mongodb://localhost"}
23-
MONGODB_URI="${MONGODB_URI}/aws?authMechanism=MONGODB-AWS"
24-
if [[ -n ${SESSION_TOKEN} ]]; then
25-
MONGODB_URI="${MONGODB_URI}&authMechanismProperties=AWS_SESSION_TOKEN:${SESSION_TOKEN}"
26-
fi
27-
28-
export MONGODB_URI="$MONGODB_URI"
16+
# Handle credentials and environment setup.
17+
. $DRIVERS_TOOLS/.evergreen/auth_aws/aws_setup.sh $1
2918

3019
# show test output
3120
set -x

.evergreen/run-tests.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ set -o errexit
44

55
export GOPATH=$(dirname $(dirname $(dirname `pwd`)))
66
export GOCACHE="$(pwd)/.cache"
7-
export DRIVERS_TOOLS="$(pwd)/../drivers-tools"
7+
export DRIVERS_TOOLS=${DRIVERS_TOOLS:-""}
8+
9+
if [ -z $DRIVERS_TOOLS ]; then
10+
export DRIVERS_TOOLS="$(dirname $(dirname $(dirname `pwd`)))/drivers-tools"
11+
fi
812

913
if [ "Windows_NT" = "$OS" ]; then
1014
export GOPATH=$(cygpath -m $GOPATH)
@@ -14,6 +18,7 @@ fi
1418

1519
export GOROOT="${GOROOT}"
1620
export PATH="${GOROOT}/bin:${GCC_PATH}:$GOPATH/bin:$PATH"
21+
export PATH="${MONGODB_BINARIES:-$DRIVERS_TOOLS/mongodb/bin}:$PATH"
1722
export PROJECT="${project}"
1823
export PKG_CONFIG_PATH=$(pwd)/install/libmongocrypt/lib64/pkgconfig:$(pwd)/install/mongo-c-driver/lib/pkgconfig
1924
export LD_LIBRARY_PATH=$(pwd)/install/libmongocrypt/lib64
@@ -43,7 +48,7 @@ fi
4348
# Using python3-venv in Ubuntu 14.04 (an OS required for legacy server version
4449
# tasks) requires the use of apt-get, which we wish to avoid. So, we do not set
4550
# a python3 binary on Ubuntu 14.04. Setting AWS temp credentials for legacy
46-
# server version tasks is unneccesary, as temp credentials are only needed on 4.2+.
51+
# server version tasks is unnecessary, as temp credentials are only needed on 4.2+.
4752
if [ ! -z ${PYTHON3_BINARY} ]; then
4853
export AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}"
4954
export AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}"

.github/workflows/comment.yml

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

.github/workflows/test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: GoDriver Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
concurrency:
8+
group: test-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
defaults:
12+
run:
13+
shell: bash -eux {0}
14+
15+
jobs:
16+
pre_commit:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-python@v4
21+
- uses: pre-commit/action@v3.0.0

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ perf
1212
**mongocryptd.pid
1313
*.test
1414
.DS_Store
15+
install
1516
main.so
17+
.cache
18+
install
19+
libmongocrypt
20+
venv
21+
test.suite
1622

1723
# AWS SAM-generated files
1824
internal/test/faas/awslambda/.aws-sam

.pre-commit-config.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.5.0
5+
hooks:
6+
- id: check-case-conflict
7+
- id: check-executables-have-shebangs
8+
- id: check-added-large-files
9+
- id: check-case-conflict
10+
- id: check-merge-conflict
11+
- id: check-json
12+
- id: end-of-file-fixer
13+
exclude: ^vendor/
14+
exclude_types: [json,yaml]
15+
- id: trailing-whitespace
16+
exclude: ^(vendor/|internal/assert/assertions_test.go)
17+
exclude_types: [json,yaml]
18+
19+
- repo: https://github.com/executablebooks/mdformat
20+
rev: 0.7.17
21+
hooks:
22+
- id: mdformat
23+
exclude: ^vendor/
24+
25+
- repo: https://github.com/python-jsonschema/check-jsonschema
26+
rev: 0.27.0
27+
hooks:
28+
- id: check-github-workflows
29+
30+
# We use the Python version instead of the original version which seems to require Docker
31+
# https://github.com/koalaman/shellcheck-precommit
32+
- repo: https://github.com/shellcheck-py/shellcheck-py
33+
rev: v0.9.0.6
34+
hooks:
35+
- id: shellcheck
36+
name: shellcheck
37+
args: ["--severity=error"]
38+
39+
- repo: https://github.com/codespell-project/codespell
40+
rev: "v2.2.6"
41+
hooks:
42+
- id: codespell
43+
args: ["-L", "te,fo,fle,alo,nin,compres,wil,collone,asess,sav,ot,wll,dne,nulll,hellow"]
44+
exclude: ^(vendor/|benchmark/operation_test.go)
45+
exclude_types: [json,yaml,pem]
46+
47+
- repo: https://github.com/golangci/golangci-lint
48+
rev: v1.55.1
49+
hooks:
50+
- id: golangci-lint

Dockerfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Dockerfile for Go Driver local development.
2+
3+
# Build libmongocrypt in a separate build stage.
4+
FROM ubuntu:20.04 as libmongocrypt
5+
6+
RUN apt-get -qq update && \
7+
apt-get -qqy install --no-install-recommends \
8+
git \
9+
ca-certificates \
10+
curl \
11+
build-essential \
12+
libssl-dev \
13+
python
14+
15+
COPY etc/install-libmongocrypt.sh /root/install-libmongocrypt.sh
16+
RUN cd /root && bash ./install-libmongocrypt.sh
17+
18+
19+
# Inherit from the drivers-evergreen-tools image and copy in the files
20+
# from the libmongocrypt build stage.
21+
FROM drivers-evergreen-tools
22+
23+
# Install common deps.
24+
RUN export DEBIAN_FRONTEND=noninteractive && \
25+
export TZ=Etc/UTC && \
26+
apt-get -qq update && \
27+
apt-get -qqy install --reinstall --no-install-recommends \
28+
tzdata \
29+
ca-certificates \
30+
pkg-config \
31+
software-properties-common \
32+
gpg \
33+
apt-utils \
34+
libc6-dev \
35+
gcc \
36+
make && \
37+
sudo update-ca-certificates && \
38+
rm -rf /var/lib/apt/lists/*
39+
40+
# Install golang from the golang-backports ppa.
41+
RUN export DEBIAN_FRONTEND=noninteractive && \
42+
export TZ=Etc/UTC && \
43+
export LC_ALL=C.UTF-8 && \
44+
sudo -E apt-add-repository "ppa:longsleep/golang-backports" && \
45+
apt-get -qq update && \
46+
apt-get -qqy install --no-install-recommends golang-go && \
47+
rm -rf /var/lib/apt/lists/*
48+
49+
COPY ./etc/docker_entry.sh /root/docker_entry.sh
50+
51+
COPY --from=libmongocrypt /root/install /root/install
52+
53+
ENTRYPOINT ["/bin/bash", "/root/docker_entry.sh"]

0 commit comments

Comments
 (0)