Skip to content

Commit 863704e

Browse files
authored
Merge branch 'master' into backpressure
2 parents d864822 + 08b806f commit 863704e

16 files changed

Lines changed: 2161 additions & 127 deletions

.evergreen/spec-patch/PYTHON-5668.patch

Lines changed: 1578 additions & 0 deletions
Large diffs are not rendered by default.

.evergreen/spec-patch/PYTHON-5759.patch

Lines changed: 460 additions & 0 deletions
Large diffs are not rendered by default.

.github/copilot-instructions.md

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,3 @@
1-
When reviewing code, focus on:
1+
Please see [AGENTS.md](../AGENTS.md).
22

3-
## Security Critical Issues
4-
- Check for hardcoded secrets, API keys, or credentials.
5-
- Check for instances of potential method call injection, dynamic code execution, symbol injection or other code injection vulnerabilities.
6-
7-
## Performance Red Flags
8-
- Spot inefficient loops and algorithmic issues.
9-
- Check for memory leaks and resource cleanup.
10-
11-
## Code Quality Essentials
12-
- Methods should be focused and appropriately sized. If a method is doing too much, suggest refactorings to split it up.
13-
- Use clear, descriptive naming conventions.
14-
- Avoid encapsulation violations and ensure proper separation of concerns.
15-
- All public classes, modules, and methods should have clear documentation in Sphinx format.
16-
17-
## PyMongo-specific Concerns
18-
- Do not review files within `pymongo/synchronous` or files in `test/` that also have a file of the same name in `test/asynchronous` unless the reviewed changes include a `_IS_SYNC` statement. PyMongo generates these files from `pymongo/asynchronous` and `test/asynchronous` using `tools/synchro.py`.
19-
- All asynchronous functions must not call any blocking I/O.
20-
21-
## Review Style
22-
- Be specific and actionable in feedback.
23-
- Explain the "why" behind recommendations.
24-
- Acknowledge good patterns when you see them.
25-
- Ask clarifying questions when code intent is unclear.
26-
27-
Always prioritize security vulnerabilities and performance issues that could impact users.
28-
29-
Always suggest changes to improve readability and testability. For example, this suggestion seeks to make the code more readable, reusable, and testable:
30-
31-
```python
32-
# Instead of:
33-
if user.email and "@" in user.email and len(user.email) > 5:
34-
submit_button.enabled = True
35-
else:
36-
submit_button.enabled = False
37-
38-
# Consider:
39-
def valid_email(email):
40-
return email and "@" in email and len(email) > 5
41-
42-
43-
submit_button.enabled = valid_email(user.email)
44-
```
3+
Follow the repository instructions defined in `AGENTS.md` when working in this codebase.

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ If you are an external contributor and there is no JIRA ticket associated with y
66
for the PR title. A MongoDB employee will create a JIRA ticket and edit the name and links as appropriate.
77
88
Note on AI Contributions:
9-
We do not accept pull requests that are primarily or substantially generated by AI tools (ChatGPT, Copilot, etc.).
10-
All contributions must be written and understood by human contributors.
9+
We only accept pull requests that are authored and submitted by human contributors who fully understand the changes they are proposing.
10+
All contributions must be written and understood by human contributors. Please read about our policy in our contributing guide.
1111
-->
1212
[JIRA TICKET]
1313

.github/workflows/dist.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161

