Skip to content

fix(ci): include package manifests in node_modules cache keys - #2472

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-ci-node_modules-cache-vulnerability
Jul 2, 2026
Merged

fix(ci): include package manifests in node_modules cache keys#2472
JSONbored merged 1 commit into
mainfrom
codex/fix-ci-node_modules-cache-vulnerability

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • The node_modules cache key previously hashed only .nvmrc and lockfiles, allowing a package.json-only change to reuse stale or mutated node_modules and skip npm ci validation and lifecycle scripts.
  • The same omission existed for the review-enrichment cache, introducing the same bypass risk for that separate install.

Description

  • Expand the root cache key in .github/workflows/ci.yml to include package.json, workspace manifests (apps/*/package.json, packages/*/package.json), and package-lock.json, and update the explanatory comment accordingly.
  • Expand the review-enrichment cache key to include review-enrichment/package.json alongside its package-lock.json, and update its comment.
  • Update test/unit/ci-dependency-cache.test.ts to assert the manifest-aware cache keys for both the root and review-enrichment cache entries and to reflect the amended comment text.
  • Preserve the existing restore/skip/save wiring and the placement of the cache save step immediately after a successful install so only successful installs are cached.

Testing

  • Ran the targeted unit test: npx vitest run test/unit/ci-dependency-cache.test.ts --reporter=dot, which passed (2/2 tests).
  • Ran git diff --check, which reported no issues in the modified files.
  • npm run actionlint failed in this environment due to network/setup limitations reaching github.com and a WASM fallback reporting the repository's custom self-hosted label; this is an environment limitation and not caused by the change.
  • npm run test:ci could not complete here because it stops at the same actionlint setup failure in this environment.

Codex Task

@loopover-orb

loopover-orb Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-02 05:44:50 UTC

2 files · 1 AI reviewer · no blockers · readiness 68/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review

Review summary
The diff correctly expands both dependency cache keys from lockfile-only to manifest-plus-lockfile hashing, so package.json-only dependency or lifecycle changes no longer reuse a stale node_modules cache. The comments now match the behavior, and the targeted unit assertions cover both the root install and review-enrichment install cache keys. The changed workflow preserves the existing restore/install/save control flow and does not introduce a visible contract break.

Nits — 4 non-blocking
  • nit: test/unit/ci-dependency-cache.test.ts:46 repeats the manifest coverage checks after already asserting the exact hashFiles(...) argument, which makes the test slightly noisier without adding much protection.
  • test/unit/ci-dependency-cache.test.ts:46 could keep the exact hashFiles(...) assertion and drop the follow-up substring checks, or use a small helper/constant if you want each manifest called out explicitly.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:XS; no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 65 registered-repo PR(s), 55 merged, 554 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 65 PR(s), 554 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 65 PR(s), 554 issue(s).
  • Related work: Titles/paths share 6 meaningful terms. (PR #2470, PR #2476)
  • Related work: Titles/paths share 6 meaningful terms. (PR #2470, PR #2473)
  • Related work: Titles/paths share 6 meaningful terms. (PR #2470, PR #2471)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Triage stale or unlinked PRs.
  • No action.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 2, 2026
@JSONbored JSONbored self-assigned this Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.93%. Comparing base (118d537) to head (f5dfc7a).
⚠️ Report is 22 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2472   +/-   ##
=======================================
  Coverage   95.93%   95.93%           
=======================================
  Files         225      225           
  Lines       25338    25338           
  Branches     9218     9218           
=======================================
  Hits        24308    24308           
  Misses        417      417           
  Partials      613      613           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 67e7b03 into main Jul 2, 2026
12 checks passed
@JSONbored
JSONbored deleted the codex/fix-ci-node_modules-cache-vulnerability branch July 2, 2026 05:49
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant