Skip to content

fix(repo): make the CI that runs actually do what it claims - #30

Merged
kinlane merged 1 commit into
fix/lockfile-scarf-driftfrom
fix/ci-action-defects
Aug 3, 2026
Merged

fix(repo): make the CI that runs actually do what it claims#30
kinlane merged 1 commit into
fix/lockfile-scarf-driftfrom
fix/ci-action-defects

Conversation

@kinlane

@kinlane kinlane commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Closes #29. Refs #3, #15, #16.

Stacked on #28 — that PR unblocks yarn install, so this one is based on it in order to get a CI run that actually reaches these fixes. Merge #28 first and GitHub will retarget this to main automatically.

Three inherited defects, all the same class: configuration that looks correct, does nothing it claims, and fails silently.

1. safe.directory was hardcoded to the upstream repository name

- run: git config --global --add safe.directory /__w/spectral/spectral
+ run: git config --global --add safe.directory "${{ github.workspace }}"

A rename artifact from #2. The exception was granted to a path that does not exist here, so every git invocation died with detected dubious ownership and exit 128 — the only genuine job failure in an otherwise green matrix. Using github.workspace means it survives the next rename too.

2. The Actions caches have never worked

The keys were CircleCI syntax: {{ arch }} and {{ checksum "yarn.lock" }}. GitHub Actions does not interpolate those, and the runner log confirms the miss against the literal text.

The performance cost is the obvious half. The correctness cost is worse: the key was constant, so once a cache saved under it, every later run would restore that same cache no matter what yarn.lock said. A dependency cache that cannot distinguish one lockfile from another is a reproducibility problem — relevant to #15, not just to build times.

Now hashFiles('yarn.lock') with runner.os and runner.arch, plus a prefix restore-keys so a changed lockfile still gets a warm start rather than a cold one.

3. test-windows could never fire

  test-windows:
-   if: github.ref == 'refs/heads/develop'

Another develop remnant #16 missed. Windows was skipped every run in 0s — which in a run summary reads a lot like passing. It would not have fired on pull requests upstream either, since github.ref is refs/pull/N/merge on that event.

Underneath it, the harness step read if: matrix.node-version == '18.20.8' in a job with no matrix, so the expression was always empty and the step would have been skipped even if the job had run. Pinned to 18.20.8 to match Linux.

On the harness actions

I deleted the git rev-parse step rather than repairing it. It existed only to write SHAs to /tmp for the broken cache key, and it was simultaneously the thing failing on safe.directory. The cache now keys on github.sha with a prefix restore-key, which expresses the same intent without shelling out to git at all — one less thing to go wrong on a fresh clone.

What to expect from this run

spectral is a cross-platform tool with Windows-specific path handling and a dedicated Windows harness action, and nothing has verified any of it in this fork's history. This is the first run where it is exercised.

If Windows fails here, that is a finding and not a regression, and it belongs on #3 — which currently records Windows as unverified. I would rather learn that now than keep a job that reports 0s and looks fine.

Two acceptance criteria on #29 stay open until this run reports: confirming a cache hit appears, and checking whether a stale cache is already pinned under the old constant key and needs purging.

Three inherited defects, all the same class — configuration that looks correct,
does nothing it claims, and fails silently.

**safe.directory was hardcoded to the upstream repository name.** commit.yml
granted the exception to /__w/spectral/spectral. This fork's workspace is
/__w/spotlight-tools/spotlight-tools, so the exception applied to a directory
that does not exist and every git invocation died with "detected dubious
ownership" (exit 128). That is the only genuine job failure in an otherwise green
matrix. Now ${{ github.workspace }}, so it survives the next rename too.

**The Actions caches have never worked.** The keys used CircleCI template syntax:

    key: yarn-packages-{{ arch }}-{{ checksum "yarn.lock" }}

