Skip to content

refactor(release): copy the stable zip where it is published - #79

Merged
sydevs-bot merged 2 commits into
mainfrom
claude/refactor-77-stable-zip-copy
Nov 7, 2026
Merged

sydevs-bot merged 2 commits into
mainfrom
claude/refactor-77-stable-zip-copy

Conversation

@sydevs-bot

Copy link
Copy Markdown
Contributor

Summary

Change outline

The copy crosses a step boundary. package.sh keeps every check; it just stops naming a release asset.

 job: release                                      .github/workflows/release.yml
   Build the plugin zip
     package.sh build/src build                    .github/scripts/package.sh
       check the four version declarations
       stage, zip, inspect: top folder, required files, .distignore leak
-      cp "$OUT/$ZIP" "$OUT/sahaj-atlas.zip"       # ran on every PR, where nothing read it
-      GITHUB_OUTPUT: version= zip= stable_zip= pending=
+      GITHUB_OUTPUT: version= zip= pending=
   Tag and publish
     tag the target, push the tag
+    STABLE_ZIP="$(dirname "$ZIP")/sahaj-atlas.zip"
+    cp "$ZIP" "$STABLE_ZIP"
     gh release upload|create … "$ZIP" "$STABLE_ZIP"   # unchanged, still both assets

Test results

  • Lean gate: ✓ pnpm test:all — php lint, measure, the WordPress 6.7 / PHP 7.4 behaviour suite, and the render lane. 0 failures.
  • Targeted (the ticket's verification checklist): ✓ bash -n .github/scripts/package.sh; ✓ release.yml parses as YAML and bash -n passes on all 4 of its run: blocks; ✓ grep -rn stable_zip .github/ returns nothing; ✓ git diff 2306453~1 -- .github/scripts/package.sh is empty.
  • Behaviour of the moved lines: ✓ exercised by lifting the two lines out of the shipped workflow and running them against the build/sahaj-atlas-<version>.zip shape package.sh emits — derives build/sahaj-atlas.zip and copies it byte for byte. The check was confirmed to fail against origin/main's workflow before being kept.
  • Build: N/A

Manual verification

cp runs only on a real release, so no lane reaches it.

  1. On the next release, confirm the GitHub Release carries both sahaj-atlas-<version>.zip and sahaj-atlas.zip, and that https://github.com/sydevs/SahajAtlasWordpress/releases/latest/download/sahaj-atlas.zip resolves.
  2. CI's own package.sh run on this PR (ci.yml runs package.sh . build) is the check that the revert did not break the build. It could not be run in this session — see Detail.

Notes for reviewer

  • Merge order: land this after fix(docs): correct two false claims #76 shipped about the stable zip #78. fix(docs): correct two false claims #76 shipped about the stable zip #78 corrects the ⚠ comment's wording in package.sh; this PR moves that comment to release.yml already carrying fix(docs): correct two false claims #76 shipped about the stable zip #78's corrected text, so the comment is never moved in its superseded wording. Whichever lands second needs one trivial conflict resolution in package.sh, where this PR deletes the block fix(docs): correct two false claims #76 shipped about the stable zip #78 edits — the deletion wins.
  • dirname rather than a literal build/: VERSION is regex-validated to MAJOR.MINOR.PATCH (package.sh:19) before $ZIP is built, and the workflow makes the one call package.sh build/src build, so dirname "$ZIP" can only ever yield build. Deriving it keeps the build directory spelled once.
  • The copy still inherits every check, because it is made from the same $ZIP the earlier step already inspected — not from a rebuild.
  • The cp sits after the tag block, where refactor(release): copy the stable zip where it is published #77's Approach puts it. Two review lenses independently suggested moving it above the if ! git rev-parse block instead, so a failed cp could not leave a pushed tag with no release. I left it where the ticket specifies, and flag it for your call: the tag-before-publish window already exists for the gh release upload itself, it is self-healing (the next push to main re-enters the release path and reuses the tag at release.yml:69-70, and the update checker ignores an assetless tag), and a cp of a file built and verified moments earlier in the same job is about the least likely step to fail. Moving the two lines up is one commit if you prefer it.
  • Out of scope, as the ticket states: the plan step's ASSETS=$(gh release view … || true) swallows a transient API failure. Recorded in refactor(release): copy the stable zip where it is published #77's Notes, below the reporting bar, and deliberately untouched here.
  • AGENTS.md:272-274 is stale on two details — it omits readme.txt as a publisher of the link, and claims in the present tense that SahajCloud's Install tab gives it via WORDPRESS_PLUGIN_ZIP_URL, which a grep of the current SahajCloud checkout does not find. fix(docs): correct two false claims #76 shipped about the stable zip #78 already fixes both, in the same direction as this PR's comment wording, so this branch deliberately does not touch AGENTS.md — editing it here would manufacture a second conflict with fix(docs): correct two false claims #76 shipped about the stable zip #78 where there is currently none.
  • Pre-existing, surfaced not filed: no test lane asserts the two-name coupling. pnpm lint, test and test:render never look at release assets, and ci.yml runs only package.sh's checks. The sole guard is the plan step's absent-asset backfill, which is itself only exercised on main. Unchanged by this PR and mitigated by that backfill, so I have not filed a ticket — say the word if you want one.
  • comment-lint.mjs matched no files: its extension filter is JS/TS only, so it does not read .sh or .yml. The moved comment carries ⚠ and a #NNN breadcrumb, which the code-comments rule protects.
  • Dismissed review finding: the reverted rm -rf no longer deletes a stale build/sahaj-atlas.zip. Dismissed — acceptance criterion 1 requires package.sh to be byte-identical to its pre-ci(release): attach sahaj-atlas.zip so the download link never changes #76 state, so the line cannot be kept; and nothing reads that path. Every inspection in package.sh reads the versioned name only, the cp overwrites unconditionally, CI and the release job run on fresh runners, and build/ is in .distignore so a leftover cannot reach a staged copy. The only trace is a stale file in a local build/ after a pre-ci(release): attach sahaj-atlas.zip so the download link never changes #76 checkout.
Detail

Why the revert is byte-exact. package.sh was restored with git checkout 2306453~1 -- .github/scripts/package.sh rather than by hand-deleting the four items, so acceptance criterion 1 holds by construction rather than by inspection.

rsync is absent from the routine container, so package.sh could not be run end to end here — it fails at line 61 before zipping. The two moved lines were therefore exercised directly against the zip=$OUT/$ZIP shape package.sh writes to GITHUB_OUTPUT, with the OUT argument read from the workflow's own package.sh build/src build call rather than assumed. CI runs the real thing on this PR.

The ⚠ comment's factual claims were re-verified against the tree, not carried over on trust: README.md:30 and readme.txt:52 both send volunteers to releases/latest/download/sahaj-atlas.zip, and includes/updates.php:64 filters assets with /^sahaj-atlas.*\.zip$/i, which matches both names.

The backfill step is deliberately left alone. "Attach sahaj-atlas.zip to a release made without it" derives its own copy from a downloaded published asset, so it shares no input with the publish step's copy of a freshly built file. The two can never both run: backfill is set only inside the branch that also sets skip=true, and the publish step is gated on skip != 'true'.

Provenance is preserved. The copy's position relative to the checks has not moved: the old cp also sat at the end of package.sh, after the top-folder, required-file, POT-count, .po/.mo and .distignore leak checks. Nothing writes to build/ between the build step and the copy — the only commands ahead of it in Tag and publish are git rev-parse, git tag and git push, none of which touch the working tree.

Reviewed for this push: /simplify's four lenses (reuse, simplification, efficiency, altitude), /code-review high, and /security-review — the last required because securityReview.triggerPattern matches both changed paths. No security finding at reportable confidence: the workflow triggers only on push to main, push of v* tags and workflow_dispatch, so no untrusted input reaches it, and VERSION's head -1 | tr -d '[:space:]' plus the ^[0-9]+\.[0-9]+\.[0-9]+$ gate foreclose both path traversal and a GITHUB_OUTPUT line injection.

Spelling count unchanged. sahaj-atlas.zip appears the same number of times after this diff as before — it moved rather than multiplied, and went from spread across two files to one. A workflow-level env: holding the name was considered and rejected: the literal is a URL contract that must never change, and hoisting it would make it ungreppable from README.md and readme.txt.

Closes #77


Generated by Claude Code

package.sh builds and inspects the zip. Naming a release asset is the
publish step's concern, so the sahaj-atlas.zip copy moves to Tag and
publish, the only step that ever read it, and package.sh goes back to
what it was before #76.

CI runs package.sh on every PR, where the copy and the stable_zip
output were both no-ops, and cp has no failure worth exercising there.

Tag and publish derives the name from $ZIP rather than taking it as a
step output, so the two spellings cannot drift. The copy still inherits
every check package.sh runs on $ZIP — the top-folder check, the
required-file check and the .distignore leak check — because it is made
from that same inspected file.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXPWqoLQXqnqDwh559
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 6, 2026
@sydevs-bot

sydevs-bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 10:20Z resolve-conflicts · attempt 1 · session · done
  • 10:20Z resolve-conflicts · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 6, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

This draft has had no CI activity for hours and no session holds it. A mention (@sydevs-bot) or a push from you starts me again.

🤖 sydevs dispatcher

#78 landed the two prose fixes this branch was told to wait for, and both
touched lines this branch moves.

package.sh: the deletion wins. Acceptance criterion 1 of #77 requires the
file byte-identical to its pre-#76 state, so #78's reworded block cannot
be kept here. Its substance is not lost — the branch already moved that
comment to release.yml in #78's corrected wording, which is why the merge
order was specified.

release.yml: both sides kept. The branch's cp block stays, and #78's
--clobber comment replaces the "versioned zip first" claim the branch
still carried. #78 removed that claim as unenforceable: gh release upload
sends its file arguments concurrently, so argument order fixes nothing.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZPqFGsoWCUJ8aec7t
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Resolved against main. #78 landed, and both its edits touched lines this branch moves.

package.sh — the deletion wins, as this PR's notes predicted. #77's criterion 1 needs the file byte-identical to pre-#76, so #78's reworded ⚠ block cannot stay here. Its substance is not lost: the branch already moved that comment to release.yml in #78's corrected wording.

release.yml — not predicted, and both sides kept. The cp block stays, and #78's --clobber comment replaces the "versioned zip first" line this branch still carried. #78 deleted that claim as unenforceable, so taking my side wholesale would have resurrected it.

Re-verified after the merge: package.sh byte-identical to 2306453~1, grep -rn stable_zip .github/ empty, release.yml parses as YAML with bash -n clean on all 4 run: blocks, pnpm test:all 0 failures.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 6, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 6, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review November 6, 2026 10:27
@sydevs-bot
sydevs-bot requested a review from Ardnived November 6, 2026 10:27
@sydevs-bot
sydevs-bot enabled auto-merge November 6, 2026 10:27
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Adversarial review skipped: 2 file(s), 20 changed line(s), under review.skipWhen. Say @sydevs-bot review to force one.

🤖 sydevs dispatcher

@sydevs-bot
sydevs-bot added this pull request to the merge queue Nov 7, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 7, 2026
Merged via the queue into main with commit 86b6c53 Nov 7, 2026
27 checks passed
@sydevs-bot
sydevs-bot deleted the claude/refactor-77-stable-zip-copy branch November 7, 2026 21:45
@sydevs-bot sydevs-bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

refactor(release): copy the stable zip where it is published

3 participants