Skip to content

chore(ci): stop lint from saving build cache#9298

Merged
jdx merged 4 commits intomainfrom
chore/disable-lint-build-cache-save
Apr 22, 2026
Merged

chore(ci): stop lint from saving build cache#9298
jdx merged 4 commits intomainfrom
chore/disable-lint-build-cache-save

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Apr 22, 2026

Summary

  • keep the test workflow lint job restoring the shared Rust build cache
  • stop the lint job from writing that cache back on main

Why

  • remove another writer for the oversized shared Linux Rust cache
  • keep cache reads in lint without letting this job refresh the shared cache entry

Testing

  • not run (workflow-only change)

This PR was generated by an AI coding assistant.


Note

Low Risk
Mostly CI/workflow and small refactors; behavior changes are limited to GitHub Actions cache writing and minor task output ordering code reshaping.

Overview
Stops the test workflow lint job from writing back to the shared Rust build cache by forcing Swatinem/rust-cache save-if: false, while still restoring the cache.

Includes a few no-behavior-change cleanups: standardizes descending sorts via sort_by_key(Reverse(..)) (picker + asset matching), simplifies some control flow in task_output_handler and mise-interactive-config add-entry handling, and updates a unit test to use std::io::Error::other.

Reviewed by Cursor Bugbot for commit e28e623. Bugbot is set up for automated code reviews on this repo. Configure here.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 22, 2026

Greptile Summary

This PR makes the lint job in test.yml stop writing the shared Rust build cache (changing save-if from a main-branch condition to hardcoded false) while keeping cache restores intact. The remaining changes are mechanical Rust idiom improvements: sort_by_key(Reverse(…)) replacing sort_by closures, a while let loop replacing a loop/let-else/break pattern, a std::io::Error::other(…) simplification, and match-guard reformatting — none with functional impact.

Confidence Score: 5/5

Safe to merge — CI-only cache config change plus purely mechanical, semantics-preserving Rust refactors.

All changes are either a single-line CI tweak with the intended effect clearly described, or well-understood Rust idiom equivalences (sort_by_key+Reverse, while-let, Error::other). No logic alterations, no new code paths, no security surface changes.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/test.yml Lint job's rust-cache save-if changed from github.ref == refs/heads/main to false, permanently preventing the lint job from writing the shared build cache while still restoring it.
crates/mise-interactive-config/src/editor/actions.rs Reformatted match arm guards from inline if style to preferred Rust style (guard on same line as =>); purely cosmetic with no semantic changes.
crates/mise-interactive-config/src/picker.rs Replaced sort_by(
src/backend/asset_matcher.rs Same sort_by to sort_by_key(Reverse) refactor applied to two sort sites in AssetPicker; functionally equivalent.
src/main.rs Simplified std::io::Error::new(ErrorKind::Other, …) to std::io::Error::other(…) in a test; no behavioral change.
src/task/task_output_handler.rs Replaced loop { let Some(…) = … else { break; }; … } with while let Some(…) = …, and reformatted a match guard; both are mechanical idiom improvements with no semantic change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[lint job starts] --> B[Swatinem/rust-cache\nshared-key: build]
    B --> C{Cache hit?}
    C -- yes --> D[Restore cache]
    C -- no --> E[No restore]
    D --> F[Run lint steps]
    E --> F
    F --> G{save-if}
    G -- before: github.ref == main\nafter: false --> H[Never save cache]
    H --> I[lint job completes]

    style H fill:#f9c,stroke:#c66
    style G fill:#ffe,stroke:#cc9
Loading

Reviews (5): Last reviewed commit: "revert: undo prettier reformatting of do..." | Re-trigger Greptile

@jdx jdx force-pushed the chore/disable-lint-build-cache-save branch from 72ac199 to b6a987e Compare April 22, 2026 14:11
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.18 x -- echo 19.4 ± 1.0 17.5 26.6 1.00
mise x -- echo 20.1 ± 0.9 18.4 30.0 1.03 ± 0.07

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.18 env 19.2 ± 1.2 17.7 30.8 1.00
mise env 19.7 ± 0.9 18.4 30.9 1.03 ± 0.08

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.18 hook-env 19.7 ± 1.0 18.1 26.6 1.00
mise hook-env 20.1 ± 0.9 18.6 31.2 1.02 ± 0.07

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.18 ls 17.5 ± 0.7 15.8 23.1 1.00
mise ls 18.8 ± 0.7 17.3 27.4 1.07 ± 0.06

xtasks/test/perf

Command mise-2026.4.18 mise Variance
install (cached) 117ms 128ms -8%
ls (cached) 68ms 69ms -1%
bin-paths (cached) 71ms 72ms -1%
task-ls (cached) 732ms 738ms +0%

Comment thread docs/backend-plugin-development.md Outdated
Comment thread docs/url-replacements.md Outdated
jdx and others added 4 commits April 22, 2026 11:37
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The prettier fix collapsed GitHub-flavored admonition syntax onto a
single line, which VitePress/Vue cannot parse, breaking the docs build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jdx jdx force-pushed the chore/disable-lint-build-cache-save branch from 7afd20d to e28e623 Compare April 22, 2026 16:38
@jdx jdx merged commit 905e389 into main Apr 22, 2026
36 checks passed
@jdx jdx deleted the chore/disable-lint-build-cache-save branch April 22, 2026 17:02
jdx added a commit that referenced this pull request Apr 22, 2026
## Summary
- Re-enable `lint` as the Linux writer of the shared `build` rust-cache
entry on `main` (revert the save-side of #9298)
- Picks up pre-existing prettier drift in two docs files flagged by the
pre-commit hook

## Why
After #9297 (release-plz save-if: false) and #9298 (lint save-if:
false), no Ubuntu job remained that saved the shared `build` cache. The
other jobs with `shared-key: build` that still save (`unit` on macOS,
`windows-unit`) use different per-OS cache entries, so the Linux `build`
entry had no writer at all. It would stay stuck at whatever was saved
before #9298 and eventually be evicted (7-day LRU / 10GB cap) with
nothing to refresh it — which is why the most recent `release-plz` run
didn't restore a fresh cache.

`lint` is a good writer choice: it runs the most thorough build (`cargo
clippy --all-features --all-targets` plus `cargo
deny`/`msrv`/`machete`), producing the most complete `target/` for
downstream restorers.

## Test plan
- [ ] Next `main` push: verify lint job saves the `build` cache and
subsequent PRs restore it

*This PR was generated by an AI coding assistant.*

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: only adjusts CI cache save conditions and tweaks markdown
formatting in docs, with no production code or runtime behavior changes.
> 
> **Overview**
> Re-enables saving the shared `rust-cache` `build` entry from the
Ubuntu `lint` job by changing `save-if` to only write on
`refs/heads/main`, ensuring Linux builds keep the cache refreshed.
> 
> Also fixes markdown admonition formatting in two docs pages
(`backend-plugin-development.md`, `url-replacements.md`) to match the
expected warning callout style.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
acfdeaf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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