Skip to content

Commit 39559d6

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver
2 parents c5ca1f2 + d0b0dc3 commit 39559d6

File tree

10 files changed

+171
-31
lines changed

10 files changed

+171
-31
lines changed

.evergreen/generated_configs/functions.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,45 @@ functions:
162162

163163
# Send dashboard data
164164
send dashboard data:
165-
- command: perf.send
165+
- command: subprocess.exec
166+
params:
167+
binary: bash
168+
args:
169+
- .evergreen/scripts/perf-submission-setup.sh
170+
working_dir: src
171+
include_expansions_in_env:
172+
- requester
173+
- revision_order_id
174+
- project_id
175+
- version_id
176+
- build_variant
177+
- parsed_order_id
178+
- task_name
179+
- task_id
180+
- execution
181+
- is_mainline
182+
type: test
183+
- command: expansions.update
166184
params:
167-
file: src/results.json
185+
file: src/expansion.yml
186+
- command: subprocess.exec
187+
params:
188+
binary: bash
189+
args:
190+
- .evergreen/scripts/perf-submission.sh
191+
working_dir: src
192+
include_expansions_in_env:
193+
- requester
194+
- revision_order_id
195+
- project_id
196+
- version_id
197+
- build_variant
198+
- parsed_order_id
199+
- task_name
200+
- task_id
201+
- execution
202+
- is_mainline
203+
type: test
168204

169205
# Setup system
170206
setup system:

.evergreen/generated_configs/tasks.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ tasks:
134134
commands:
135135
- func: download and merge coverage
136136
depends_on: [{ name: .server-version, variant: .coverage_tag, status: "*", patch_optional: true }]
137-
tags: [coverage]
137+
tags: [coverage, pr]
138138

139139
# Free threading tests
140140
- name: test-free-threading
@@ -211,7 +211,7 @@ tasks:
211211
TEST_NAME: mod_wsgi
212212
SUB_TEST_NAME: standalone
213213
PYTHON_VERSION: "3.9"
214-
tags: [mod_wsgi]
214+
tags: [mod_wsgi, pr]
215215
- name: mod-wsgi-embedded-mode-replica-set-python3.10
216216
commands:
217217
- func: run server
@@ -223,7 +223,7 @@ tasks:
223223
TEST_NAME: mod_wsgi
224224
SUB_TEST_NAME: embedded
225225
PYTHON_VERSION: "3.10"
226-
tags: [mod_wsgi]
226+
tags: [mod_wsgi, pr]
227227
- name: mod-wsgi-replica-set-python3.11
228228
commands:
229229
- func: run server
@@ -235,7 +235,7 @@ tasks:
235235
TEST_NAME: mod_wsgi
236236
SUB_TEST_NAME: standalone
237237
PYTHON_VERSION: "3.11"
238-
tags: [mod_wsgi]
238+
tags: [mod_wsgi, pr]
239239
- name: mod-wsgi-embedded-mode-replica-set-python3.12
240240
commands:
241241
- func: run server
@@ -247,7 +247,7 @@ tasks:
247247
TEST_NAME: mod_wsgi
248248
SUB_TEST_NAME: embedded
249249
PYTHON_VERSION: "3.12"
250-
tags: [mod_wsgi]
250+
tags: [mod_wsgi, pr]
251251
- name: mod-wsgi-replica-set-python3.13
252252
commands:
253253
- func: run server
@@ -259,7 +259,7 @@ tasks:
259259
TEST_NAME: mod_wsgi
260260
SUB_TEST_NAME: standalone
261261
PYTHON_VERSION: "3.13"
262-
tags: [mod_wsgi]
262+
tags: [mod_wsgi, pr]
263263

