Skip to content

chore(ci): remove the dead weekly sticky-disk GC workflow - #1295

Merged
ryoppippi merged 1 commit into
mainfrom
chore/remove-dead-cache-gc
Jun 12, 2026
Merged

ryoppippi merged 1 commit into
mainfrom
chore/remove-dead-cache-gc

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jun 12, 2026 •

Copy link
Copy Markdown
Member

Summary

cache-gc.yaml (the scheduled "Sticky Disk GC") never actually collected the stores it was meant to.

Blacksmith sticky disks are keyed per github.job (<repo>-nix-<os>-<arch>-<github.job>, see setup-linux-blacksmith-sticky-disk). The GC workflow runs as job nix-store-gc, so it mounts a ...-nix-store-gc sticky disk — its own, used by nothing else — and runs nix-collect-garbage there. The disks that npm-publish, ccusage-perf-comment, release, and update-pricing grow are never touched.

It is also redundant now:

  • The heavy jobs (check, test, build-native) moved to cache-nix-action via setup-linux-nix-action-cache, which self-trims with gc-max-store-size-linux: 2GB.
  • macOS self-trims with gc-max-store-size-macos.
  • The remaining sticky-disk users only pull lightweight toolchain closures, each on its own per-job disk, and Blacksmith storage is effectively unlimited.

So the workflow is pure dead weight. Removing it.


View with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is enabled.


Summary by cubic

Removed the weekly Sticky Disk GC workflow (.github/workflows/cache-gc.yaml). It only mounted its own per-job sticky disk and never cleaned the disks that actually grow; heavy jobs now self-trim via setup-linux-nix-action-cache with gc-max-store-size-linux/gc-max-store-size-macos.

Written for commit 7d91632. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Removed internal infrastructure maintenance workflow.

The scheduled Sticky Disk GC never collected anything useful. Blacksmith
sticky disks are keyed per `github.job`
(`<repo>-nix-<os>-<arch>-<github.job>`), so the GC job mounted its own
`...-nix-store-gc` disk and ran `nix-collect-garbage` there — never
touching the disks that npm-publish, perf, release, or update-pricing
actually grow.

It is also redundant now: the heavy build jobs (check, test,
build-native) moved to cache-nix-action via setup-linux-nix-action-cache,
which self-trims with `gc-max-store-size-linux`, and macOS does the same
with `gc-max-store-size-macos`. The remaining sticky-disk users only pull
lightweight toolchain closures, each on its own per-job disk, and
Blacksmith storage is effectively unlimited.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ccusage-guide 7d91632 Commit Preview URL

Branch Preview URL
Jun 12 2026, 12:12 AM

@coderabbitai

coderabbitai Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The GitHub Actions workflow file .github/workflows/cache-gc.yaml has been removed. This workflow previously executed a weekly scheduled job and accepted manual dispatch to run nix-collect-garbage --delete-older-than 7d across multiple runner targets for cache maintenance.

Changes

