Skip to content

Add Push MD branch previews#71

Merged
artpi merged 14 commits into
trunkfrom
codex/push-md-branch-previews
Jul 13, 2026
Merged

Add Push MD branch previews#71
artpi merged 14 commits into
trunkfrom
codex/push-md-branch-previews

Conversation

@artpi

@artpi artpi commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Push MD preview branches: non-trunk pushes are stored as Git refs/metadata and do not mutate WordPress content or revisions.
  • Add admin-only frontend previews at ?branch=<branch_name>, including branch-only posts in front-page/query-loop rendering.
  • Print changed preview URLs in branch push output so each modified branch path is directly clickable.
  • Add a nested admin-bar switcher under the site menu: PushMD Branch -> Live site / <branch>.
  • Add REST endpoints to list and merge preview branches, safe push-header validation, merge validation, live Docker E2E coverage, and supporting Git/Filesystem delete-ref fixes.

Manual Testing Instructions

Zrzut ekranu 2026-06-19 o 17 21 29 Zrzut ekranu 2026-06-19 o 17 41 35
  1. In a Push MD checkout, create a non-trunk branch and change an existing post plus create a new post on that branch.
  2. Push the branch to the site, for example git push origin HEAD:refs/heads/<branch>.
  3. Confirm push output includes the branch Preview: URL and Changed preview URLs: entries for modified content, all using ?branch=<branch>.
  4. Log in as an admin and open a preview URL. Confirm the response includes X-Push-MD-Preview-Branch: <branch>, cache-busting headers, and the preview notice.
  5. Open the home page or another query-loop/archive view with ?branch=<branch> and confirm branch-only new posts appear there.
  6. Use the admin bar site menu: PushMD Branch -> Live site / <branch> and confirm it switches between the live URL and branch preview URL.
  7. Confirm live content and revisions are unchanged until the preview branch is explicitly merged.
  8. Merge the branch and confirm the expected content/revisions are applied to live content.

Jurassic Ninja Smoke Test

  • Built the deployable plugin package with bash bin/build-plugins.sh and deployed dist/plugins/push-md.zip to the Jurassic Ninja test site.
  • Remote backup was created before deploy.
  • Remote php -l passed for the deployed plugin file.
  • Push_MD_Plugin::list_preview_branches() returned edit-default-post.
  • Logged-in request to https://quickly-respectable.jurassic.ninja/?branch=edit-default-post returned HTTP 200, X-Push-MD-Preview-Branch: edit-default-post, no-store cache headers, the active branch switcher, Live site, and the branch-only New Post content.

Notes

  • composer test was attempted, but the Blueprints phase failed after a GitHub download timeout for wp-cli.phar, then cascaded into incomplete WordPress install errors.
  • composer lint still reports existing warnings outside the files changed by this PR; changed-file PHPCS is clean.
  • For manual Jurassic Ninja deploys, use the built plugin zip. Copying the raw source plugin file into the built plugin can break scoped autoloading.

@artpi
artpi force-pushed the codex/push-md-branch-previews branch from fd484e4 to c9673b8 Compare June 19, 2026 12:27
@artpi artpi changed the title [codex] Add Push MD branch previews Add Push MD branch previews Jun 19, 2026
@artpi
artpi marked this pull request as ready for review June 19, 2026 15:46
@artpi artpi self-assigned this Jun 28, 2026
@artpi
artpi force-pushed the codex/push-md-branch-previews branch from 3c50b11 to b8dcaa4 Compare July 13, 2026 08:44
@artpi
artpi merged commit 1dee745 into trunk Jul 13, 2026
24 checks passed
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