Skip to content

fix(ci): extend the rust-cache blob-size fix to the quality and windows jobs - #196

Merged
KooshaPari merged 4 commits into
masterfrom
fix/ci-cache-blob-size-all-jobs
Oct 27, 2026
Merged

KooshaPari merged 4 commits into
masterfrom
fix/ci-cache-blob-size-all-jobs

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

User description

Closes #195

What

Extends the rust-cache blob-size fix from PR #183 to the three remaining CI jobs that still restore the oversized target/ blob.

Job Old key New key Added
quality quality-ubuntu quality-ubuntu-notarget cache-targets: "false"
windows-build-test windows-latest windows-latest-notarget cache-targets: "false"
windows-cross-check windows-cross-check windows-cross-check-notarget cache-targets: "false"

cache-all-crates: "true" is kept as-is in all three jobs (it only affects WHICH crates are cached, not the target/ blob size).

Why

The Swatinem/rust-cache@v2 RESTORE step hangs for 25+ minutes on the large blob and, while it hangs, occupies the self-hosted runner, starving the entire CI queue.

  • CI job 121317250103 sat in step Run Swatinem/rust-cache@v2 from 01:08:17 for 26 minutes with no cargo/rustc running anywhere on the host (load average ~8). The runner's child was the rust-cache node process sitting idle. The runner was blocked the whole time, so every other KCode run stayed queued.
  • A second occurrence was seen live on PR fix(ci): give the retention-readiness cohort a cold-compile budget so the desk-linux build can go green #183's own branch: job 121349210215, step 4 in_progress since 01:36:00 in the quality job.
  • Blob sizes: quality-ubuntu ~881 MB (cache id 9211749432), windows-cross-check ~688 MB (cache ids 9209952731 / 9293606805).

The -notarget key suffix makes the restore miss fast ("No cache found") instead of downloading the oversized blob, and cache-targets: "false" ensures the workspace target/ dir is never cached or restored. Note that cache-targets does not participate in the cache key, so the new key suffix is what actually forces the miss.

Relationship to PR #183

This branch is based on PR #183's branch (fix/ci-cold-cache-build-green), which already applies the identical -notarget key plus cache-targets: "false" treatment to the Build job.

PR #183 must land first. Until it does, this PR's diff against master includes PR #183's Build-job change as well. Once #183 is merged into master, this PR reduces to exactly the three cache-key changes shown in the table above.

The Build job's cache block is byte-identical to PR #183's version here and is not modified by this PR.

Validation

  • git diff origin/fix/ci-cold-cache-build-green...fix/ci-cache-blob-size-all-jobs --stat touches only .github/workflows/ci.yml.
  • The Build job's block is untouched: the diff against the base branch contains zero stablepin occurrences.
  • No run_with_timeout.py or timeout-minutes value was changed (the diff against the base branch contains none).
  • The new -notarget keys do not exist on master, so they are unique and unused.
  • .github/workflows/ci.yml parses as valid YAML.
  • git merge-tree --write-tree origin/master fix/ci-cache-blob-size-all-jobs is clean.
  • git merge-tree --write-tree origin/fix/ci-cold-cache-build-green fix/ci-cache-blob-size-all-jobs is clean (this branch is a descendant of the base).

CodeAnt-AI Description

Keep CI checks moving when Rust build caches are oversized

What Changed

  • Quality, Linux build/test, and Windows checks now skip oversized workspace build caches, avoiding long waits to restore unusable cache entries.
  • The Linux build/test check has more time to finish cold builds and test compilation after the workspace cache is disabled.

Impact

✅ Fewer CI checks stalled on cache restores
✅ Less time waiting for self-hosted runners
✅ Cold Linux builds have time to complete

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

KooshaPari and others added 4 commits October 21, 2026 12:57
tx-agent: jcode
tx-validated: manual
tx-scope: .github/workflows/ci.yml (build job only)
tx-intent: Make Build & Test (desk-linux) able to restore its cache and go green on PR branches

The Build & Test (desk-linux) job's rust-cache blob was 2,029,470,155 bytes.
Every restore attempt aborted at a ~600s cap (617s / 605s / 600s across jobs
119054392243, 119055460640, 119065565800) at 37.4% / 39.7% / 44.0% and fell
through to "No cache found", so the job always ran cold, so the 900s compile
cap killed it, so the save step was skipped. GitHub caches are ref-scoped and
PR refs (refs/pull/N/merge) cannot read refs/heads/master, so the loop repeats.

