Skip to content

ci(checks): bump nox shards to 4 and introduce shard weights#226

Merged
Abhijeet Prasad (AbhiPrasad) merged 9 commits intomainfrom
abhi-bump-shard-count
Apr 8, 2026
Merged

ci(checks): bump nox shards to 4 and introduce shard weights#226
Abhijeet Prasad (AbhiPrasad) merged 9 commits intomainfrom
abhi-bump-shard-count

Conversation

@AbhiPrasad
Copy link
Copy Markdown
Member

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Apr 8, 2026

Extract the shared checkout, mise setup, and dependency install steps from the smoke and nox jobs into a reusable composite action at .github/actions/setup-python-env. Increase nox test shards from 2 to 4 for faster parallel execution and introduce shard weights so the shard sessions are more balanced.

Base automatically changed from abhi-fix-pydantic-ai-toolmanager-move to main April 8, 2026 16:17
Extract the shared checkout, mise setup, and dependency install steps
from the smoke and nox jobs into a reusable composite action at
.github/actions/setup-python-env. Increase nox test shards from 2 to 4
for faster parallel execution.
Local composite actions require the repo to be checked out first.
Move actions/checkout back into each job, before the composite action
reference.
Replace the round-robin (NR % TOTAL) shard assignment with a greedy
longest-processing-time-first bin-packing algorithm. Session weights are
read from py/scripts/session-weights.json (measured from CI). This brings
the 4-shard split from a potential ~60s imbalance to within ~3s.
Replace py/scripts/nox-matrix.sh with py/scripts/nox-matrix.py. The
Python version is cleaner and avoids the inline Python heredoc that the
shell script was already using for the LPT bin-packing logic. Update the
workflow to call the new script.
Add --output-durations flag to nox-matrix.py to capture actual session
runtimes from nox output. A new non-blocking check-session-weights job
runs after nox, compares measured durations against session-weights.json,
and warns when any session drifts beyond 50%. The job is deliberately
excluded from checks-passed so it never blocks PRs.
Adds a simple workflow for updating stale weights: download the
measured-durations artifacts from a CI run, then run:

    python py/scripts/check-session-weights.py --update measured-*.json

This overwrites session-weights.json with the measured values, adds new
sessions, and preserves sessions that were not measured in this run.
Remove the --output-durations capture and check-session-weights job
from the checks workflow. Add a new update-session-weights workflow that
runs weekly (Monday 06:00 UTC) or on manual dispatch. It measures all
nox session durations on ubuntu/3.13, checks for drift, and opens a PR
updating session-weights.json when any session drifts beyond 50%.
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) changed the title ci(checks): extract setup into composite action and bump nox shards to 4 ci(checks): bump nox shards to 4 and introduce shard weights Apr 8, 2026
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stamp

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) merged commit 94cfbdd into main Apr 8, 2026
59 checks passed
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) deleted the abhi-bump-shard-count branch April 8, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants