Skip to content

Commit beed31e

Browse files
Merge branch 'master' into fix-wiremessage-oob
2 parents 9eab72a + aa5b2d9 commit beed31e

File tree

34 files changed

+326
-550
lines changed

34 files changed

+326
-550
lines changed

.evergreen/config.yml

Lines changed: 33 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ timeout:
2626
args: [ls, -la]
2727

2828
functions:
29+
assume-test-secrets-ec2-role:
30+
- command: ec2.assume_role
31+
params:
32+
role_arn: ${aws_test_secrets_role}
33+
2934
setup-system:
3035
# Executes clone and applies the submitted patch, if any
3136
- command: git.get_project
@@ -109,9 +114,13 @@ functions:
109114
display_name: test_suite.tgz
110115

111116
bootstrap-mongohoused:
117+
- command: ec2.assume_role
118+
params:
119+
role_arn: ${aws_test_secrets_role}
112120
- command: subprocess.exec
113121
params:
114122
binary: bash
123+
add_expansions_to_env: true
115124
args:
116125
- ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/pull-mongohouse-image.sh
117126
- command: subprocess.exec
@@ -204,6 +213,7 @@ functions:
204213
type: test
205214
params:
206215
binary: bash
216+
add_expansions_to_env: true
207217
env:
208218
BASE_SHA: "${revision}"
209219
HEAD_SHA: "${github_commit}"
@@ -214,6 +224,7 @@ functions:
214224
type: test
215225
params:
216226
binary: bash
227+
add_expansions_to_env: true
217228
env:
218229
COMMIT: "${github_commit}"
219230
PR_TASK: apply-labels
@@ -224,6 +235,7 @@ functions:
224235
type: test
225236
params:
226237
binary: bash
238+
add_expansions_to_env: true
227239
env:
228240
COMMIT: "${github_commit}"
229241
PR_TASK: assign-reviewer
@@ -376,20 +388,6 @@ functions:
376388
binary: bash
377389
args: [*task-runner, evg-test-load-balancers]
378390

379-
run-serverless-tests:
380-
- command: subprocess.exec
381-
type: test
382-
params:
383-
binary: "bash"
384-
env:
385-
SERVERLESS: "serverless"
386-
args: [*task-runner, setup-test]
387-
- command: subprocess.exec
388-
type: test
389-
params:
390-
binary: "bash"
391-
args: [*task-runner, evg-test-serverless]
392-
393391
run-atlas-data-lake-test:
394392
- command: subprocess.exec
395393
type: test
@@ -652,6 +650,7 @@ tasks:
652650
- name: pull-request-helpers
653651
allowed_requesters: ["patch", "github_pr"]
654652
commands:
653+
- func: assume-test-secrets-ec2-role
655654
- func: "add PR reviewer"
656655
- func: "add PR labels"
657656
- func: "create-api-report"
@@ -1606,14 +1605,6 @@ tasks:
16061605
- func: start-cse-servers
16071606
- func: run-retry-kms-requests
16081607

1609-
- name: "test-serverless"
1610-
tags: ["serverless"]
1611-
commands:
1612-
- func: start-cse-servers
1613-
- func: "run-serverless-tests"
1614-
vars:
1615-
MONGO_GO_DRIVER_COMPRESSOR: "snappy"
1616-
16171608
- name: "testgcpkms-task"
16181609
commands:
16191610
- command: subprocess.exec
@@ -1636,20 +1627,24 @@ tasks:
16361627

16371628
- name: "testawskms-task"
16381629
commands:
1630+
- func: assume-test-secrets-ec2-role
16391631
- command: subprocess.exec
16401632
type: test
16411633
params:
16421634
binary: "bash"
1635+
add_expansions_to_env: true
16431636
args: [*task-runner, test-awskms]
16441637

16451638
- name: "testawskms-fail-task"
16461639
# testawskms-fail-task runs without environment variables.
16471640
# It is expected to fail to obtain credentials.
16481641
commands:
1642+
- func: assume-test-secrets-ec2-role
16491643
- command: subprocess.exec
16501644
type: test
16511645
params:
16521646
binary: "bash"
1647+
add_expansions_to_env: true
16531648
env:
16541649
EXPECT_ERROR: 'status=400'
16551650
args: [*task-runner, test-awskms]
@@ -1660,16 +1655,19 @@ tasks:
16601655
type: test
16611656
params:
16621657
binary: bash
1658+
add_expansions_to_env: true
16631659
args: [*task-runner, test-azurekms]
16641660