264264
# No orchestration tests
265265
- name: test-no-orchestration-python3.9
@@ -2490,6 +2490,7 @@ tasks:
24902490
- python-3.9
24912491
- standalone-noauth-nossl
24922492
- sync
2493+
- pr
24932494
- name: test-server-version-python3.10-async-noauth-nossl-standalone-cov
24942495
commands:
24952496
- func: run server
@@ -2511,6 +2512,7 @@ tasks:
25112512
- python-3.10
25122513
- standalone-noauth-nossl
25132514
- async
2515+
- pr
25142516
- name: test-server-version-python3.11-sync-auth-ssl-replica-set-cov
25152517
commands:
25162518
- func: run server
@@ -2656,6 +2658,7 @@ tasks:
26562658
- python-3.11
26572659
- replica_set-noauth-nossl
26582660
- sync
2661+
- pr
26592662
- name: test-server-version-python3.12-async-noauth-nossl-replica-set-cov
26602663
commands:
26612664
- func: run server
@@ -2677,6 +2680,7 @@ tasks:
26772680
- python-3.12
26782681
- replica_set-noauth-nossl
26792682
- async
2683+
- pr
26802684
- name: test-server-version-python3.13-sync-auth-ssl-sharded-cluster-cov
26812685
commands:
26822686
- func: run server
@@ -2698,6 +2702,7 @@ tasks:
26982702
- python-3.13
26992703
- sharded_cluster-auth-ssl
27002704
- sync
2705+
- pr
27012706
- name: test-server-version-pypy3.10-async-auth-ssl-sharded-cluster
27022707
commands:
27032708
- func: run server
@@ -2717,6 +2722,7 @@ tasks:
27172722
- python-pypy3.10
27182723
- sharded_cluster-auth-ssl
27192724
- async
2725+
- pr
27202726
- name: test-server-version-python3.9-sync-auth-nossl-sharded-cluster-cov
27212727
commands:
27222728
- func: run server
@@ -3611,6 +3617,7 @@ tasks:
36113617
- python-3.13
36123618
- standalone-noauth-nossl
36133619
- sync
3620+
- pr
36143621
- name: test-standard-latest-python3.9-async-noauth-ssl-replica-set
36153622
commands:
36163623
- func: run server
@@ -3633,6 +3640,7 @@ tasks:
36333640
- python-3.9
36343641
- replica_set-noauth-ssl
36353642
- async
3643+
- pr
36363644
- name: test-standard-latest-python3.10-sync-auth-ssl-sharded-cluster
36373645
commands:
36383646
- func: run server
@@ -3655,6 +3663,7 @@ tasks:
36553663
- python-3.10
36563664
- sharded_cluster-auth-ssl
36573665
- sync
3666+
- pr
36583667
- name: test-standard-v4.0-pypy3.10-sync-noauth-nossl-standalone
36593668
commands:
36603669
- func: run server
@@ -4389,6 +4398,7 @@ tasks:
43894398
- python-3.13
43904399
- standalone-noauth-nossl
43914400
- noauth
4401+
- pr
43924402
- name: test-non-standard-latest-python3.9-noauth-ssl-replica-set
43934403
commands:
43944404
- func: run server
@@ -4410,6 +4420,7 @@ tasks:
44104420
- python-3.9
44114421
- replica_set-noauth-ssl
44124422
- noauth
4423+
- pr
44134424
- name: test-non-standard-latest-python3.10-auth-ssl-sharded-cluster
44144425
commands:
44154426
- func: run server
@@ -4431,6 +4442,7 @@ tasks:
44314442
- python-3.10
44324443
- sharded_cluster-auth-ssl
44334444
- auth
4445+
- pr
44344446
- name: test-non-standard-v4.0-pypy3.10-noauth-nossl-standalone
44354447
commands:
44364448
- func: run server

.evergreen/scripts/generate_config.py

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
ec2_assume_role,
4242
expansions_update,
4343
git_get_project,
44-
perf_send,
4544
)
4645
from shrub.v3.evg_task import EvgTask, EvgTaskDependency, EvgTaskRef
4746

