Skip to content

BUILD-12715 Let only one cache own the mise data directory in config actions (v1) - #396

Closed
SamirM-BE wants to merge 1 commit into
v1from
feat/smarini/BUILD-12715-miseCacheSingleOwner-v1
Closed

SamirM-BE wants to merge 1 commit into
v1from
feat/smarini/BUILD-12715-miseCacheSingleOwner-v1

Conversation

@SamirM-BE

Copy link
Copy Markdown
Contributor

What

Backport to the v1 branch of #395. Set cache: false on the step-security/mise-action step of config-poetry, config-uv and config-npm, and add a contract test (spec/mise-cache-owner_spec.sh) that fails if any of these steps stops disabling the cache.

Why

A job that installs mise first (for example with SonarSource/mise-action-wrapper, which restores its own cache into the mise data directory) and then calls config-poetry restores two different caches into the same directory:

  1. the first cache restores or builds a fresh tool tree;
  2. step-security/mise-action in config-* restores its default mise-v1-... cache with tar -xf ... -P over the same directory.

The older tarball overwrites files with the same name and keeps the others, so the tree becomes a mix of two installs and the pinned mise binary is replaced. With a cold first cache (new key, new tool set) the fresh install pulls today's dependencies and the old tarball is overlaid. For poetry this produced a venv holding filelock 4.2.x and 4.3.x files at once, and poetry version -s failed with an import or metaclass error.

Only one cache should own the mise data directory. config-* actions move the caller's mise files aside and only install helper tools (jfrog-cli, plus jq for npm), so their own cache is the one to drop.

Design choices and rejected alternatives

  • cache: false on the step rather than a different cache_key_prefix: a second prefix would still extract a second tarball over a live install.
  • Not pinning filelock: hides one package; any dependency whose layout changes between the cached and fresh install fails the same way.
  • Only the three config-* actions: they install helper tools only, so losing their cache costs one small download. build-poetry, build-npm, build-yarn, promote and update-release-channel install the caller's own tools (or AWS CLI) and may be the only mise cache for callers that do not use the wrapper. They are follow-ups (table below), not changed here.
  • cache: false is a documented input of the pinned step-security/mise-action v5.1.2 (if false, action will not read or write to cache; default key prefix mise-v1).

Impact on other workloads

All callers of config-poetry, config-uv, config-npm and of the build-* actions that call them. Callers get a fresh install of jfrog-cli (and jq for npm) on each run instead of a cache restore: measured in the validation run: the step took about 3.5 s with the install versus about 3.2 s restoring the cache, so no visible change (one run each, so an estimate). No change for the caller's own tools. build-* actions still run their own mise step with caching, but that step now runs before config-* and no second cache lands on top of it.

Separate, pre-existing and not changed here: config-* pins its own mise version, so after config-* the mise binary is that pinned version, not the one chosen by an earlier step (validation log: mise already installed (2026.10.2), but different version requested (2026.5.9)).

Per-action decision

Action Installs Decision
config-poetry jfrog-cli cache: false (this PR)
config-uv jfrog-cli cache: false (this PR)
config-npm jfrog-cli, jq cache: false (this PR)
build-poetry, build-npm, build-yarn caller's tools plus jfrog-cli follow-up: needs a single owner decision (wrapper first, or keep this cache and make config-* the non-writer)
promote jfrog-cli (plus any caller mise config, since it does not move it aside) follow-up: may be the only mise cache for non-wrapper callers
update-release-channel AWS CLI via mise_toml follow-up: same, and shares the mise-v1 family

Rollback

Revert this commit; behaviour returns to the previous double restore.

Cost

No new infrastructure. Slightly fewer cache reads and writes; a few seconds of runner time per config-* call. No measurable monthly change.

Validation

Throwaway runs in SonarSource/sonar-scanner-python on a cold wrapper cache key with a stale mise-v1 cache available (same shape as the failing jobs):

Follow-ups

  • Decide the single owner for the build-*, promote and update-release-channel actions.
  • Align the mise version pinned in config-* with the version callers choose.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

BUILD-12715

@gitar-bot

gitar-bot Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Wrapping up

Code Review ✅ Approved 🟡 Medium risk

Disabling mise caching in three config actions changes their install behavior; callers may download helper tools each run, adding a bounded runtime cost.

Sets cache: false on the step-security/mise-action step in config-poetry, config-uv and config-npm so only the caller's own mise cache owns the data directory, and adds a contract test guarding that setting. No issues found.

Verification Rules 1/1 met Repos 1 inspected · PRs 4 inspected

Functional validation No results

Rules 1 passed 5 not applicable

✅ StepSecurity maintained GitHub Actions

Broader impact Repos 1 inspected PRs 4 inspected
Cross-repo 1 repository inspected 0 open impacts

SonarSource/unified-dogfooding-actions Inspected

Cross-PR 4 PRs inspected 0 open impacts

PR 395: BUILD-12715 Let only one cache own the mise data directory in config actions Inspected
PR 379: Update GitHub actions Inspected
PR 378: Update dependency mise to 2026.11.14 Inspected
PR 10: Update dependency mise to 2026.11.14 Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@SamirM-BE SamirM-BE closed this Dec 4, 2026
@SamirM-BE SamirM-BE reopened this Dec 4, 2026
@SamirM-BE SamirM-BE closed this Dec 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

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