16651661
- name: "testazurekms-fail-task"
16661662
# testazurekms-fail-task runs without environment variables.
16671663
# It is expected to fail to obtain credentials.
16681664
commands:
1665+
- func: assume-test-secrets-ec2-role
16691666
- command: subprocess.exec
16701667
type: test
16711668
params:
16721669
binary: bash
1670+
add_expansions_to_env: true
16731671
env:
16741672
EXPECT_ERROR: "1"
16751673
args: [*task-runner, test-azurekms]
@@ -1681,19 +1679,15 @@ tasks:
16811679

16821680
- name: "test-aws-lambda-deployed"
16831681
commands:
1684-
- command: ec2.assume_role
1685-
params:
1686-
role_arn: ${LAMBDA_AWS_ROLE_ARN}
1687-
duration_seconds: 3600
16881682
- command: subprocess.exec
16891683
type: test
16901684
params:
16911685
binary: bash
1686+
add_expansions_to_env: true
16921687
env:
16931688
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/internal/cmd/faas/awslambda
16941689
LAMBDA_STACK_NAME: dbx-go-lambda
16951690
AWS_REGION: us-east-1
1696-
include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"]
16971691
args: [*task-runner, evg-test-deployed-lambda-aws]
16981692

16991693
- name: "oidc-auth-test"
@@ -1896,49 +1890,17 @@ axes:
18961890
variables:
18971891
GO_DIST: "/opt/golang/go1.23"
18981892

1899-
- id: os-serverless
1900-
display_name: OS
1901-
values:
1902-
- id: "rhel87"
1903-
display_name: "RHEL 8.7"
1904-
run_on: rhel8.7-small
1905-
variables:
1906-
GO_DIST: "/opt/golang/go1.23"
1907-
19081893
task_groups:
1909-
- name: serverless_task_group
1910-
setup_group_can_fail_task: true
1911-
setup_group_timeout_secs: 1800 # 30 minutes
1912-
setup_group:
1913-
- func: setup-system
1914-
- command: subprocess.exec
1915-
params:
1916-
binary: "bash"
1917-
args:
1918-
- ${DRIVERS_TOOLS}/.evergreen/serverless/setup.sh
1919-
- command: expansions.update
1920-
params:
1921-
file: serverless-expansion.yml
1922-
teardown_group:
1923-
- command: subprocess.exec
1924-
params:
1925-
binary: "bash"
1926-
args:
1927-
- ${DRIVERS_TOOLS}/.evergreen/serverless/teardown.sh
1928-
- func: teardown
1929-
- func: handle-test-artifacts
1930-
1931-
tasks:
1932-
- ".serverless"
1933-
19341894
- name: testgcpkms_task_group
19351895
setup_group_can_fail_task: true
19361896
setup_group_timeout_secs: 1800 # 30 minutes
19371897
setup_group:
19381898
- func: setup-system
1899+
- func: assume-test-secrets-ec2-role
19391900
- command: subprocess.exec
19401901
params:
19411902
binary: "bash"
1903+
add_expansions_to_env: true
19421904
args:
19431905
- ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/setup.sh
19441906
teardown_group:
@@ -1958,9 +1920,11 @@ task_groups:
19581920
setup_group_timeout_secs: 1800 # 30 minutes
19591921
setup_group:
19601922
- func: setup-system
1923+
- func: assume-test-secrets-ec2-role
19611924
- command: subprocess.exec
19621925
params:
19631926
binary: bash
1927+
add_expansions_to_env: true
19641928
env:
19651929
AZUREKMS_VMNAME_PREFIX: GODRIVER
19661930
args:
@@ -2013,9 +1977,11 @@ task_groups:
20131977
teardown_group_timeout_secs: 180 # 3 minutes (max allowed time)
20141978
setup_group:
20151979
- func: setup-system
1980+
- func: assume-test-secrets-ec2-role
20161981
- command: subprocess.exec
20171982
params:
20181983
binary: bash
1984+
add_expansions_to_env: true
20191985
env:
20201986
AZUREOIDC_VMNAME_PREFIX: "GO_DRIVER"
20211987
args:
@@ -2038,9 +2004,11 @@ task_groups:
20382004
teardown_group_timeout_secs: 180 # 3 minutes (max allowed time)
20392005
setup_group:
20402006
- func: setup-system
2007+
- func: assume-test-secrets-ec2-role
20412008
- command: subprocess.exec
20422009
params:
20432010
binary: bash
2011+
add_expansions_to_env: true
20442012
env:
20452013
AZUREOIDC_VMNAME_PREFIX: "GO_DRIVER"
20462014
args:
@@ -2063,6 +2031,7 @@ task_groups:
20632031
teardown_group_timeout_secs: 180 # 3 minutes (max allowed time)
20642032
setup_group:
20652033
- func: setup-system
2034+
- func: assume-test-secrets-ec2-role
20662035
- command: subprocess.exec
20672036
params:
20682037
binary: bash
@@ -2083,10 +2052,12 @@ task_groups:
20832052
- name: test-aws-lambda-task-group
20842053
setup_group:
20852054
- func: setup-system
2055+
- func: assume-test-secrets-ec2-role
20862056
- command: subprocess.exec
20872057
params:
20882058
working_dir: src/go.mongodb.org/mongo-driver
20892059
binary: bash
2060+
add_expansions_to_env: true
20902061
env:
20912062
LAMBDA_STACK_NAME: dbx-go-lambda
20922063
args:
@@ -2096,6 +2067,7 @@ task_groups:
20962067
params:
20972068
working_dir: src/go.mongodb.org/mongo-driver
20982069
binary: bash
2070+
add_expansions_to_env: true
20992071
env:
21002072
LAMBDA_STACK_NAME: dbx-go-lambda
21012073
AWS_REGION: us-east-1
@@ -2340,13 +2312,6 @@ buildvariants:
23402312
tasks:
23412313
- name: ".load-balancer"
23422314

