Skip to content

[WIP] Deployments via GitHub actions v3 - #183

Draft
ajaynes-godaddy wants to merge 58 commits into
masterfrom
mwc-1505-v3
Draft

ajaynes-godaddy wants to merge 58 commits into
masterfrom
mwc-1505-v3

Conversation

@ajaynes-godaddy

@ajaynes-godaddy ajaynes-godaddy commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds support for non-interactive (CI-driven) deploys to sake's deploy flow, and brings this branch up to date with the test infrastructure landing separately so the new logic has coverage. Builds on the prior WIP deploy work rather than starting over.

Issue: MWC-1505

Details

  • bin/sake.js propagates the spawned gulp process's exit code so CI can detect deploy failures.
  • helpers/arguments.js adds isNonInteractive(), isDryRunDeploy(), and newPluginVersion().
  • tasks/compile.js's --skip-linting flag now actually skips lintPhpTask (fixes a bug where the function reference was checked instead of invoked).
  • tasks/deploy.js's deployTask skips the WooCommerce upload/WordPress.org deploy steps during --dry-run, skips docs-issue creation when --non-interactive is set, and replaceVersionTask falls back to --new-version so it can run standalone outside the full deploy flow.
  • tasks/prompt.js's three prompts (version, WC upload, tested-zip confirmation) all skip their inquirer prompt in non-interactive mode.

This PR deliberately targets the test infrastructure branch from #182 rather than master, so this non-interactive deploy work can ship with real test coverage from the start instead of reinventing that infrastructure separately.

Check the issues filed in the plugin release actions repo for guidance on the action-side implementation.

QA

Setup

  • A WordPress/WooCommerce plugin repo configured to use this version of sake

Steps

  1. Run npx sake deploy --non-interactive --dry-run --new-version=1.2.3
    • Deploy completes without any prompts and logs "Dry run deployment successful"
  2. Run npx sake compile --skip-linting
    • The PHP lint step is skipped
  3. Run npm test
    • All tests pass

Before merge

  • This PR makes the appropriate modifications to automated tests or explains why none are needed
  • This PR makes the appropriate modifications to documentation or explains why none are needed
  • This change does not impact usage or expected outputs of covered code
  • I've bumped the AI Assistant framework version if one is available

agibson-godaddy and others added 28 commits March 14, 2025 16:20
# Conflicts:
#	helpers/arguments.js
#	tasks/lint.js
The PHP-lint condition in compile() checked the function reference itself
(always truthy) rather than calling it, so --skip-linting never actually
skipped lintPhpTask here. Pre-existing bug from this PR, unrelated to the
merge conflict resolution in the prior commit.
…ipts

- Guard sake.initConfig() behind a SAKE_TEST_MODE env var, since
  importing lib/sake.js otherwise calls initConfig() at module load
  time and exits the process outside a real plugin directory
- Add a minimal fixture plugin directory and a chdir helper so tests
  can exercise sake's config logic against a realistic plugin
- Add npm test and test:watch scripts, and a throwaway import-crash
  smoke check across every tasks/*.js file to prove the gate works
Runs on ubuntu-latest with actions SHA-pinned to node24-native releases
(checkout v7.0.1, setup-node v7.0.0), resolving the Node version from
package.json's existing engines field rather than hardcoding one.
….js style

replaceVersionTask now falls back to --new-version (via newPluginVersion())
when no version has been set via the interactive prompt, so it can be
invoked standalone (e.g. from CI) rather than only inside the full deploy
series. Also removes stray semicolons and trailing whitespace in
prompt.js introduced by the non-interactive-mode changes, to match the
rest of the file's style.
Covers the logic introduced for MWC-1505: isNonInteractive()/isDryRunDeploy()/
newPluginVersion() in helpers/arguments.js, the --skip-linting gating in
compile(), the --dry-run/--non-interactive gating in deployTask(), the
--new-version fallback in replaceVersionTask(), and the non-interactive
short-circuits in promptDeployTask/promptWcUploadTask/promptTestedReleaseZipTask.

Builds on the test infrastructure merged in from PR #182 rather than
reinventing it; does not re-cover the pre-existing functions/behavior
already tested by PR #181.
@ajaynes-godaddy ajaynes-godaddy self-assigned this Oct 4, 2026
Base automatically changed from poc/add-tests-infra to master October 5, 2026 20:57
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.

2 participants