@@ -553,8 +552,19 @@ def create_server_version_tasks():
553552
task_inputs.append(task_input)
554553

555554
# Assemble the tasks.
555+
seen = set()
556556
for topology, auth, ssl, sync, python in task_inputs:
557-
tags = ["server-version", f"python-{python}", f"{topology}-{auth}-{ssl}", sync]
557+
combo = f"{topology}-{auth}-{ssl}"
558+
tags = ["server-version", f"python-{python}", combo, sync]
559+
if combo in [
560+
"standalone-noauth-nossl",
561+
"replica_set-noauth-nossl",
562+
"sharded_cluster-auth-ssl",
563+
]:
564+
combo = f"{combo}-{sync}"
565+
if combo not in seen:
566+
seen.add(combo)
567+
tags.append("pr")
558568
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology)
559569
if python not in PYPYS:
560570
expansions["COVERAGE"] = "1"
@@ -593,11 +603,12 @@ def create_test_non_standard_tasks():
593603
task_combos = []
594604
# For each version and topology, rotate through the CPythons.
595605
for (version, topology), python in zip_cycle(list(product(ALL_VERSIONS, TOPOLOGIES)), CPYTHONS):
596-
task_combos.append((version, topology, python))
606+
pr = version == "latest"
607+
task_combos.append((version, topology, python, pr))
597608
# For each PyPy and topology, rotate through the the versions.
598609
for (python, topology), version in zip_cycle(list(product(PYPYS, TOPOLOGIES)), ALL_VERSIONS):
599-
task_combos.append((version, topology, python))
600-
for version, topology, python in task_combos:
610+
task_combos.append((version, topology, python, False))
611+
for version, topology, python, pr in task_combos:
601612
auth, ssl = get_standard_auth_ssl(topology)
602613
tags = [
603614
"test-non-standard",
@@ -608,6 +619,8 @@ def create_test_non_standard_tasks():
608619
]
609620
if python in PYPYS:
610621
tags.append("pypy")
622+
if pr:
623+
tags.append("pr")
611624
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology, VERSION=version)
612625
name = get_task_name("test-non-standard", python=python, **expansions)
613626
server_func = FunctionCall(func="run server", vars=expansions)
@@ -626,14 +639,15 @@ def create_standard_tasks():
626639
for (version, topology), python, sync in zip_cycle(
627640
list(product(ALL_VERSIONS, TOPOLOGIES)), CPYTHONS, SYNCS
628641
):
629-
task_combos.append((version, topology, python, sync))
642+
pr = version == "latest"
643+
task_combos.append((version, topology, python, sync, pr))
630644
# For each PyPy and topology, rotate through the the versions and sync/async.
631645
for (python, topology), version, sync in zip_cycle(
632646
list(product(PYPYS, TOPOLOGIES)), ALL_VERSIONS, SYNCS
633647
):
634-
task_combos.append((version, topology, python, sync))
648+
task_combos.append((version, topology, python, sync, False))
635649

636-
for version, topology, python, sync in task_combos:
650+
for version, topology, python, sync, pr in task_combos:
637651
auth, ssl = get_standard_auth_ssl(topology)
638652
tags = [
639653
"test-standard",
@@ -644,6 +658,8 @@ def create_standard_tasks():
644658
]
645659
if python in PYPYS:
646660
tags.append("pypy")
661+
if pr:
662+
tags.append("pr")
647663
expansions = dict(AUTH=auth, SSL=ssl, TOPOLOGY=topology, VERSION=version)
648664
name = get_task_name("test-standard", python=python, sync=sync, **expansions)
649665
server_func = FunctionCall(func="run server", vars=expansions)
@@ -758,7 +774,7 @@ def create_mod_wsgi_tasks():
758774
server_func = FunctionCall(func="run server", vars=server_vars)
759775
vars = dict(TEST_NAME="mod_wsgi", SUB_TEST_NAME=test.split("-")[0], PYTHON_VERSION=python)
760776
test_func = FunctionCall(func="run tests", vars=vars)
761-
tags = ["mod_wsgi"]
777+
tags = ["mod_wsgi", "pr"]
762778
commands = [server_func, test_func]
763779
tasks.append(EvgTask(name=task_name, tags=tags, commands=commands))
764780
return tasks
@@ -843,7 +859,7 @@ def create_getdata_tasks():
843859