target/ is the dominant contributor: this is the only job that puts a release
build, a --lib --bins test compile, and eight integration/e2e compiles into one
target dir. Per Swatinem/rust-cache action.yml, cache-targets:false caches only
the cargo registry, which is provably under the 687,972,881 bytes that job
119062133759 already restored successfully.

cache-all-crates was evaluated and is the wrong lever: src/save.ts calls
cleanRegistry(pkgs, crates !== "true"), so cache-all-crates:"true" skips the
registry cleanup and keeps MORE. This job already uses the pruning default.

Timeouts raised because the job is now intentionally cold: Build cold 2453s,
compile cold ~2990s.

Co-Authored-By: Jcode <[email protected]>
…pin it

  The previous rust-cache key (v0-rust-desk-linux-stablepin-build-...) had
  a 2,029,470,155-byte entry stuck on refs/heads/master. Even with
  cache-targets: "false" flipped on, the key was identical so actions/cache
  attempted to restore the 2GB blob and aborted at ~600s (37-44%). The
  post-step save was then SKIPPED because the key was immutable per
  (key, ref), so master remained pinned forever and every fresh PR paid the
  same doomed download.

  Suffix the key with -notarget. This propagates into both the primary key
  and the restore-key prefix, and matches no legacy entry -- the doomed
  restore is never attempted and the save reserves a fresh slot.

  tx-agent: jcode
  tx-validated: manual
  tx-scope: .github/workflows/ci.yml
  tx-intent: make the build job's rust-cache use a new key so cache-targets:false can actually take effect
The Build & Test (desk-linux) job cannot go green on a cold cache because
the retention-readiness cohort budget is 600s while that step pays a full
cold compile of the jcode-app-core lib-test harness.

The harness stays cold at that point: the workspace declares no
`default-members`, so `cargo test --lib --bins --no-run` builds only the
default member `kcode` and never pre-builds the cohort crates' harnesses.
Run 39672218586 / job 119472777140 hit exit 124 at 600s on exactly this.

Raise that one budget to 1800s and record why. The cohort itself still runs
in under a second once the harness is built; 1800s covers the one-time cold
compile and nothing more.

Based on #168 (fix/ci-build-cache-blob-size), which already carries the
3300s compile budget and the 240-minute job cap, so this branch is a strict
superset of #177 (fix/ci-retention-cohort-timeout), which can be closed
without merging.

tx-agent: jcode
tx-validated: manual
tx-scope: .github/workflows/ci.yml
The Swatinem/rust-cache@v2 restore hangs 25+ minutes on the large target/
blob (job 121317250103, 2026-10-26) and occupies the self-hosted runner
for the whole duration, starving the whole CI queue.

PR #183 already fixed the Build job with a new -notarget cache key plus
cache-targets: "false". This applies the same treatment to the quality,
windows-build-test and windows-cross-check jobs so their restores miss
fast instead of downloading the oversized blob.

tx-agent: jcode
tx-validated: manual
tx-scope: ci
tx-intent: stop the oversized rust-cache restore from hanging and blocking the runner
Copilot AI balanced review requested due to automatic review settings October 26, 2026 01:51
@codeant-ai

codeant-ai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  Reviewed your PR bc4a28f Oct 26, 2026 · 01:52 01:56

@codeant-ai

codeant-ai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: adc9a816-2aff-4eac-92a2-16a1ccb86512
Commits

Reviewing files that changed from the base of the PR and between 0d95c41 and bc4a28f.

Files selected for processing: 1
  • .github/workflows/ci.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details
Context from checks skipped due to timeout: 10
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: Require Linked Issue
  • GitHub Check: Quality Guardrails
  • GitHub Check: Windows Cross-Target Check (Linux)
  • GitHub Check: Format
  • GitHub Check: Build & Test (desk-linux)
  • GitHub Check: TypeScript SDK
  • GitHub Check: Release Automation
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Kilo Code Review
Additional context used
zizmor (1.30.1)
.github/workflows/ci.yml

[warning] 1-855: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

[warning] 19-122: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

[warning] 141-524: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

[warning] 301-301: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

[warning] 804-855: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

