feat(automation): Phase 6.1 – Production Validation helpers, CLI and tests - #2495
feat(automation): Phase 6.1 – Production Validation helpers, CLI and tests#2495ashleyshaw with Copilot wants to merge 9 commits into
Conversation
…d tests Closes #2043 - production-validation-helpers.js: five Phase 6.1 deliverable functions (runDeploymentChecklist, setupProductionEnvironment, runSmokeTests, validateRollbackPlan, configureMonitoring) plus parseProductionArguments and executeAllProductionValidations - production-validation.js: CLI script mirroring staging-validation.js - __tests__/production-validation.test.js: 56 unit, integration, and edge-case tests – all passing
…terministic durationMs in runSmokeTests
There was a problem hiding this comment.
🟡 Changes recommended
There are API/CLI usability issues (empty override arrays silently falling back to defaults and failures not surfacing error messages) plus a potentially risky lockfile change removing libc constraints for native optional deps.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a Phase 6.1 “production validation” automation module (helpers + CLI) under scripts/automation/, modelled on the existing staging validation pattern, plus a Jest test suite to exercise the new helpers.
Changes:
- Added
production-validation-helpers.jswith pure helper functions for checklist, environment, smoke tests, rollback validation, monitoring config, arg parsing, and orchestration. - Added
production-validation.jsCLI entrypoint to run a single task or all checks and set process exit codes accordingly. - Added
production-validation.test.jsJest suite covering defaults, overrides, and edge cases for the helpers.
File summaries
| File | Description |
|---|---|
| scripts/automation/production-validation.js | New CLI wrapper for running Phase 6.1 production validation tasks and reporting results. |
| scripts/automation/production-validation-helpers.js | New helper module implementing the production validation task functions and orchestration. |
| scripts/automation/tests/production-validation.test.js | New Jest coverage for the production validation helper functions. |
| package-lock.json | Lockfile update removing libc constraints from several platform-specific optional native packages. |
Review details
Suppressed comments (1)
scripts/automation/production-validation-helpers.js:220
- Similar to the checklist helper, providing
options.channels: []currently falls back to the default channels. This is surprising for an API that accepts overrides and makes it hard to intentionally configure zero channels during testing. Only default whenoptions.channelsisundefined, and fail fast on an empty array.
const channels =
options.channels && options.channels.length > 0
? options.channels
: defaultChannels;
- Files reviewed: 3/4 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
|
🚫 This PR description is missing required template content. Missing required section(s): Linked issues, Global DoD checklist Please update the PR body using one of the repository PR templates:
Empty placeholders, unchecked checklist boxes, and stub issue references do not count. |
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
2 similar comments
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
|
This PR's branch name Standard pattern: Based on linked issue type: Correct template should be: No action required — this is informational. Future PRs should use the correct branch name. See Branching Strategy for more info. |
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
❌ Branch Name Validation FailedThe branch name Required Format
Allowed Branch Types
Valid Examples
Invalid Examples
SolutionRename your branch to follow the pattern and update the PR. For more information, see docs/BRANCHING_STRATEGY.md. |
Implements the five Phase 6.1 production validation deliverables (deployment checklist, environment setup, smoke tests, rollback plan, monitoring/alerting) as a testable Node.js module, mirroring the existing
staging-validation-helpers.jspattern.Changes
scripts/automation/production-validation-helpers.js— pure functions for each deliverable:runDeploymentChecklist— verifies all deployment checklist itemssetupProductionEnvironment— confirms required services are running and healthyrunSmokeTests— exercises key production endpoints (health, auth, report generation, webhooks)validateRollbackPlan— asserts plan is documented, tested, and within time thresholdconfigureMonitoring— wires notification channels and validates alert thresholdsexecuteAllProductionValidations— orchestrates all five, returnsGO/NO-GO+ summaryscripts/automation/production-validation.js— CLI wrapper; supports--task <name>or--all, with--verbose,--no-dry-run, and--max-rollbackflags.scripts/automation/__tests__/production-validation.test.js— 56 unit, integration, and edge-case tests; all passing, 0 CodeQL alerts.Changelog
Added
production-validation-helpers.js: seven functions covering all Phase 6.1 validation deliverables.production-validation.js: CLI script for running individual or all production checks.production-validation.test.js: 56-test suite (unit + integration + edge cases).Checklist (Global DoD / PR)