2343-
- matrix_name: "serverless"
2344-
tags: ["pullrequest"]
2345-
matrix_spec: { os-serverless: "*" }
2346-
display_name: "Serverless ${os-serverless}"
2347-
tasks:
2348-
- "serverless_task_group"
2349-
23502315
- matrix_name: "kms-kmip-test"
23512316
matrix_spec: { version: ["7.0"], os-ssl-40: ["rhel87-64"] }
23522317
display_name: "KMS KMIP ${os-ssl-40}"

.github/workflows/scorecard.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: Scorecard supply-chain security
6+
on:
7+
# For Branch-Protection check. Only the default branch is supported. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9+
branch_protection_rule:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '24 21 * * 1'
14+
push:
15+
branches: [ "master" ]
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
jobs:
21+
analysis:
22+
name: Scorecard analysis
23+
runs-on: ubuntu-latest
24+
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
25+
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
26+
permissions:
27+
# Needed to upload the results to code-scanning dashboard.
28+
security-events: write
29+
# Needed to publish results and get a badge (see publish_results below).
30+
id-token: write
31+
# Uncomment the permissions below if installing in a private repository.
32+
# contents: read
33+
# actions: read
34+
35+
steps:
36+
- name: "Checkout code"
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
with:
39+
persist-credentials: false
40+
41+
- name: "Run analysis"
42+
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
43+
with:
44+
results_file: results.sarif
45+
results_format: sarif
46+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
47+
# - you want to enable the Branch-Protection check on a *public* repository, or
48+
# - you are installing Scorecard on a *private* repository
49+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
50+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
51+
52+
# Public repositories:
53+
# - Publish results to OpenSSF REST API for easy access by consumers
54+
# - Allows the repository to include the Scorecard badge.
55+
# - See https://github.com/ossf/scorecard-action#publishing-results.
56+
# For private repositories:
57+
# - `publish_results` will always be set to `false`, regardless
58+
# of the value entered here.
59+
publish_results: true
60+
61+
# (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
62+
# file_mode: git
63+
64+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
65+
# format to the repository Actions tab.
66+
- name: "Upload artifact"
67+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
68+
with:
69+
name: SARIF file
70+
path: results.sarif
71+
retention-days: 5
72+
73+
# Upload the results to GitHub's code scanning dashboard (optional).
74+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
75+
- name: "Upload to code-scanning"
76+
uses: github/codeql-action/upload-sarif@v3
77+
with:
78+
sarif_file: results.sarif

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,9 @@ repos:
6565
require_serial: true
6666
pass_filenames: false
6767
entry: etc/golangci-lint.sh
68+
69+
- id: check-licenses
70+
name: check-licenses
71+
language: system
72+
types: [go]
73+
entry: etc/check_license.sh

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<a href="https://pkg.go.dev/go.mongodb.org/mongo-driver/v2/mongo"><img src="etc/assets/godev-mongo-blue.svg" alt="docs"></a>
55
<a href="https://pkg.go.dev/go.mongodb.org/mongo-driver/v2/bson"><img src="etc/assets/godev-bson-blue.svg" alt="docs"></a>
66
<a href="https://www.mongodb.com/docs/drivers/go/current/"><img src="etc/assets/docs-mongodb-green.svg"></a>
7+
<a href="https://securityscorecards.dev/viewer/?uri=github.com/mongodb/mongo-go-driver">
8+
<img src="https://api.securityscorecards.dev/projects/github.com/mongodb/mongo-go-driver/badge" alt="OpenSSF Scorecard" />
9+
</a>
710
</p>
811

912
# MongoDB Go Driver

0 commit comments

Comments
 (0)