Skip to content

refactor(ci): remove no-op clear_zccache_stats() and its caller (#3129 A8) - #3195

Merged
zackees merged 1 commit into
masterfrom
fix/3129-a8-zccache-stats
Jun 16, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/3129-a8-zccache-stats

Conversation

@zackees

@zackees zackees commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

Summary

The clear_zccache_stats() function in ci/util/zccache_config.py was a no-op with a docstring citing zccache 1.0.3:

```python
def clear_zccache_stats() -> None:
"""Clear zccache statistics (no-op).

zccache 1.0.3 does not support --zero-stats.
Stats are per-daemon-uptime and reset automatically on daemon restart.
"""
pass

```

The current floor is 1.12.7, which still has no global "zero-stats" command — verified against `zccache --help` (only `--clear` (artifact cache), `status`, `session-start`, `session-end`, `session-stats`).

Why this is the right fix

Per-build metrics ARE accurate today via the session mechanism:

  • ci/meson/runner_helpers.py::_start_zccache_session calls zccache session-start --stats --log <path> and sets ZCCACHE_SESSION_ID in os.environ
  • All compiler invocations through zccache then attribute their work to that session
  • show_zccache_stats() at teardown queries session-stats $ZCCACHE_SESSION_ID and ends the session

So the no-op function and its no-op call site are both dead weight. The right replacement is a comment pointing at the actual mechanism.

What changes

File Change
ci/util/zccache_config.py Delete clear_zccache_stats() (no-op)
ci/util/test_runner.py Delete the import + call; replace with a comment pointing at the session mechanism

2 files changed, 4 insertions(+), 13 deletions(-) — net 9-line code reduction.

Part of #3129 (Section A8).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Removed unused cache clearing code and updated internal testing infrastructure comments to reflect current cache metrics handling via session mechanism.

The function's body was a pass with a docstring citing zccache 1.0.3.
The current floor is 1.12.7, which has no global "zero-stats" command —
zccache --help shows no such flag. So the docstring is stale AND the
function does nothing useful even on the current floor.

Per-build zccache metrics are already provided by the session mechanism
in ci/meson/runner_helpers.py::_start_zccache_session (which sets
ZCCACHE_SESSION_ID), then surfaced by show_zccache_stats() at teardown.
That is the correct mechanism for "stats from just this build" today.

This change:
- Deletes the no-op clear_zccache_stats() from ci/util/zccache_config.py
- Removes the call in ci/util/test_runner.py and replaces it with a
  comment pointing at the session mechanism.

Net: 13 deletions, 4 insertions.

Part of #3129 (Section A8).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e300d79c-8fec-4f95-abd4-3a0a6f9af861

📥 Commits

Reviewing files that changed from the base of the PR and between da59e86 and 8fb4153.

📒 Files selected for processing (2)
  • ci/util/test_runner.py
  • ci/util/zccache_config.py
💤 Files with no reviewable changes (1)
  • ci/util/zccache_config.py

📝 Walkthrough

Walkthrough

Removes the no-op clear_zccache_stats() function from ci/util/zccache_config.py and its call site in ci/util/test_runner.py. The removed stub existed due to missing --zero-stats support in an older zccache version; the call site is replaced with comments explaining that per-build metrics are now handled via a session mechanism.

Changes

Remove clear_zccache_stats stub and call site

Layer / File(s) Summary
Remove clear_zccache_stats definition and invocation
ci/util/zccache_config.py, ci/util/test_runner.py
Deletes the 9-line no-op clear_zccache_stats() function from zccache_config.py and removes the corresponding startup call in runner() in test_runner.py, replacing it with comments that document the session-based metrics flow and note that zccache 1.12.7 has no global zero-stats command.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A stub that did nothing has hopped away,
No clear_zccache_stats to call today.
Sessions now track what the cache has done,
Comments explain it — clean and fun!
One less no-op under the sun. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: removing a no-op function and its caller from the CI utilities as code cleanup.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ 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 fix/3129-a8-zccache-stats

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 and usage tips.

@zackees
zackees merged commit b46ce30 into master Jun 16, 2026
11 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 16, 2026
@zackees
zackees deleted the fix/3129-a8-zccache-stats branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant