Skip to content

docs: record the npm cache failure and fix two broken release checks#335

Open
arifulhoque7 wants to merge 1 commit into
weDevsOfficial:developfrom
arifulhoque7:docs/release-skill-npm-cache
Open

docs: record the npm cache failure and fix two broken release checks#335
arifulhoque7 wants to merge 1 commit into
weDevsOfficial:developfrom
arifulhoque7:docs/release-skill-npm-cache

Conversation

@arifulhoque7

@arifulhoque7 arifulhoque7 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the v2.4.0 release, which failed once then went green on a rerun.

The failure

Install and build died at npm ci:

npm error code EEXIST
npm error ENOENT: no such file or directory, rename '.../_cacache/tmp/4fe0ce98' -> '.../content-v2/sha512/...'
npm error File exists: .../content-v2/sha512/...

ENOENT on the temp file and File exists on the destination = corrupt npm _cacache, not a dependency problem. The workflow was unchanged since before v2.3.1 and package-lock.json was identical apart from the version bump.

setup-node's cache: 'npm' keys off the lockfile hash. The release commit bumps the version inside the lockfile, so a release tag always misses the key, restores a partial cache via restore-key, and npm ci collides with it.

Safe to rerun — it fails upstream of the disk-gate, zip, Release and SVN deploy, so nothing is published.

Two checks that were lying

Check Problem Fix
LAST=... sort -V | tail -1 Stray v2.11.12 (2025-07-24) sorts above v2.3.1 → every diff used the wrong baseline Sort by creatordate
grep -q 'BUILD_DIR' Matched the warning comment above the 10up step → false-failed every release Match ^\s*BUILD_DIR\s*:

Verified: date-sort now yields v2.4.0 v2.3.1; the BUILD_DIR check passes.

Also

  • The versioned wp.org zip returns HTTP 200 with body Not found until generated — looks like a broken release.
  • Last-known-good updated to v2.4.0; the untracked-build pipeline is now proven.

Docs only — .claude is excluded via .distignore, so nothing ships.

Summary by CodeRabbit

  • Documentation
    • Updated release guidance to reflect the current release and deployment workflow.
    • Added stronger pre-release validation and troubleshooting instructions, including npm cache failure recovery.
    • Clarified that SVN is the authoritative release source and added checks for invalid archive responses.
    • Updated release history and documented safeguards against misleading version selection.

The v2.4.0 deploy failed on a transient npm _cacache collision in the
Install and build step, then went green on a rerun. Document it so the next
release does not lose time re-diagnosing it, and fix two checks in the
pre-release block that were giving wrong answers.

- Document the EEXIST/ENOENT _cacache signature, why setup-node's npm cache
  always misses on a release commit (the version bump changes the lockfile
  hash), and that a rerun is safe because the step fails upstream of the
  disk-gate, zip, Release and SVN deploy. Call out the EBADENGINE warnings
  as red herrings that appear in green runs too.
- Derive the previous tag by creatordate instead of sort -V. A stray
  v2.11.12 tag from 2025-07-24 sorts above v2.3.1 and silently made every
  diff compare against the wrong baseline.
- Match the BUILD_DIR check to the YAML key. A bare grep also matched the
  warning comment above the 10up step, so the check false-failed every run.
- Note that the versioned wp.org zip returns HTTP 200 with a "Not found"
  body until it is generated, which reads as a broken release.
- Update the last-known-good release to v2.4.0, now that the untracked-build
  and 10up-sole-publisher pipeline is proven.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Updated the release skill documentation for tag selection, deploy validation, npm cache failures, SVN verification, and release-history facts.

Changes

Release Pipeline Guidance