Additional comments: 1
.github/workflows/ci.yml: 1

42-42: LGTM!

Also applies to: 44-44, 161-161, 242-242, 261-261, 300-300, 314-314, 556-556, 558-558, 827-827, 829-829

📝 Summary

Summary

The workflow adds -notarget cache keys and sets cache-targets: "false" for the quality, windows-build-test, and windows-cross-check jobs. Each job retains cache-all-crates: "true". This changes cache behavior so these jobs do not cache or restore the workspace target/ directory. The windows-build-test job remains disabled with if: false.

The reported cache changes match the workflow source. The available evidence does not establish whether the PR should merge.

Must Fix

No current review findings were supplied. Severity counts are unavailable.

Should Fix

Test results are unavailable. The PR description does not report a run that validates the updated jobs’ behavior.

Consider

The PR also changes Build & Test timeout values. These changes are outside the stated issue scope.

Approve / Request Changes

Unable to recommend approval or request changes without current review findings and test results.

The CI workflow disables target-directory caching across the specified Rust jobs while retaining Cargo crate caching. It also increases the Build & Test job timeout and two test-related timeouts.

Changes: CI workflow updates

Layer / File(s) Summary
Disable target-directory caching
.github/workflows/ci.yml
Quality Guardrails, Build & Test, Windows Build & Test, and Windows Cross-Target Check use -notarget cache keys and disable target caching. Cargo crate caching remains enabled.
Increase Build & Test timeouts
.github/workflows/ci.yml
The job timeout increases from 120 to 240 minutes. The library and binary test compilation timeout increases from 900 to 3300 seconds, and the retention-readiness cohort timeout increases from 600 to 1800 seconds.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

Possibly related PRs

Suggested reviewers: 1jehuang

Merge Risk: Minimal · up to bc4a2

No actionable merge-blocking issue is identified; the CI changes are ready for normal validation.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Out of Scope Changes check Warning The whole-PR diff also changes the Build & Test job, which issue #195 identifies as existing partial work from PR #183 rather than a requested job. It changes timeout-minutes from 120 to 240, the co… Land PR #183 separately or remove its Build & Test cache and timeout changes from this pull request. Keep the changes for quality, windows-build-test, and windows-cross-check.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the change: it extends the rust-cache blob-size fix (the -notarget cache key and cache-targets: "false") to the quality and Windows jobs. The changeset matches this. It is a single, sp…
Description check Passed The description states the purpose and scope of the change: it extends the rust-cache blob-size fix to the quality, windows-build-test, and windows-cross-check jobs. It lists the cache key changes, th…
Linked Issues check Passed Issue #195 requires the -notarget key suffix and cache-targets: "false" for quality, windows-build-test, and windows-cross-check. The diff applies these settings to all three jobs. It leaves…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Title check

Explanation

The title names the change: it extends the rust-cache blob-size fix (the -notarget cache key and cache-targets: "false") to the quality and Windows jobs. The changeset matches this. It is a single, specific sentence, and it follows the conventional commit style. The title does not mention the timeout increases, which are a secondary part of the change.

Full details: Description check

Explanation

The description states the purpose and scope of the change: it extends the rust-cache blob-size fix to the quality, windows-build-test, and windows-cross-check jobs. It lists the cache key changes, the reason for them (the restore step hangs on the oversized target/ blob), and the dependency on PR #183. This is related to the changeset, so the check passes.

Full details: Linked Issues check

Explanation

Issue #195 requires the -notarget key suffix and cache-targets: "false" for quality, windows-build-test, and windows-cross-check. The diff applies these settings to all three jobs. It leaves cache-all-crates: "true" unchanged in the two Windows jobs, and the existing quality setting remains unchanged.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Full details: Out of Scope Changes check

Explanation

The whole-PR diff also changes the Build & Test job, which issue #195 identifies as existing partial work from PR #183 rather than a requested job. It changes timeout-minutes from 120 to 240, the compile timeout from 900 to 3300 seconds, the retention-readiness timeout from 600 to 1800 seconds, and the Build cache key and cache-targets setting. These changes are not required for the three jobs in issue #195.

Resolution