GitHub Actions does not interpolate that; it is a literal string, which the
runner log confirms by reporting a miss against the literal text. Two effects,
the second worse than the first: every run re-downloaded the whole dependency
tree, and because the key was constant, once a cache saved under it every later
run would restore that same cache regardless of what yarn.lock said. A dependency
cache that cannot tell one lockfile from another is a reproducibility problem,
not a performance one. Now hashFiles('yarn.lock') with runner.os and runner.arch,
and a prefix restore-key so a changed lockfile still gets a warm start.

The harness actions had the same defect, keyed on a SHA written to /tmp by a
git rev-parse step. That step is deleted rather than repaired: it existed only to
build the broken key, and it was also the thing failing on safe.directory. The
cache now keys on github.sha with a prefix restore-key, which expresses the same
intent without shelling out to git at all.

**test-windows could never fire.** It carried `if: github.ref ==
'refs/heads/develop'` — a develop remnant the sweep missed. No such branch exists
here, so Windows was skipped on every run in 0s, which in a run summary reads
much like passing. It would not have fired on pull requests upstream either,
since github.ref is refs/pull/N/merge on that event.

Its harness step also read `if: matrix.node-version == '18.20.8'` in a job with
no matrix, so the expression was always empty and the step would have been
skipped even had the job run. Pinned to 18.20.8 to match the Linux harness.

spectral is a cross-platform tool with Windows-specific path handling and a
dedicated Windows harness action. This is the first run in this fork's history
where any of it is exercised, so a Windows failure here is a finding rather than
a regression, and belongs on #3.

Closes #29
Refs #3, #15, #16

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@kinlane kinlane left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM

@kinlane
kinlane merged commit dc16aba into fix/lockfile-scarf-drift Aug 3, 2026
kinlane added a commit that referenced this pull request Aug 3, 2026
Three inherited defects, all the same class — configuration that looks correct,
does nothing it claims, and fails silently.

**safe.directory was hardcoded to the upstream repository name.** commit.yml
granted the exception to /__w/spectral/spectral. This fork's workspace is
/__w/spotlight-tools/spotlight-tools, so the exception applied to a directory
that does not exist and every git invocation died with "detected dubious
ownership" (exit 128). That is the only genuine job failure in an otherwise green
matrix. Now ${{ github.workspace }}, so it survives the next rename too.

**The Actions caches have never worked.** The keys used CircleCI template syntax:

    key: yarn-packages-{{ arch }}-{{ checksum "yarn.lock" }}

GitHub Actions does not interpolate that; it is a literal string, which the
runner log confirms by reporting a miss against the literal text. Two effects,
the second worse than the first: every run re-downloaded the whole dependency
tree, and because the key was constant, once a cache saved under it every later
run would restore that same cache regardless of what yarn.lock said. A dependency
cache that cannot tell one lockfile from another is a reproducibility problem,
not a performance one. Now hashFiles('yarn.lock') with runner.os and runner.arch,
and a prefix restore-key so a changed lockfile still gets a warm start.

The harness actions had the same defect, keyed on a SHA written to /tmp by a
git rev-parse step. That step is deleted rather than repaired: it existed only to
build the broken key, and it was also the thing failing on safe.directory. The
cache now keys on github.sha with a prefix restore-key, which expresses the same
intent without shelling out to git at all.

**test-windows could never fire.** It carried `if: github.ref ==
'refs/heads/develop'` — a develop remnant the sweep missed. No such branch exists
here, so Windows was skipped on every run in 0s, which in a run summary reads
much like passing. It would not have fired on pull requests upstream either,
since github.ref is refs/pull/N/merge on that event.

Its harness step also read `if: matrix.node-version == '18.20.8'` in a job with
no matrix, so the expression was always empty and the step would have been
skipped even had the job run. Pinned to 18.20.8 to match the Linux harness.

spectral is a cross-platform tool with Windows-specific path handling and a
dedicated Windows harness action. This is the first run in this fork's history
where any of it is exercised, so a Windows failure here is a finding rather than
a regression, and belongs on #3.

Closes #29
Refs #3, #15, #16

Co-authored-by: Claude Opus 5 (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