844860

845861
def create_coverage_report_tasks():
846-
tags = ["coverage"]
862+
tags = ["coverage", "pr"]
847863
task_name = "coverage-report"
848864
# BUILD-3165: We can't use "*" (all tasks) and specify "variant".
849865
# Instead list out all coverage tasks using tags.
@@ -1103,8 +1119,28 @@ def create_attach_benchmark_test_results_func():
11031119

11041120

11051121
def create_send_dashboard_data_func():
1106-
cmd = perf_send(file="src/results.json")
1107-
return "send dashboard data", [cmd]
1122+
includes = [
1123+
"requester",
1124+
"revision_order_id",
1125+
"project_id",
1126+
"version_id",
1127+
"build_variant",
1128+
"parsed_order_id",
1129+
"task_name",
1130+
"task_id",
1131+
"execution",
1132+
"is_mainline",
1133+
]
1134+
cmds = [
1135+
get_subprocess_exec(
1136+
include_expansions_in_env=includes, args=[".evergreen/scripts/perf-submission-setup.sh"]
1137+
),
1138+
expansions_update(file="src/expansion.yml"),
1139+
get_subprocess_exec(
1140+
include_expansions_in_env=includes, args=[".evergreen/scripts/perf-submission.sh"]
1141+
),
1142+
]
1143+
return "send dashboard data", cmds
11081144

11091145

11101146
mod = sys.modules[__name__]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# We use the requester expansion to determine whether the data is from a mainline evergreen run or not
3+
4+
set -eu
5+
6+
# shellcheck disable=SC2154
7+
if [ "${requester}" == "commit" ]; then
8+
echo "is_mainline: true" >> expansion.yml
9+
else
10+
echo "is_mainline: false" >> expansion.yml
11+
fi
12+
13+
# We parse the username out of the order_id as patches append that in and SPS does not need that information
14+
# shellcheck disable=SC2154
15+
echo "parsed_order_id: $(echo "${revision_order_id}" | awk -F'_' '{print $NF}')" >> expansion.yml

.evergreen/scripts/perf-submission.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
# We use the requester expansion to determine whether the data is from a mainline evergreen run or not
3+
4+
set -eu
5+
6+
# Submit the performance data to the SPS endpoint
7+
# shellcheck disable=SC2154
8+
response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
9+
"https://performance-monitoring-api.corp.mongodb.com/raw_perf_results/cedar_report?project=${project_id}&version=${version_id}&variant=${build_variant}&order=${parsed_order_id}&task_name=${task_name}&task_id=${task_id}&execution=${execution}&mainline=${is_mainline}" \
10+
-H 'accept: application/json' \
11+
-H 'Content-Type: application/json' \
12+
-d @results.json)
13+
14+
http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
15+
response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
16+
17+
# We want to throw an error if the data was not successfully submitted
18+
if [ "$http_status" -ne 200 ]; then
19+
echo "Error: Received HTTP status $http_status"
20+
echo "Response Body: $response_body"
21+
exit 1
22+
fi
23+
24+
echo "Response Body: $response_body"
25+
echo "HTTP Status: $http_status"

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3
49+
uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3
5050
with:
5151
languages: ${{ matrix.language }}
5252
build-mode: ${{ matrix.build-mode }}
@@ -63,6 +63,6 @@ jobs:
6363
pip install -e .
6464
6565
- name: Perform CodeQL Analysis
66-
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3
66+
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3
6767
with:
6868
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)