Skip to content

Zip folder matches WordPress.org slug + one-copy guard + folder lock CI - #8

Merged
vapvarun merged 3 commits into
mainfrom
chore/wporg-folder-lock
Nov 24, 2026
Merged

vapvarun merged 3 commits into
mainfrom
chore/wporg-folder-lock

Conversation

@vapvarun

@vapvarun vapvarun commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

What changed

  • bin/build-release.sh: slug=activity-link-preview-for-buddypress (kept SLUG="$slug" so the rest of the script is unchanged), so the zip is dist/activity-link-preview-for-buddypress-<version>.zip with the folder activity-link-preview-for-buddypress/ (the WordPress.org slug). Every entry is now deflated (python zipfile instead of zip -rqX) and the standard WordPress.org folder lock block runs right after the zip is written. The required-file check now names languages/buddypress-activity-link-preview.pot literally (the POT is named after the text domain, not the folder). Version, docs-lint and leak gates are unchanged.
  • bp-activity-link-preview.php: one-copy guard (ACTIVITY_LINK_PREVIEW_FOR_BUDDYPRESS_LOADED) after the ABSPATH check, and every top-level function wrapped in function_exists(). No behaviour change otherwise; the diff is mostly re-indent, so review with "Hide whitespace".
  • .github/workflows/wporg-folder-lock.yml: the standard folder-lock CI (identical in every Wbcom .org plugin). ci.yml is untouched.

Why

The GitHub/store zip used the folder buddypress-activity-link-preview/ while WordPress.org installs activity-link-preview-for-buddypress/. Two folder names mean two copies on one site, and the second copy fatals with Cannot redeclare bp_activity_link_preview_load_textdomain().

Proof

  • dupe-load-test.sh on the base branch: FAIL both orders (Cannot redeclare bp_activity_link_preview_load_textdomain()). On this branch: PASS both orders.
  • bash bin/build-release.sh: zip built (15 files), lock passed. bin/local-ci.sh: LOCAL CI PASSED (WPCS 0 errors).
  • Zip file list vs svn ls -R https://plugins.svn.wordpress.org/activity-link-preview-for-buddypress/trunk (1.7.7): identical, 15 files each.
  • CI lock logic run locally: OK: zip folder 'activity-link-preview-for-buddypress' matches WordPress.org (bp-activity-link-preview.php).
  • php -l of the main file under PHP 8.1: no syntax errors.

Follow-up commit

The lock block is now bracketed by set +o pipefail / set -o pipefail. Under pipefail its unzip | head and unzip | grep -q pipes can exit 141 (SIGPIPE) and stop the build silently; this was reproduced 4 runs out of 5 on a 157-entry zip in another plugin. The block text itself is unchanged and the build was rerun green after the change.

@vapvarun

Copy link
Copy Markdown
Member Author
  • Folder lock block switched to the new pipefail-safe version from the standard (reads the zip listing once, no early-exit pipe). The set +o pipefail / set -o pipefail toggles are gone.
  • Removed the Grunt zip builder (clean/copy/compress config and the build task, which only fed the zip); checktextdomain/makepot and the default task stay. npm run build now runs bash bin/build-release.sh. .distignore comment updated. Zip still identical to .org trunk (15 files).

Re-proved: bash -n clean, bin/build-release.sh (run with env -u PHPRC) completed 5/5 times in a row with the zip folder = slug, dupe-load test PASS both orders, CI lock logic OK.

@vapvarun
vapvarun merged commit ae27d04 into main Nov 24, 2026
8 checks passed
@vapvarun
vapvarun deleted the chore/wporg-folder-lock branch November 24, 2026 04:01
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