ci(api-docs/ts): bring npm's cache-poisoning fix upstream, reconcile the rest - #134
Merged
Merged
Conversation
The TypeScript api-docs job runs on release tags and opens a cross-repo PR with DOCS_REPO_PR_TOKEN, so it is a privileged context. setup-bun enables dependency caching by default, which zizmor flags at error severity: a less-trusted run can populate the shared cache and have it restored here. resq-software/npm has carried this mitigation in its copy of the workflow since 2026-05-31, and that commit said in as many words that the upstream template needed the same change or the next sync would regress it. It never got it. Because the sync is a wholesale file copy, running automation/sync-templates.sh typescript today would delete the mitigation from the consumer. The npm copy cites that repo's own code-scanning alert number; the rationale is generalised here since it holds for any TypeScript consumer. The install step is already --frozen-lockfile, so a cold install is functionally identical. no-cache exists in setup-bun v2.0.2 (the pin in this file) as well as in the newer v2.2.0, so this change stands on its own.
Last surviving @resq-sw literal in this template that refers to the npm scope rather than to the machine account. The packages moved to @ResQ-Systems in July 2026; npm corrected this comment in its own copy at the time and the correction was never brought back. Comment only, no behaviour change. The tags: list keeps matching both scopes, which is deliberate (#101) and is left alone; this only stops the worked example from demonstrating a scope nothing publishes under any more.
|
Warning Review limit reachedNext included review available in 23 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
Dependabot's github-actions ecosystem only scans .github/workflows/, so
automation/source-repo-templates/ is invisible to it. This repo's own
dependabot.yml covers the workflows and nothing else, and the result
shows: changelog-sync.yml here runs checkout v7.0.0 and
create-pull-request v8.1.1 while every template still names v6.0.2 and
v7.0.8.
The consumers diverged the other way, because they do get Dependabot:
repo checkout create-pull-request
crates v7.0.1 v8.1.1
npm v7.0.1 v8.1.1
pypi v7.0.1 v8.1.1
vcpkg v7.0.1 v8.1.1
dotnet-sdk v6.0.2 v7.0.8
Four consumers converged on the same SHAs independently, so these are
the org's versions and the templates are the outlier. Since
sync-templates.sh overwrites the consumer file wholesale, syncing this
template today would walk npm back a major on both, plus setup-bun
v2.2.0 -> v2.0.2.
Every SHA below was resolved against the upstream tag before use:
actions/checkout v7.0.1 3d3c42e5aac5ba805825da76410c181273ba90b1
oven-sh/setup-bun v2.2.0 0c5077e51419868618aeaa5fe8019c62421857d6
peter-evans/create-pull-request
v8.1.1 5f6978faf089d4d20b00c7766989d076bb2fc7f1
create-pull-request v8 is a major bump, so its input surface was
diffed against this step: all 12 inputs used here (add-paths, author,
base, body, branch, commit-message, committer, delete-branch, labels,
path, title, token) are still accepted by v8.1.1.
npm's copy has run this workflow green on setup-bun v2.2.0 and
create-pull-request v8.1.1, three times on 2026-07-27, at checkout
v7.0.0. The v7.0.1 patch bump landed the day after and has not had a
release-tag run yet; it is the SHA the other consumers carry and the
one lychee.yml in this repo already runs.
Hand-bumping is a stopgap. The durable fix is to get the template
directory under automated updates, or to stop carrying literal pins in
the templates at all; that is bigger than this PR and the other four
templates have the same rot (the python template pins setup-uv v6.0.0
while pypi runs v10.1.0). This commit is separable if you would rather
fix it centrally.
WomB0ComB0
force-pushed
the
ci/api-docs-ts-reconcile-npm
branch
from
September 22, 2026 09:28
3bae3a0 to
df63a17
Compare
This was referenced Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Reconciles
resq-software/npm's copy of.github/workflows/api-docs.ymlagainst
automation/source-repo-templates/api-docs.typescript.yml, thefollow-up #132 deferred.
The two files differed by 92 changed lines across 12 hunks. Each hunk was
traced to the commit that created it —
git log --follow -pon the npm copy,git log -Son this template — and classified. Three hunks carry changesthat belong upstream. Seven are the template already being ahead, or values
that should differ. Two are noise.
This is not a wholesale re-sync. Nothing npm-specific is hoisted, and nothing
merged today is reverted.
Per-hunk classification
tags:matches one scope vs bothDOCS_REF_SLUGexample uses a dead scopeactions/checkoutpinsetup-bunpin + missingno-cacheread_versionvsread_manifestactions/checkoutpincreate-pull-requestpinBrought upstream
Hunk 5 —
no-cache: trueon setup-bun. npm added this on 2026-05-31 toclose a zizmor
cache-poisoningfinding at error severity: the job runs onrelease tags and opens a cross-repo PR with
DOCS_REPO_PR_TOKEN, so a cachepopulated by a less-trusted run must not be restorable into it. That commit
ended with a note saying the upstream template needed the same change or the
next sync would regress it. Four months later it still did not have it, and
because
sync-templates.shoverwrites the consumer file wholesale, runningthe sync today would have deleted the mitigation. This is the item #132
named as outstanding.
Generalised on the way up: npm's comment cites that repo's own code-scanning
alert number, which means nothing in a shared template. The rationale is
stated instead, and it holds for any TypeScript consumer.
no-cacheis aninput in setup-bun v2.0.2 as well as v2.2.0, so the fix does not depend on
the version bump in hunk 5's other half.
Hunk 3 — stale scope in a comment. The
DOCS_REF_SLUGworked examplestill demonstrated
@resq-sw/ui@v0.35.6. That scope stopped publishing inJuly 2026. npm corrected the comment in its copy at the time. Comment only,
no behaviour change; it is the last
@resq-swliteral in this file thatrefers to the npm scope rather than to the
resq-swmachine account, whichis correct and is left alone.
Hunks 4, 11, 12 (and half of 5) — the pins. Not a downstream fix, a
different problem: Dependabot's
github-actionsecosystem only scans.github/workflows/, soautomation/source-repo-templates/is invisible toit. This repo's own
changelog-sync.ymlruns checkout v7.0.0 andcreate-pull-request v8.1.1 while every template still names v6.0.2 and
v7.0.8 — same repo, same config, opposite freshness.
The consumers diverged the other way because they do get Dependabot:
cratesnpmpypivcpkgdotnet-sdkFour consumers converged on identical SHAs independently, so these are the
org's versions and the templates are the outlier — this is not npm's
preference being hoisted. Syncing the template as it stands would walk npm
back a major on both, plus setup-bun v2.2.0 → v2.0.2.
Deliberately not brought upstream
Hunks 9 and 10 — this is the one that conflicts with #132. npm's copy
hardcodes
@resq-systems/when building index entries. That is correcttoday and was a real fix when #167 made it in July. #132, merged this
morning, solves the same problem differently:
read_manifest()reads.nameout of the manifest it already opens for
.version. The upstream versionwins and is not touched. npm's fix restates the scope in a second place, so
it needs another edit at the next rename — which is exactly how the
@resq-swliteral survived two months. #132 derives from the source of truth and needs
no edit. Taking npm's version here would silently revert this morning's fix
for a strictly worse one. The next sync replaces npm's hardcode with the
derived form.
Hunk 2 — the
tags:list. npm matches only@resq-systems/*@v*; thetemplate matches that and
@resq-sw/*@v*. This looks like npm cleaning upafter the rename, but the history runs the other way: npm replaced the
pattern on 2026-07-12 and #101 added dual matching on 2026-07-24, twelve days
later, with the rationale in the comment. The template's superset is the
deliberate, newer decision. No action, and the legacy pattern is left in
place.
Hunks 6 and 7 — the generation loop. npm warns and continues when a
package fails; the template aborts the run (#113). Template-ahead, and the
stricter behaviour is the right one given that "Sync generated MDX" clears
the target directory before copying. Left alone, and deliberately not
softened toward the consumer's older shape.
Hunk 1 — the copyright holder. npm's copy says
ResQ Systems, Inc.;this template says
ResQ Software. npm#167 standardised the org onResQ Systems, Inc.as the copyright holder while explicitly keeping theresq-softwareGitHub org and theresq.softwaredomains. So the templateline is plausibly wrong — but it is wrong in the dotnet and python templates
too, the rust and cpp templates carry no copyright header at all, and which
legal entity holds copyright is not an engineering call. Changing one of
three templates would make the set less consistent, not more. Flagged, not
touched.
Hunk 8 is a single blank line.
Checked and found already in sync
Worth recording, because the drift was smaller than expected:
PUBLIC_PACKAGESis identical — same 16 packages, same order. fix(api-docs/ts): derive package names from the manifest, restore the 7 dropped packages #132already closed that gap.
<and>) and npm#233 (skipErrorChecking) areboth present upstream despite landing downstream in July. They were brought
back at the time; only the three items above were not.
Verification
before use, in both directions. All six pins on both sides already agreed
with their version comments — no repeat of the mismatch class fixed in fix(dotnet-docs): scan all .csproj candidates for a real version #56.
actions/checkoutv7.0.1 →3d3c42e5aac5ba805825da76410c181273ba90b1oven-sh/setup-bunv2.2.0 →0c5077e51419868618aeaa5fe8019c62421857d6peter-evans/create-pull-requestv8.1.1 →5f6978faf089d4d20b00c7766989d076bb2fc7f1against this step: all 12 inputs used here (
add-paths,author,base,body,branch,commit-message,committer,delete-branch,labels,path,title,token) are still accepted by v8.1.1.no-cacheconfirmed present in setup-bun'saction.ymlat both the oldand new pinned SHAs.
create-pull-request v8.1.1 and
no-cache: true— three times on2026-07-27, at checkout v7.0.0. The v7.0.1 patch bump landed the next day
and has not had a release-tag run yet; it is the SHA four consumers carry
today, and
lychee.ymlin this repo already runs it.actionlintclean on all five templates.either template-ahead, the reworded comment from hunk 5, or the two items
flagged above.
Follow-ups, deliberately not in this PR
bumping one template is a stopgap and it will rot again. The other four
have the same problem — the python template pins
setup-uvv6.0.0 whilepypiruns v10.1.0, four majors back. Worth either bringing the directoryunder automated updates or dropping literal pins from the templates.
pypicarries asetup-uvcache-poisoning mitigation that itstemplate lacks, the same shape as hunk 5. Not audited here.
were found by hand, months late, and one of them was flagged in its own
commit message at the time and still missed. A periodic template-vs-
consumer diff check would have surfaced all three the week they landed.
Test plan
no-cacheconfirmed as a valid input at both setup-bun pinsactionlintclean on all five templatesresq-software/npmand confirm the next release-tag run is green