Skip to content

Commit 73f684f

Browse files
Merge branch 'master' into merge-release/2.3-into-master-1757005613010
2 parents f76320a + f498cc7 commit 73f684f

30 files changed

+617
-1294
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
steps:
3636
- name: Checkout repository
37-
uses: actions/checkout@v4
37+
uses: actions/checkout@v5
3838

3939
# Initializes the CodeQL tools for scanning.
4040
- name: Initialize CodeQL

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
steps:
3636
- name: "Checkout code"
37-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
uses: actions/checkout@v5
3838
with:
3939
persist-credentials: false
4040

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
pre_commit:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020
- uses: actions/setup-python@v5
2121
- uses: actions/setup-go@v5
2222
with:

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ repos:
4949
hooks:
5050
- id: markdown-link-check
5151
exclude: ^(vendor)
52+
# Retry when the endpoint returns HTTP 429 (Too Many Requests)
53+
args: [-r]
5254

5355
- repo: local
5456
hooks:

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Make sure to defer a call to `Disconnect` after instantiating your client:
6363

6464
```go
6565
defer func() {
66-
if err = client.Disconnect(ctx); err != nil {
66+
if err := client.Disconnect(ctx); err != nil {
6767
panic(err)
6868
}
6969
}()
@@ -75,7 +75,7 @@ Calling `Connect` does not block for server discovery. If you wish to know if a
7575
use the `Ping` method:
7676

7777
```go
78-
ctx, cancel = context.WithTimeout(context.Background(), 2*time.Second)
78+
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
7979
defer cancel()
8080

8181
_ = client.Ping(ctx, readpref.Primary())
@@ -90,7 +90,7 @@ collection := client.Database("testing").Collection("numbers")
9090
The `Collection` instance can then be used to insert documents:
9191

9292
```go
93-
ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
93+
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
9494
defer cancel()
9595

9696
res, _ := collection.InsertOne(ctx, bson.D{{"name", "pi"}, {"value", 3.14159}})
@@ -117,7 +117,7 @@ import (
117117
Several query methods return a cursor, which can be used like this:
118118

119119
```go
120-
ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second)
120+
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
121121
defer cancel()
122122

123123
cur, err := collection.Find(ctx, bson.D{})
@@ -148,10 +148,10 @@ var result struct {
148148
}
149149

150150
filter := bson.D{{"name", "pi"}}
151-
ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
151+
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
152152
defer cancel()
153153

154-
err = collection.FindOne(ctx, filter).Decode(&result)
154+
err := collection.FindOne(ctx, filter).Decode(&result)
155155
if errors.Is(err, mongo.ErrNoDocuments) {
156156
// Do something when no record was found
157157
} else if err != nil {

etc/perf-pr-comment.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@
44

55
set -eux
66

7-
pushd ./internal/cmd/perfcomp >/dev/null || exist
8-
GOWORK=off go build -o ../../../bin/perfcomp .
9-
popd >/dev/null
10-
11-
# Generate perf report.
12-
GOWORK=off ./bin/perfcomp compare --project="mongo-go-driver" ${VERSION_ID} > ./internal/cmd/perfcomp/perf-report.txt
7+
pushd $DRIVERS_TOOLS/.evergreen >/dev/null
8+
PROJECT="mongo-go-driver" CONTEXT="GoDriver perf task" TASK="perf" VARIANT="perf" sh run-perf-comp.sh
139

1410
if [[ -n "${BASE_SHA+set}" && -n "${HEAD_SHA+set}" && "$BASE_SHA" != "$HEAD_SHA" ]]; then
15-
# Parse and generate perf comparison comment.
16-
GOWORK=off ./bin/perfcomp mdreport
1711
# Make the PR comment.
18-
target=$DRIVERS_TOOLS/.evergreen/github_app/create_or_modify_comment.sh
19-
bash $target -m "## 🧪 Performance Results" -c "$(pwd)/perf-report.md" -h $HEAD_SHA -o "mongodb" -n "mongo-go-driver"
20-
rm ./perf-report.md
12+
target=github_app/create_or_modify_comment.sh
13+
bash $target -m "## 🧪 Performance Results" -c "$(pwd)/perfcomp/perf-report.md" -h $HEAD_SHA -o "mongodb" -n "mongo-go-driver"
14+
rm ./perfcomp/perf-report.md
2115
else
2216
# Skip comment if it isn't a PR run.
2317
echo "Skipping Perf PR comment"
2418
fi
2519

26-
rm ./internal/cmd/perfcomp/perf-report.txt
20+
popd >/dev/null

0 commit comments

Comments
 (0)