Land PR #183 separately or remove its Build & Test cache and timeout changes from this pull request. Keep the changes for quality, windows-build-test, and windows-cross-check.

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Oct 26, 2026
Comment thread .github/workflows/ci.yml
with:
key: quality-ubuntu
# The ~881 MB `quality-ubuntu` blob hung for 26+ minutes in CI job
# 121317250103 (2026-10-26), blocking the self-hosted runner the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Comment cites CI job 121317250103, but per the PR description that job was the quality job, not a Windows job. Either cite each job's own ID or omit the specific job ID to avoid confusion during debugging.

Comment thread .github/workflows/ci.yml
- uses: Swatinem/rust-cache@v2
with:
key: windows-latest
# The old blob's restore hung for 26+ minutes in CI job 121317250103

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Comment cites CI job 121317250103, but per the PR description that job was the quality job, not this windows-build-test job. Either cite the correct job ID or omit the specific job ID.

Comment thread .github/workflows/ci.yml
with:
key: windows-cross-check
# The ~688 MB `windows-cross-check` blob hung for 26+ minutes in CI
# job 121317250103 (2026-10-26), blocking the self-hosted runner the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION: Comment cites CI job 121317250103, but per the PR description that job was the quality job (windows-cross-check had cache ids 9209952731/9293606805). Either cite the correct job ID or omit the specific job ID.

@kilo-code-bot

kilo-code-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issues Found | Recommendation: Merge (address suggestion before or with merge)

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
.github/workflows/ci.yml 39, 552, 824 Cache comment cites CI job 121317250103 on all three jobs, but per the PR description that job was the quality job. Cite each job's own ID or omit it.
Files Reviewed (1 files)
  • .github/workflows/ci.yml - 1 suggestion

The PR is functionally correct: all three cache blocks use unique -notarget keys plus cache-targets: "false", consistent with PR #183's Build job, and the YAML is valid. No Rust code was changed, so Rust-specific checks (clippy, fmt, type annotations, file size limits) do not apply.

Fix these issues in Kilo Cloud


Reviewed by free · Input: 75.8K · Output: 16.7K · Cached: 225.5K

@codeant-ai

codeant-ai Bot commented Oct 26, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: bc4a28f41208

@KooshaPari
KooshaPari merged commit ef31417 into master Oct 27, 2026
13 of 17 checks passed
KooshaPari added a commit that referenced this pull request Oct 27, 2026
Resolves the ci.yml conflict introduced by #183 and #196 landing first.
All three conflict hunks were comment-only -- both sides already agreed on
every semantic value (job timeout-minutes 240, compile 3300s, retention
cohort 1800s, and the identical sequence of every other budget).

The resolution keeps master's comment text, which is now the canonical
wording for the merged cache and timeout fixes, and re-applies this
branch's one semantic change: the workspace-wide clippy gate.

The diff against master is exactly one line:
    cargo clippy --all-targets --all-features
 -> cargo clippy --workspace --all-targets --all-features

tx-agent:     jcode
tx-validated: none
tx-scope:     ci workflow
tx-intent:    Resolve the ci.yml conflict with the merged cache and timeout fixes
KooshaPari added a commit that referenced this pull request Oct 27, 2026
Resolves the ci.yml conflict introduced by #183, #196 and #190 landing
first. All three conflict hunks were comment-only: both sides already
agreed on every semantic value, and the clippy gate line this branch
introduces is already on master via #190.

The resolved ci.yml is byte-identical to master. The branch's remaining
diff against master is exactly its lint fixes.

tx-agent:     jcode
tx-validated: none
tx-scope:     ci workflow
tx-intent:    Resolve the ci.yml conflict after the clippy and cache fixes landed
KooshaPari added a commit that referenced this pull request Oct 27, 2026
Resolves the ci.yml conflict introduced by #183, #196, #190 and #198 landing
first. All three conflict hunks were comment-only -- both sides already
agreed on every semantic value, and the timeout and cache fixes this
branch carried are now on master.

The resolved ci.yml is byte-identical to master. The branch's remaining
diff against master is exactly the dictation test budget change.

tx-agent:     jcode
tx-validated: none
tx-scope:     ci workflow
tx-intent:    Resolve the ci.yml conflict after the timeout and cache fixes landed
@KooshaPari
KooshaPari deleted the fix/ci-cache-blob-size-all-jobs branch November 27, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): rust-cache restore hangs 25+ min on the quality/windows jobs and starves the whole CI queue

2 participants