You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci(checks): move static checks out of sharded nox (#257)
Run pylint and test_types together in a dedicated Ubuntu Python matrix
job instead of repeating them inside every sharded nox job.
This should reduce duplicated work across OSes and shards, improving CI
wall time and total runner usage while preserving multi-version
static-check coverage.
Add nox-matrix session exclusions so shard reproduction matches CI, and
update the SDK agent docs and CI triage skill to reflect the new
static_checks workflow path.
Copy file name to clipboardExpand all lines: .agents/skills/sdk-ci-triage/SKILL.md
+38-11Lines changed: 38 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,29 +34,32 @@ Read when relevant:
34
34
35
35
-`lint`: pre-commit diff-based checks
36
36
-`ensure-pinned-actions`: workflow hygiene
37
+
-`static_checks`: Ubuntu-only Python matrix for `pylint` and `test_types`
37
38
-`smoke`: install/import matrix across Python and OS
38
39
-`nox`: provider and core test matrix, sharded through `py/scripts/nox-matrix.py`
39
40
-`adk-py`: reusable workflow for ADK coverage
40
41
-`langchain-py`: reusable workflow for LangChain coverage
41
42
-`upload-wheel`: build wheel sanity check
42
43
43
-
The most common failure source is the `nox` matrix job.
44
+
The most common failure source is still the `nox` matrix job, but `pylint` and `test_types` failures now surface through `static_checks`, not through `nox`.
44
45
45
46
## Standard Workflow
46
47
47
48
1. Identify the failing PR, run, or job.
48
49
2. Inspect the failing job logs with `gh`.
49
50
3. Determine which workflow branch failed:
50
51
-`lint`
52
+
-`static_checks`
51
53
-`smoke`
52
54
-`nox`
53
55
- reusable workflow (`adk-py`, `langchain-py`)
54
56
-`upload-wheel`
55
57
4. For `nox` failures, map the matrix job to the exact nox session and pinned provider version from the logs.
56
-
5. Reproduce the narrowest failing command locally.
57
-
6. Fix the bug.
58
-
7. Re-run the narrowest failing command first.
59
-
8. Expand only if shared code changed.
58
+
5. For `static_checks` failures, identify whether `pylint` or `test_types` failed under the reported Python version.
59
+
6. Reproduce the narrowest failing command locally.
60
+
7. Fix the bug.
61
+
8. Re-run the narrowest failing command first.
62
+
9. Expand only if shared code changed.
60
63
61
64
Do not start by running the whole suite locally unless the failure genuinely spans many sessions.
62
65
@@ -94,25 +97,29 @@ gh api repos/braintrustdata/braintrust-sdk-python/actions/jobs/<job-id>/logs
94
97
Job names look like this:
95
98
96
99
```text
97
-
nox (3.10, ubuntu-latest, 0)
100
+
nox (3.10, ubuntu-24.04, 0)
98
101
```
99
102
100
103
That means:
101
104
102
105
- Python `3.10`
103
-
- OS `ubuntu-latest`
106
+
- OS `ubuntu-24.04`
104
107
- shard `0` out of 4
105
108
106
109
The workflow runs:
107
110
108
111
```bash
109
-
mise exec python@<python-version> -- python ./py/scripts/nox-matrix.py <shard> 4
112
+
mise exec python@<python-version> -- python ./py/scripts/nox-matrix.py <shard> 4 \
113
+
--exclude-session pylint \
114
+
--exclude-session test_types
110
115
```
111
116
112
117
Use a dry run first to see which sessions belong to the shard:
113
118
114
119
```bash
115
-
mise exec python@3.10 -- python ./py/scripts/nox-matrix.py 0 4 --dry-run
120
+
mise exec python@3.10 -- python ./py/scripts/nox-matrix.py 0 4 --dry-run \
121
+
--exclude-session pylint \
122
+
--exclude-session test_types
116
123
```
117
124
118
125
Then inspect the failing logs to find the exact session name, for example:
@@ -161,6 +168,23 @@ make lint
161
168
make pylint
162
169
```
163
170
171
+
### `static_checks`
172
+
173
+
The `static_checks` job is an Ubuntu-only Python matrix that runs `pylint` and `test_types` together for each configured Python version.
174
+
175
+
Local equivalents:
176
+
177
+
```bash
178
+
mise exec python@3.10 -- nox -f ./py/noxfile.py -s pylint test_types
179
+
```
180
+
181
+
If only one of the two sessions failed in CI, narrow locally to that specific session:
182
+
183
+
```bash
184
+
mise exec python@3.10 -- nox -f ./py/noxfile.py -s pylint
185
+
mise exec python@3.10 -- nox -f ./py/noxfile.py -s test_types
186
+
```
187
+
164
188
### `smoke`
165
189
166
190
The smoke job validates install + import across OS and Python versions.
@@ -276,7 +300,9 @@ Preferred progression:
276
300
277
301
```bash
278
302
# 1. Inspect the failing shard
279
-
mise exec python@3.10 -- python ./py/scripts/nox-matrix.py 0 4 --dry-run
303
+
mise exec python@3.10 -- python ./py/scripts/nox-matrix.py 0 4 --dry-run \
304
+
--exclude-session pylint \
305
+
--exclude-session test_types
280
306
281
307
# 2. Reproduce the exact session
282
308
cd py
@@ -299,7 +325,7 @@ When answering a CI-triage question, report:
299
325
Good example structure:
300
326
301
327
```text
302
-
The failing job is `nox (3.10, ubuntu-latest, 0)`.
328
+
The failing job is `nox (3.10, ubuntu-24.04, 0)`.
303
329
Within that shard, the failing session is `test_google_genai(1.30.0)`.
304
330
The root cause is that the tests import a symbol that does not exist in google-genai 1.30.0, even though it exists in newer versions.
305
331
You can reproduce it locally with `cd py && nox -s "test_google_genai(1.30.0)"`.
@@ -311,6 +337,7 @@ The fix is to gate the behavior for older versions or stop assuming the newer AP
311
337
Avoid these common mistakes:
312
338
313
339
- guessing the session from the provider name without checking `py/noxfile.py`
340
+
- forgetting that CI excludes `pylint` and `test_types` from the sharded `nox` job
314
341
- reproducing with `latest` when CI failed on an older pinned version
315
342
- running from repo root when the real SDK command belongs in `py/`
316
343
- fixing the symptom in tests without understanding the provider-version contract
Copy file name to clipboardExpand all lines: AGENTS.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,8 @@ Use this file as the default playbook for work in this repository.
15
15
2.**Use `mise` as the source of truth for tools and environment.**
16
16
17
17
3.**Do not guess test commands or version coverage.**
18
-
-`py/noxfile.py` is the source of truth for nox session names, provider/version matrices, and CI coverage.
18
+
-`py/noxfile.py` is the source of truth for nox session names, provider/version matrices, and local reproduction commands.
19
+
-`.github/workflows/checks.yaml` is the source of truth for which sessions run in CI, on which Python versions, and outside vs. inside the nox shard matrix.
19
20
- For provider and integration work, also check `py/src/braintrust/integrations/versioning.py`.
20
21
21
22
4.**Keep changes narrow and validate with the smallest relevant test first.**
@@ -116,7 +117,7 @@ Do not guess:
116
117
- supported provider versions
117
118
- which tests a provider session runs
118
119
119
-
Check `py/noxfile.py` and reproduce with the exact local session CI uses.
120
+
Check `py/noxfile.py` and `.github/workflows/checks.yaml`, then reproduce with the exact local session CI uses.
120
121
121
122
### Run the smallest relevant test first
122
123
@@ -143,6 +144,8 @@ Before changing provider/integration behavior:
143
144
144
145
-`test_core` runs without optional vendor packages.
145
146
-`test_types` runs pyright, mypy, and pytest on `py/src/braintrust/type_tests/`.
147
+
- CI runs `pylint` and `test_types` via the dedicated `static_checks` workflow job on Ubuntu across the configured Python matrix, not inside the sharded `nox` job.
148
+
- The sharded `nox` workflow excludes `pylint` and `test_types`; use `py/scripts/nox-matrix.py --exclude-session ...` when reproducing shard membership locally.
146
149
- wrapper coverage is split across dedicated nox sessions by provider/version.
147
150
-`test-wheel` is a wheel sanity check and requires a built wheel first.
0 commit comments