Skip to content

fix(ci): harden cache writes and readiness cleanup - #1123

Merged
ndizazzo merged 2 commits into
mainfrom
codex/ci-isolate-rust-shard-cache
Jul 30, 2026
Merged

fix(ci): harden cache writes and readiness cleanup#1123
ndizazzo merged 2 commits into
mainfrom
codex/ci-isolate-rust-shard-cache

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Outcome

This closes two reliability defects exposed by the final GitHub-hosted cold/warm controls:

  1. Keep the four high-fanout main Rust crate-test shards on writable job-local sccache on GitHub-hosted runners. Their existing per-shard Cargo target caches continue to own persistent reuse. Authorized Depot jobs still select disk plus WebDAV before this GitHub-cache opt-out.
  2. Use SIGTERM as the graceful Unix service signal in the hermetic background readiness smoke, with bounded SIGKILL fallback. Noninteractive asynchronous shell children may inherit SIGINT as ignored; Windows continues to use CTRL_BREAK_EVENT.

Evidence

Cold GitHub-hosted main run 30548920143 attempt 1 was green, but recorded 3,251 remote sccache write errors. The four concurrent Rust shards produced 3,060 of them (94.1%); two shards failed every remote write while all tests passed. The broader warm run 30552393814 restored each shard's distinct 2.18–3.47 GB target cache and all four shards had zero misses, writes, or errors.

Other jobs remain remote-enabled because their measured reuse is valuable and their error rates are low. The exact Swift ABI warm hit reduced the full Swift producer from 35m35s to 13m23s, so this change does not disable producer caching.

The exact like-for-like warm rerun then exposed CUDA product cleanup job 90917729846: readiness, artifact verification, and launch passed; SIGINT produced no event for 15 seconds; fallback SIGTERM immediately emitted shutdown_requested and shutdown and exited. The shared smoke now starts graceful cleanup with SIGTERM instead of misclassifying a healthy product as failed.

Validation

  • Full Python CI suite: 366 passed, 7 skipped after each focused change
  • Focused cache/workflow tests: 78 passed
  • Focused readiness cleanup tests: 3 passed, including exact SIGTERM receipt and forced-timeout reaping
  • Independent reviews: no blocker for either fix
  • actionlint: clean
  • Bash syntax and ShellCheck: clean
  • 43 workflow/action YAML files parsed
  • git diff --check: clean

Rollback

Remove the single SCCACHE_GHA_ENABLED=false override from main rust_crate_tests and revert the Unix readiness signal to the prior behavior. No runner variables, Depot settings, runner groups, or organization settings are changed.

Summary by CodeRabbit

  • CI Improvements
    • Improved reliability of main Rust crate test shards by using writable, job-local compiler caches while keeping remote caching for other trusted jobs.
    • Updated release readiness smoke shutdown to exit cleanly via bounded SIGTERM (Unix) / CTRL_BREAK_EVENT (Windows), with escalation if needed.
  • Documentation
    • Clarified cache and runner/image behavior for GitHub-hosted crate-test shards, including when GitHub-hosted cache writes are disabled.
    • Updated noninteractive process-shutdown expectations to match SIGTERM/CTRL_BREAK_EVENT behavior.
  • Tests
    • Expanded coverage to ensure cache settings (including SCCACHE_GHA_ENABLED=false) apply only to the intended main crate-test shards and avoid duplicate configuration.
    • Updated smoke-test assertions to validate clean SIGTERM shutdown behavior.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

GitHub-hosted rust_crate_tests shards now disable GHA-backed sccache and use job-local caching, while other jobs retain remote caching. Readiness smoke shutdown now uses bounded SIGTERM on Unix or CTRL_BREAK_EVENT on Windows, with updated tests and documentation.

Changes

CI execution contracts