Layer / File(s) Summary
Pre-release validation and npm troubleshooting
.claude/skills/wedocs-release/SKILL.md
Previous-release selection now uses tag creation dates, deploy validation anchors the BUILD_DIR: check, and npm cache EEXIST failures include retry and durable-fix guidance.
Post-release verification and release facts
.claude/skills/wedocs-release/SKILL.md
SVN is documented as authoritative, downloaded files are checked with file, the last good release is v2.4.0, and stray tag v2.11.12 is documented.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a rabbit with a release-note pen,
Checking tags from now and then.
SVN says, “Trust me,” clear and bright,
While npm caches get set right.
Hop, hop—v2.4.0 takes flight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main docs changes: recording the npm cache failure and fixing two release checks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/wedocs-release/SKILL.md:
- Around line 39-53: Update the mandatory verification checks in the release
skill to fail closed: replace the `grep ... && echo` checks for tracked
`assets/build`, missing `block_directories` or block entries, missing
`block-styles.php`, and workflow `BUILD_DIR` input with explicit conditional
checks that print the existing failure message and exit 1. Keep the Tailwind
check as a warning and preserve the final diff command.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c4fcc11c-89b3-48dc-9906-a4349128c473

📥 Commits

Reviewing files that changed from the base of the PR and between 7418e32 and e9617b1.

📒 Files selected for processing (1)
  • .claude/skills/wedocs-release/SKILL.md

Comment on lines 39 to 53
# 1. assets/build must be UNTRACKED now (10up builds + ships it from CI).
git ls-files assets/build | grep -q . && echo "FAIL: assets/build is tracked — untrack it (git rm -r --cached assets/build)"
# 2. register_blocks() must still have the full block list (security cleanups love to delete it)
grep -q 'block_directories' wedocs.php || echo "FAIL: register_blocks gutted"
grep -c 'assets/build/blocks/' wedocs.php # expect ~17-19 entries, not 1
# 3. the block-styles helper require must be intact
grep -q "blocks/helpers/block-styles.php" wedocs.php || echo "FAIL: block-styles require missing"
# 4. NO BUILD_DIR in the deploy workflow
grep -q 'BUILD_DIR' .github/workflows/deploy-org.yml && echo "FAIL: BUILD_DIR present — it strips the untracked build"
# 4. NO BUILD_DIR *input* in the deploy workflow. Match the YAML key only — a bare
# `grep BUILD_DIR` also matches the warning COMMENT above the 10up step and
# false-fails every single time.
grep -qE '^\s*BUILD_DIR\s*:' .github/workflows/deploy-org.yml && echo "FAIL: BUILD_DIR present — it strips the untracked build"
# 5. tailwind.config.js must be the clean ESM import form
head -6 tailwind.config.js | grep -q "^import {" || echo "WARN: tailwind not ESM-import form"
# 6. diff the two files security-cleanups have damaged before
git --no-pager diff "v$PREV" -- wedocs.php tailwind.config.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make mandatory checks fail closed.

These commands only print FAIL/WARN; they never terminate the script. Without explicit exit 1, a tracked assets/build or present BUILD_DIR can pass through the “mandatory” verification and continue toward release.

Use explicit if checks with exit 1 for hard failures; do not rely on grep ... && echo.

Proposed pattern
+set -euo pipefail
+
-if git ls-files assets/build | grep -q . && echo "FAIL: assets/build is tracked — untrack it (git rm -r --cached assets/build)"
+if git ls-files assets/build | grep -q .; then
+  echo "FAIL: assets/build is tracked — untrack it (git rm -r --cached assets/build)" >&2
+  exit 1
+fi
🧰 Tools
🪛 SkillSpector (2.3.11)

[error] 133: [TM1] Tool Parameter Abuse: Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Remediation: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.

(Tool Misuse (TM1))


[error] 40: [TM1] Tool Parameter Abuse: Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Remediation: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.

(Tool Misuse (TM1))


[error] 133: [TM1] Tool Parameter Abuse: Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Remediation: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.

(Tool Misuse (TM1))


[error] 141: [TM1] Tool Parameter Abuse: Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Remediation: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.

(Tool Misuse (TM1))

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/wedocs-release/SKILL.md around lines 39 - 53, Update the
mandatory verification checks in the release skill to fail closed: replace the
`grep ... && echo` checks for tracked `assets/build`, missing
`block_directories` or block entries, missing `block-styles.php`, and workflow
`BUILD_DIR` input with explicit conditional checks that print the existing
failure message and exit 1. Keep the Tailwind check as a warning and preserve
the final diff command.

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