6262
- name: Set up QEMU
6363
if: runner.os == 'Linux'
64-
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
64+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
6565
with:
6666
# setup-qemu-action by default uses `tonistiigi/binfmt:latest` image,
6767
# which is out of date. This causes seg faults during build.
@@ -92,7 +92,7 @@ jobs:
9292
# Free-threading builds:
9393
ls wheelhouse/*cp314t*.whl
9494
95-
- uses: actions/upload-artifact@v6
95+
- uses: actions/upload-artifact@v7
9696
with:
9797
name: wheel-${{ matrix.buildplat[1] }}
9898
path: ./wheelhouse/*.whl
@@ -125,7 +125,7 @@ jobs:
125125
cd ..
126126
python -c "from pymongo import has_c; assert has_c()"
127127
128-
- uses: actions/upload-artifact@v6
128+
- uses: actions/upload-artifact@v7
129129
with:
130130
name: "sdist"
131131
path: ./dist/*.tar.gz
@@ -136,13 +136,13 @@ jobs:
136136
name: Download Wheels
137137
steps:
138138
- name: Download all workflow run artifacts
139-
uses: actions/download-artifact@v7
139+
uses: actions/download-artifact@v8
140140
- name: Flatten directory
141141
working-directory: .
142142
run: |
143143
find . -mindepth 2 -type f -exec mv {} . \;
144144
find . -type d -empty -delete
145-
- uses: actions/upload-artifact@v6
145+
- uses: actions/upload-artifact@v7
146146
with:
147147
name: all-dist-${{ github.run_id }}
148148
path: "./*"

.github/workflows/release-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
id-token: write
7676
steps:
7777
- name: Download all the dists
78-
uses: actions/download-artifact@v7
78+
uses: actions/download-artifact@v8
7979
with:
8080
name: all-dist-${{ github.run_id }}
8181
path: dist/

.github/workflows/sbom.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
run: rm -rf .venv .venv-sbom sbom-requirements.txt
6868

6969
- name: Upload SBOM artifact
70-
uses: actions/upload-artifact@v6
70+
uses: actions/upload-artifact@v7
7171
with:
7272
name: sbom
7373
path: sbom.json

.github/workflows/test-python.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
persist-credentials: false
2828
- name: Install uv
29-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
29+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
3030
with:
3131
enable-cache: true
3232
python-version: "3.10"
@@ -68,7 +68,7 @@ jobs:
6868
with:
6969
persist-credentials: false
7070
- name: Install uv
71-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
71+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
7272
with:
7373
enable-cache: true
7474
python-version: ${{ matrix.python-version }}
@@ -90,7 +90,7 @@ jobs:
9090
with:
9191
persist-credentials: false
9292
- name: Install uv
93-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
93+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
9494
with:
9595
enable-cache: true
9696
python-version: "3.10"
@@ -118,7 +118,7 @@ jobs:
118118
with:
119119
persist-credentials: false
120120
- name: Install uv
121-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
121+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
122122
with:
123123
enable-cache: true
124124
python-version: "3.10"
@@ -143,7 +143,7 @@ jobs:
143143
with:
144144
persist-credentials: false
145145
- name: Install uv
146-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
146+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
147147
with:
148148
enable-cache: true
149149
python-version: "3.10"
@@ -162,7 +162,7 @@ jobs:
162162
with:
163163
persist-credentials: false
164164
- name: Install uv
165-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
165+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
166166
with:
167167
enable-cache: true
168168
python-version: "3.10"
@@ -184,7 +184,7 @@ jobs:
184184
with:
185185
persist-credentials: false
186186
- name: Install uv
187-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
187+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
188188
with:
189189
enable-cache: true
190190
python-version: "${{matrix.python}}"
@@ -205,7 +205,7 @@ jobs:
205205
with:
206206
persist-credentials: false
207207
- name: Install uv
208-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
208+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
209209
with:
210210
enable-cache: true
211211
python-version: "3.10"
@@ -245,7 +245,7 @@ jobs:
245245
run: |
246246
pip install build
247247
python -m build --sdist
248-
- uses: actions/upload-artifact@v6
248+
- uses: actions/upload-artifact@v7
249249
with:
250250
name: "sdist"
251251
path: dist/*.tar.gz
@@ -257,7 +257,7 @@ jobs:
257257
timeout-minutes: 20
258258
steps:
259259
- name: Download sdist
260-
uses: actions/download-artifact@v7
260+
uses: actions/download-artifact@v8
261261
with:
262262
path: sdist/
263263
- name: Unpack SDist
@@ -295,7 +295,7 @@ jobs:
295295
with:
296296
persist-credentials: false
297297
- name: Install uv
298-
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7
298+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
299299
with:
300300
python-version: "3.9"
301301
- id: setup-mongodb

.github/workflows/zizmor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
with:
1919
persist-credentials: false
2020
- name: Run zizmor 🌈
21-
uses: zizmorcore/zizmor-action@0dce2577a4760a2749d8cfb7a84b7d5585ebcb7d # v0.5.0
21+
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2

AGENTS.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
When reviewing code, focus on:
2+
3+
## Security Critical Issues
4+
- Check for hardcoded secrets, API keys, or credentials.
5+
- Check for instances of potential method call injection, dynamic code execution, symbol injection or other code injection vulnerabilities.
6+
7+
## Performance Red Flags
8+
- Spot inefficient loops and algorithmic issues.
9+
- Check for memory leaks and resource cleanup.
10+
11+
## Code Quality Essentials
12+
- Methods should be focused and appropriately sized. If a method is doing too much, suggest refactorings to split it up.
13+
- Use clear, descriptive naming conventions.
14+
- Avoid encapsulation violations and ensure proper separation of concerns.
15+
- All public classes, modules, and methods should have clear documentation in Sphinx format.
16+
17+
## PyMongo-specific Concerns
18+
- Do not review files within `pymongo/synchronous` or files in `test/` that also have a file of the same name in `test/asynchronous` unless the reviewed changes include a `_IS_SYNC` statement. PyMongo generates these files from `pymongo/asynchronous` and `test/asynchronous` using `tools/synchro.py`.
19+
- All asynchronous functions must not call any blocking I/O.
20+
21+
## Review Style
22+
- Be specific and actionable in feedback.
23+
- Explain the "why" behind recommendations.
24+
- Acknowledge good patterns when you see them.
25+
- Ask clarifying questions when code intent is unclear.
26+
27+
Always prioritize security vulnerabilities and performance issues that could impact users.
28+
29+
Always suggest changes to improve readability and testability. For example, this suggestion seeks to make the code more readable, reusable, and testable:
30+
31+
```python
32+
# Instead of:
33+
if user.email and "@" in user.email and len(user.email) > 5:
34+
submit_button.enabled = True
35+
else:
36+
submit_button.enabled = False
37+
38+
# Consider:
39+
def valid_email(email):
40+
return email and "@" in email and len(email) > 5
41+
42+
43+
submit_button.enabled = valid_email(user.email)
44+
```

0 commit comments

Comments
 (0)