Repository navigation
Harden CI workflow: main-only push, concurrency, timeouts, SHA pins, install retry, Python 3.14 - #107
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Fresh-context review (round 1) of head 2d8ed8b What I checked myself
FindingsBLOCKING:
Failure scenario:
This repo cites per-commit main runs as evidence ("Fresh software evidence on main Fix: give non-PR runs a unique group so they are never grouped or cancelled, for example: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.sha }}or NIT:
No other findings. |
99976b1 to
e1d6d97
Compare
|
Round 1 findings addressed on head BLOCKING (shared concurrency group on main): fixed.
NIT (six copied retry loops): fixed (deduplicated). Retrying non-transient errors is kept and documented.
Local validation: |
|
Fresh-context review (round 2) of head e1d6d97 Scope: #50, the CI-workflow hardening item only. I read the diff, the full What I verified myself
Findings
No BLOCKING findings. REVIEW CLEAN |
Limit push runs to main, cancel superseded pull request runs, set 20 minute job timeouts, pin checkout and setup-python to verified commit SHAs, retry pip installs up to three times, and add Python 3.14 to the core matrix. Refs #50 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shared push group let GitHub cancel a pending main run when a newer one queued, despite cancel-in-progress being false. Non-PR runs now use github.run_id as their group key, so main runs are never queued or cancelled; PR runs keep one group per PR with cancellation. The six copied pip retry loops are replaced by scripts/ci_pip_install.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e1d6d97 to
7b7f13b
Compare
|
Coordinator: approved for merge. Review round 2 posted REVIEW CLEAN on e1d6d97. Round 1 found one BLOCKING item, the shared main concurrency group, and it was fixed in e1d6d97. As merger I then rebased onto origin/main 43903f0, after #106 merged. The only conflict was CHANGELOG ordering, resolved by keeping both entries; MANIFEST merged cleanly, and every touched entry checks OK. That gives head 7b7f13b: 741 passed, 79 skipped and ruff clean locally, with all 6 hosted checks passing on this exact head (run 43358063986). Because the rebase only reordered changelog lines, no extra review round was run. Round-2 NIT left as noted, not fixed: the |
Problem
Issue #50 recorded CI hygiene gaps that the owner has now approved fixing: every branch push and its pull request ran duplicate checks, superseded runs were never cancelled, jobs had no timeout (360 minute default),
actions/checkoutandactions/setup-pythonused mutable tags, and one hosted run on main failed once at dependency install with no retry.Change
.github/workflows/ci.ymland the newscripts/ci_pip_install.shchange behavior. Alongside them: a CHANGELOG entry, the current CI matrix sentence indocs/HIERARCHY_RELEASE_VERIFICATION.md(3.11–3.13 → 3.11–3.14, historical evidence lines left alone), andMANIFEST.sha256entries forci.yml(refreshed) andscripts/ci_pip_install.sh(added).pushis limited tobranches: [main].pull_requestis unchanged.${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }},cancel-in-progress: ${{ github.event_name == 'pull_request' }}.main) gets a group of its own. GitHub keeps at most one running and one pending run per group and cancels the pending one when a newer run joins, whatevercancel-in-progresssays. A sharedmaingroup could therefore drop the run for a commit merged in quick succession. With a unique group per run,mainruns are never queued behind or cancelled by another run.run_idand notsha:run_idis unique per workflow run and stays the same across re-runs (onlyrun_attemptchanges), and attempts of one run never overlap. So no two distinct runs ever share a group. Ashakey would put two runs of the same commit in one group (for example a re-run started while another run of that commit is still going), which brings back the pending-cancel case.github.event.pull_request.number || github.ref, which had the shared-main-group problem above.)timeout-minutes: 20oncoreandoptional-contracts. The last three successful runs before this PR (37524953457, 37128382459, 37128039600) had jobs that each finished in 0.6–1.1 minutes. 20 minutes allows for worst-case install retries (2 × 15 s sleeps per install step) and slow runners.actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0.[dev], example requirements, and the installed-wheel venv install; optional:.[all,dev], example requirements, pinned DSPy/GEPA) callbash scripts/ci_pip_install.sh <python> <pip args...>. It runs<python> -m pip installup to 3 times with a 15 s sleep between attempts. If all 3 fail, it logs::error::and exits 1, failing the step. The retry policy now lives in one tracked file (it sits next to the existingscripts/setup.sh), and no new action dependency was added. pip's exit code does not tell network failures apart from resolver errors, so every failure is still retried. A deterministic error costs about 30 s before the step fails. Classifying pip output was left out on purpose, because it would be fragile.Pin verification
All four refs are lightweight tags (
type: commit), so no tag object needed dereferencing.gh release listlists v4.4.0 (checkout) and v5.6.0 (setup-python) as the newest releases in those majors. Moving to newer majors (checkout v7, setup-python v7) was left out of scope.Final check names
Job names are unchanged. Matrix expansion adds one core check:
core (3.11)core (3.12)core (3.13)core (3.14)(new)optional-contracts (3.3.1)optional-contracts (3.4.0)Validation (head e1d6d97)
origin/main(3859256, after Validate gateway destinations before credentialed dispatch #98). The CHANGELOG conflict was resolved by keeping both entries.yaml.safe_load. Parsed trigger:{'push': {'branches': ['main']}, 'pull_request': None}. Concurrency group as above. Timeouts: core 20, optional-contracts 20. Matrices: core 3.11/3.12/3.13/3.14, optional dspy 3.3.1/3.4.0.scripts/ci_pip_install.shlocally underbash --noprofile --norc -eo pipefailwith a stub interpreter in place of pip, and the sleep set to 0:::error::pip install failed after 3 attemptsand exit 1, after exactly 3 calls.pytest -q737 passed, 79 skipped (the count rose from 606 because Validate gateway destinations before credentialed dispatch #98 added tests on main).ruff check src tests examples: all checks passed.sha256sum -c MANIFEST.sha256reports OK for.github/workflows/ci.ymlandscripts/ci_pip_install.sh. The rest ofMANIFEST.sha256was already out of date on main (includingscripts/setup.shandscripts/setup.ps1). This PR leaves those entries alone.e1d6d97(it is the PR head commit's status rollup). All 6 checks succeeded:core (3.11)pass (54s)core (3.12)pass (49s)core (3.13)pass (45s)core (3.14)pass (31s)optional-contracts (3.3.1)pass (50s)optional-contracts (3.4.0)pass (59s)Not executed
push-to-main and concurrency behavior can only be seen after merge or on later pushes.Refs #50
🤖 Generated with Claude Code