Skip to content

Commit ff9b5d9

Browse files
Merge branch 'master' into DRIVERS-2884-foreground-exp
2 parents 0e0785c + cf0348c commit ff9b5d9

File tree

19 files changed

+1119
-1053
lines changed

19 files changed

+1119
-1053
lines changed

.evergreen/config.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,16 +1362,15 @@ tasks:
13621362
vars:
13631363
MONGO_GO_DRIVER_COMPRESSOR: "snappy"
13641364

1365-
# Build with the oldest supported version of Go.
1365+
# Build the compilecheck submodule with the oldest supported version of Go.
13661366
- name: go1.18-build
13671367
tags: ["compile-check"]
13681368
commands:
13691369
- command: subprocess.exec
13701370
params:
13711371
binary: bash
13721372
env:
1373-
GOROOT: /opt/golang/go1.18
1374-
add_to_path: [/opt/golang/go1.18/bin]
1373+
GO_VERSION: "1.18"
13751374
args: [*task-runner, build-compile-check]
13761375

13771376
# Build with the same Go version that we're using for tests.
@@ -1381,6 +1380,10 @@ tasks:
13811380
- command: subprocess.exec
13821381
params:
13831382
binary: bash
1383+
# Set the GO_VERSION to empty string to use the Go installation in the
1384+
# PATH.
1385+
env:
1386+
GO_VERSION: ""
13841387
args: [*task-runner, build]
13851388

13861389
- name: "atlas-test"
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

Taskfile.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ tasks:
1818
check-license: bash etc/check_license.sh
1919

2020
build:
21-
deps: [cross-compile, build-tests, build-compile-check, install-libmongocrypt]
21+
deps: [install-libmongocrypt]
2222
cmds:
2323
- go build ./...
2424
- go build ${BUILD_TAGS} ./...
25+
- task: build-tests
26+
- task: build-compile-check
27+
- task: cross-compile
2528

2629
build-tests: go test -short ${BUILD_TAGS} -run ^$$ ./...
2730

etc/compile_check.sh

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,41 @@
22
set -e # exit when any command fails
33
set -x # show all commands being run
44

5-
GC=go
5+
# Default to Go 1.18 if GO_VERSION is not set.
6+
#
7+
# Use the "=" operator (instead of the more common ":-" operator) so that it
8+
# allows setting GO_VERSION="" to use the Go installation in the PATH, and it
9+
# sets the GO_VERSION variable if the default is used.
10+
GC=go${GO_VERSION="1.18"}
611
COMPILE_CHECK_DIR="internal/cmd/compilecheck"
7-
# shellcheck disable=SC2034
8-
DEV_MIN_VERSION=1.19
9-
10-
# version will flatten a version string of upto 4 components for inequality
11-
# comparison.
12-
function version {
13-
echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }';
14-
}
1512

1613
# compile_check will attempt to build the internal/test/compilecheck project
1714
# using the provided Go version. This is to simulate an end-to-end use case.
18-
# This check will only run on environments where the Go version is greater than
19-
# or equal to the given version.
2015
function compile_check {
2116
# Change the directory to the compilecheck test directory.
22-
cd ${COMPILE_CHECK_DIR}
17+
pushd ${COMPILE_CHECK_DIR}
2318

24-
MACHINE_VERSION=`${GC} version | { read _ _ v _; echo ${v#go}; }`
19+
# If a custom Go version is set using the GO_VERSION env var (e.g. "1.18"),
20+
# add the GOPATH bin directory to PATH and then install that Go version.
21+
if [ ! -z "$GO_VERSION" ]; then
22+
PATH=$(go env GOPATH)/bin:$PATH
23+
export PATH
2524

26-
# If the version is not 1.13, then run "go mod tidy"
27-
if [ "$(version $MACHINE_VERSION)" -ge "$(version 1.15)" ]; then
28-
go mod tidy
25+
go install golang.org/dl/go$GO_VERSION@latest
26+
${GC} download
2927
fi
3028

29+
${GC} version
30+
${GC} mod tidy
31+
3132
# Check simple build.
3233
${GC} build ./...
3334

3435
# Check build with dynamic linking.
3536
${GC} build -buildmode=plugin
3637

3738
# Check build with tags.
38-
go build $BUILD_TAGS ./...
39+
${GC} build $BUILD_TAGS ./...
3940

4041
# Check build with various architectures.
4142
GOOS=linux GOARCH=386 ${GC} build ./...
@@ -50,7 +51,7 @@ function compile_check {
5051
rm compilecheck.so
5152

5253
# Change the directory back to the working directory.
53-
cd -
54+
popd
5455
}
5556

5657
compile_check

examples/_logger/logrus/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
require (
1414
github.com/go-logr/logr v1.2.3 // indirect
1515
github.com/golang/snappy v0.0.4 // indirect
16-
github.com/klauspost/compress v1.13.6 // indirect
16+
github.com/klauspost/compress v1.16.7 // indirect
1717
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
1818
github.com/xdg-go/scram v1.1.2 // indirect
1919
github.com/xdg-go/stringprep v1.0.4 // indirect

examples/_logger/logrus/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
99
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
1010
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
1111
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
12-
github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
13-
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
12+
github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
13+
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
1414
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1515
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1616
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=

examples/_logger/zap/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
require (
1414
github.com/go-logr/logr v1.2.2 // indirect
1515
github.com/golang/snappy v0.0.4 // indirect
16-
github.com/klauspost/compress v1.13.6 // indirect
16+
github.com/klauspost/compress v1.16.7 // indirect
1717
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
1818
github.com/xdg-go/scram v1.1.2 // indirect
1919
github.com/xdg-go/stringprep v1.0.4 // indirect

examples/_logger/zap/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
1111
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
1212
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
1313
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
14-
github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
15-
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
14+
github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
15+
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
1616
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
1717
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
1818
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=

examples/_logger/zerolog/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
require (
1414
github.com/go-logr/logr v1.2.3 // indirect
1515
github.com/golang/snappy v0.0.4 // indirect
16-
github.com/klauspost/compress v1.13.6 // indirect
16+
github.com/klauspost/compress v1.16.7 // indirect
1717
github.com/mattn/go-colorable v0.1.12 // indirect
1818
github.com/mattn/go-isatty v0.0.14 // indirect
1919
github.com/xdg-go/pbkdf2 v1.0.0 // indirect

examples/_logger/zerolog/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
1010
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
1111
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
1212
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
13-
github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
14-
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
13+
github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
14+
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
1515
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
1616
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
1717
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=

0 commit comments

Comments
 (0)