Cohort / File(s) Summary
Workflow infrastructure removal
.github/workflows/cache-gc.yaml
Removed "Sticky Disk GC" GitHub Actions workflow that performed weekly garbage collection on Nix caches with manual dispatch capability across multiple runner environments.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A workflow takes flight, then fades away,
No more disk-cleaning every day,
The garbage stays where it must stay—
The rabbit hops through, hip hip hooray! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing a dead/unused weekly garbage collection workflow. It is concise, specific, and clearly reflects the primary change in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remove-dead-cache-gc

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

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Re-trigger cubic

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes — Removes the dead .github/workflows/cache-gc.yaml weekly sticky-disk GC workflow, which was redundant (heavy jobs self-trim via cache-nix-action) and never actually cleaned the right disks (each sticky disk is per-job, so the GC workflow only GC'd its own unused disk).

  • Remove dead cache-gc.yaml workflow — Deletes the scheduled weekly Nix store GC that was keyed to its own per-job sticky disk and never touched the disks that actually grow.

Pullfrog  | View workflow run | Using Big Pickle (free via Pullfrog for OSS) | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Jun 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

ccusage

npx https://pkg.pr.new/ccusage@1295

@ccusage/ccusage-darwin-arm64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-arm64@1295

@ccusage/ccusage-darwin-x64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-x64@1295

@ccusage/ccusage-linux-arm64

npx https://pkg.pr.new/@ccusage/ccusage-linux-arm64@1295

@ccusage/ccusage-linux-x64

npx https://pkg.pr.new/@ccusage/ccusage-linux-x64@1295

@ccusage/ccusage-win32-x64

npx https://pkg.pr.new/@ccusage/ccusage-win32-x64@1295

commit: 7d91632

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 7d916329b3ac
Base SHA: c794d804998b

This compares the PR package against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new c794d804998b 735.2ms 721.8ms 59.9ms 3
PR pkg.pr.new 7d91632 698.5ms 1.053s 57.8ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: c794d804998b; PR package: 7d91632. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 951.8ms 947.1ms 1.00x 732.00 MiB 721.75 MiB 0.99x 1.06 GiB/s 1.06 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 202.9ms 207.4ms 0.98x 91.25 MiB 91.75 MiB 1.01x 4.96 GiB/s 4.85 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 951.0ms 1.06 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 894.8ms 1.13 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 174.8ms 5.76 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 129.1ms 7.80 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 38.4ms 41.1ms 0.93x 44.00 MiB 44.25 MiB 1.01x 0.04 MiB/s 0.04 MiB/s
claude session --offline --json 0.00 MiB 37.3ms 38.0ms 0.98x 44.00 MiB 44.25 MiB 1.01x 0.04 MiB/s 0.04 MiB/s
codex daily --offline --json 0.00 MiB 36.7ms 36.6ms 1.00x 44.25 MiB 44.00 MiB 0.99x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 35.4ms 36.8ms 0.96x 44.25 MiB 44.25 MiB 1.00x 0.02 MiB/s 0.02 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 796.3ms 903.1ms 0.88x 723.75 MiB 727.50 MiB 1.01x 1.26 GiB/s 1.11 GiB/s
codex --offline --json 1.01 GiB 170.1ms 164.8ms 1.03x 86.00 MiB 91.25 MiB 1.06x 5.92 GiB/s 6.11 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.32 KiB 17.32 KiB +0.00 KiB 1.00x
installed native package binary 3324.84 KiB 3324.84 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 7d916329b3ac
Base SHA: c794d804998b

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new c794d804998b 769.4ms 724.7ms 65.6ms 3
PR pkg.pr.new 7d91632 1.105s 1.197s 65.1ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: c794d804998b; PR package: 7d91632. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 809.9ms 885.8ms 0.91x 725.00 MiB 731.25 MiB 1.01x 1.24 GiB/s 1.14 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 245.4ms 234.6ms 1.05x 91.50 MiB 93.00 MiB 1.02x 4.10 GiB/s 4.29 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 871.6ms 1.16 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 749.6ms 1.34 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 212.3ms 4.74 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 156.5ms 6.43 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 49.5ms 7.0ms 7.05x 44.25 MiB 2.75 MiB 0.06x 0.03 MiB/s 0.22 MiB/s
claude session --offline --json 0.00 MiB 46.4ms 8.2ms 5.64x 44.00 MiB 2.75 MiB 0.06x 0.03 MiB/s 0.19 MiB/s
codex daily --offline --json 0.00 MiB 50.2ms 9.6ms 5.25x 44.00 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.09 MiB/s
codex session --offline --json 0.00 MiB 42.2ms 6.8ms 6.22x 44.25 MiB 2.75 MiB 0.06x 0.02 MiB/s 0.13 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 768.2ms 691.5ms 1.11x 728.25 MiB 748.25 MiB 1.03x 1.31 GiB/s 1.46 GiB/s
codex --offline --json 1.01 GiB 224.7ms 172.1ms 1.31x 88.00 MiB 93.75 MiB 1.07x 4.48 GiB/s 5.85 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.32 KiB 17.32 KiB +0.00 KiB 1.00x
installed native package binary 3324.84 KiB 3324.84 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@ryoppippi
ryoppippi merged commit 11c782f into main Jun 12, 2026
29 checks passed
@ryoppippi
ryoppippi deleted the chore/remove-dead-cache-gc branch June 12, 2026 00:19
ryoppippi added a commit that referenced this pull request Oct 14, 2026
* ci(release): shallow-clone the tag in native build jobs

The native build jobs checked out the release tag with fetch-depth: 0,
but nothing in the build path reads git history: CI builds the same
outputs from a default shallow checkout. The full clone cost up to 41s
on build-windows-x64 in run 38470996208, which finished within 20s of
the slowest leg.

* ci: keep the Linux Nix store on a Blacksmith sticky disk

The cache-nix-action store cache misses most of the time. Across ~25
CI pushes to main between 2026-09-25 and 2026-10-13, the native build
legs restored an entry in only 3-6 of ~19 runs each (macOS and Linux
alike), and a hit roughly halves the build step (linux-arm64: 82s vs
213s). Blacksmith's Actions cache allows 25 GB per repository per week
with LRU eviction, while the per-commit keys introduced in #1296 write
a fresh 1.3-3 GB entry for every job on every run: ~12 GB per push to
main, ~6 GB per PR run, up to 2.5 GB per hourly update-pricing run.
#1296 assumed the backend was effectively unlimited; it is not. Even
on a hit, restoring takes ~60s and the post-job save another ~40s.

On Blacksmith Linux runners, mount /nix from a sticky disk instead. A
job gets a copy-on-write clone of the last committed snapshot, so the
whole store is present at mount time with no restore or save step and
nothing counted against the cache quota. macOS and GitHub-hosted
runners have no sticky disks and keep using cache-nix-action.

#1296 dropped an earlier sticky-disk setup. This one avoids its
problems:

- Keys are per job and matrix leg but carry no workflow name, so
  release.yaml's build-native-packages mounts the disk ci.yaml keeps
  warm on every push to main instead of starting cold. autofix, which
  only runs on pull requests and so would never commit, borrows
  preflight's disk via the new disk-job input; both build the treefmt
  closure.
- The old trim dropped Crane's cargoArtifacts because nothing rooted
  them (#1274, #1279). The Linux build now roots them inside
  /nix/var/nix/gcroots, which persists with the disk, and
  keep-derivations/keep-outputs make GC keep their build-time closure
  (toolchain, vendored sources) too.
- The weekly GC workflow (#1295) mounted its own disk and never touched
  the real ones. Trimming now happens in the job that commits: once the
  disk is over half full, `nix-collect-garbage --delete-old` runs before
  the job adds to the store. Jobs without persistent roots go cold once
  per trim.

Only runs on main that are not pull_request(_target) events commit,
whatever `save` says, so pull request code (including forks) can read
main's store but never write the store that main and releases build
from. cache-nix-action keeps its existing behaviour, now also gated by
`save`.

Not confirmed from Blacksmith's documentation: the disk's capacity
(hence the relative threshold and the `df` log on every run) and which
snapshot wins when two runs commit the same key concurrently. Either
outcome is a valid store for a cache.

* ci(release): stop persisting the Nix store from release builds

Release builds now mount the Linux sticky disk that CI commits on every
push to main. Committing it from the release as well would only race
those commits with an equivalent store.

On macOS, the release's own cache-nix-action entries never survive to
the next release under Blacksmith's cache eviction, yet each save took
~40s (build-mac-arm64 and build-mac-x64 in run 38470996208) before the
job could finish and let the npm job start.

Add a save-nix-cache input to both native build actions, forwarded to
setup-nix-cache, skip rooting the Crane artifacts when nothing will be
saved, and pass save-nix-cache: false from release.yaml.

* ci: mount test's Nix sticky disk in the perf comment legs

ccusage-perf-comment only runs on pull requests, and pull requests
never commit a sticky disk, so its own per-leg keys would stay freshly
formatted on every run. Mount the disk test commits on every push to
main instead: it installs `just` and resolves the same flake inputs.

Both legs mount it read-only, so the per-runtime cache-scope that kept
their saves apart is no longer needed.

Reported by pullfrog in review.
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