Layer / File(s) Summary
Shard-local sccache enforcement
.github/workflows/ci.yml, .github/actions/configure-sccache-gha/action.yml, scripts/tests/*
The main crate-test shards disable GHA-backed sccache, and tests verify the setting is scoped to that job while grouped tests retain their existing configuration.
Readiness smoke shutdown contract
scripts/ci-client-readiness-smoke.sh, scripts/tests/test_ci_client_readiness_smoke.py, .agents/skills/manage-ci/*, docs/design/TESTING.md
Noninteractive smoke clients use bounded SIGTERM shutdown on Unix or CTRL_BREAK_EVENT on Windows, with signal handling, timeout reporting, and expectations updated accordingly.
Cache policy documentation
.agents/skills/manage-ci/*, ci/ci.md
Guidance documents disk-only caching for GitHub-hosted main shards, remote caching for other jobs, and authorized Depot disk,webdav selection.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: michaelneale, i386

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the two main changes: cache write hardening and readiness cleanup improvements.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ci-isolate-rust-shard-cache

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ndizazzo ndizazzo changed the title fix(ci): isolate high-fanout compiler cache writes fix(ci): harden cache writes and readiness cleanup Jul 30, 2026

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/tests/test_ci_client_readiness_smoke.py (1)

87-112: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make the platform-universal smoke assertions signal-agnostic.

Windows shutdown sends CTRL_BREAK_EVENT, but this test hard-codes SIGTERM expectations in both the signal marker check and the cleanup failure message, so those assertions do not match the Windows path. Assert the platform-appropriate signal/message instead, or split the assertions by platform.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/tests/test_ci_client_readiness_smoke.py` around lines 87 - 112,
Update test_clean_sigterm_shutdown_succeeds_and_reaps_runtime so its expected
signal marker and cleanup-related assertions use the platform-appropriate
shutdown signal, selecting SIGTERM on POSIX and CTRL_BREAK_EVENT on Windows.
Keep the existing PID and successful-exit assertions unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/design/TESTING.md`:
- Around line 524-526: Update the shutdown requirement wording in the testing
documentation to say “requires a bounded, graceful SIGTERM shutdown,” adding the
comma and article while preserving the surrounding Unix, Windows, and SIGINT
behavior text.

---

Outside diff comments:
In `@scripts/tests/test_ci_client_readiness_smoke.py`:
- Around line 87-112: Update
test_clean_sigterm_shutdown_succeeds_and_reaps_runtime so its expected signal
marker and cleanup-related assertions use the platform-appropriate shutdown
signal, selecting SIGTERM on POSIX and CTRL_BREAK_EVENT on Windows. Keep the
existing PID and successful-exit assertions unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b3368847-ad65-4ce4-887d-afadd4c73969

📥 Commits

Reviewing files that changed from the base of the PR and between a4b0938 and a300b1c.

📒 Files selected for processing (5)
  • .agents/skills/manage-ci/SKILL.md
  • .agents/skills/manage-ci/references/current-inventory.md
  • docs/design/TESTING.md
  • scripts/ci-client-readiness-smoke.sh
  • scripts/tests/test_ci_client_readiness_smoke.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • .agents/skills/manage-ci/references/current-inventory.md

Comment thread docs/design/TESTING.md
Comment on lines +524 to +526
and requires bounded graceful SIGTERM shutdown on Unix or CTRL_BREAK_EVENT
on Windows. Interactive Ctrl-C/SIGINT behavior is tested separately because
noninteractive background shell children may inherit SIGINT as ignored.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Improve the shutdown requirement wording.

Change “requires bounded graceful SIGTERM shutdown” to “requires a bounded, graceful SIGTERM shutdown.”

As indicated by the provided LanguageTool finding.

🧰 Tools
🪛 LanguageTool

[style] ~524-~524: The double modal “requires bounded” is nonstandard (only accepted in certain dialects). Consider “to be bounded”.
Context: ...dy/role=client` event, and requires bounded graceful SIGTERM shutdown on Unix or CT...

(NEEDS_FIXED)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/design/TESTING.md` around lines 524 - 526, Update the shutdown
requirement wording in the testing documentation to say “requires a bounded,
graceful SIGTERM shutdown,” adding the comma and article while preserving the
surrounding Unix, Windows, and SIGINT behavior text.

Source: Linters/SAST tools

@ndizazzo
ndizazzo merged commit 265afa9 into main Jul 30, 2026
45 checks passed
@ndizazzo
ndizazzo deleted the codex/ci-isolate-rust-shard-cache branch July 30, 2026 15:57
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.

1 participant