Skip to content

Docker environment - #43

Merged
adriaanzon merged 4 commits into
mainfrom
docker-environment
Jul 14, 2026
Merged

Docker environment#43
adriaanzon merged 4 commits into
mainfrom
docker-environment

Conversation

@adriaanzon

@adriaanzon adriaanzon commented Jul 13, 2026

Copy link
Copy Markdown
Member

Adds a local docker development environment for testing the plugin

Summary by CodeRabbit

  • New Features
    • Added a Docker-based local WordPress + WooCommerce + Sendy development stack with automatic provisioning.
    • Introduced a develop command-line workflow to start/stop, run tests in Docker, access the site, and pass through wp/Composer.
    • Added optional Cloudflare tunnel mode for webhook testing.
  • Documentation
    • Expanded local development, webhook, and testing instructions, plus a commented environment configuration template.
  • Chores
    • Updated ignore rules for environment files and formatting exclusions (for YAML).

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e167df9e-71aa-4bec-8097-2598f85b37a4

📥 Commits

Reviewing files that changed from the base of the PR and between 723dbb7 and d7477fc.

📒 Files selected for processing (9)
  • .env.example
  • .gitignore
  • .prettierignore
  • CONTRIBUTING.md
  • develop
  • docker-compose.yml
  • docker/provision.sh
  • docker/run-tests.sh
  • docker/test.Dockerfile
🚧 Files skipped from review as they are similar to previous changes (9)
  • .env.example
  • .gitignore
  • docker/test.Dockerfile
  • CONTRIBUTING.md
  • .prettierignore
  • docker/run-tests.sh
  • docker-compose.yml
  • docker/provision.sh
  • develop

📝 Walkthrough

Walkthrough

Adds a Docker-based WordPress/WooCommerce development environment with configurable services, automated site provisioning, lifecycle commands, Cloudflare tunnel support, and containerized PHPUnit execution.

Changes

Docker development environment

Layer / File(s) Summary
Environment configuration and services
.env.example, .gitignore, .prettierignore, docker-compose.yml
Defines local environment settings, ignores secrets, and configures persistent MySQL, WordPress, WP-CLI, tunnel, and test services.
WordPress and WooCommerce provisioning
docker/provision.sh
Installs and configures WordPress, locale packs, WooCommerce, sample products and orders, Sendy, and the login command.
Development lifecycle CLI
develop, CONTRIBUTING.md
Adds commands for starting, stopping, provisioning, logging in, testing, tunneling, and passing through WP-CLI or Composer commands, with matching development instructions.
Containerized PHPUnit execution
docker/test.Dockerfile, docker/run-tests.sh, CONTRIBUTING.md
Adds a test image and runner that cache the WordPress test suite and execute PHPUnit without local PHP or MySQL requirements.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant Develop
  participant DockerCompose
  participant MySQL
  participant WordPress
  participant WPCLI
  Developer->>Develop: ./develop up [--tunnel]
  Develop->>DockerCompose: start services
  DockerCompose->>MySQL: wait for healthy database
  DockerCompose->>WordPress: start WordPress
  Develop->>WPCLI: run provisioning
  WPCLI->>WordPress: install and configure site
  Develop->>Developer: print access details
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the changes but too generic to convey the main addition: a local Docker-based development environment. Rename it to something specific like 'Add local Docker-based development environment for plugin testing'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docker-environment

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
docker/test.Dockerfile (1)

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the test image to a tested version or digest.

wordpress:cli is a floating tag, so rebuilding can silently change the PHP/WP-CLI runtime and invalidate local test results. Pin a tested CLI/PHP tag, preferably by digest, and update it deliberately. (hub.docker.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/test.Dockerfile` at line 1, Update the FROM instruction in the test
Dockerfile to use a deliberately tested, immutable WordPress CLI image tag or
digest instead of the floating wordpress:cli reference, preserving the required
CLI/PHP runtime.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CONTRIBUTING.md`:
- Line 29: Update the disposable Docker environment prerequisites in
CONTRIBUTING.md to explicitly require a Bash-compatible shell and Docker Compose
v2 in addition to Docker, so the documented requirements match what the
./develop setup requires.

In `@develop`:
- Line 133: Update the password-file write in the setup script to ensure
.htadmin-password has mode 0600, either by creating it with restrictive
permissions or explicitly chmodding it after writing. Preserve the existing
password content and file-generation flow.

In `@docker-compose.yml`:
- Around line 19-34: Add a bounded WordPress readiness check for the wordpress
service, using a healthcheck that verifies core files are available before
marking the service healthy. Ensure the existing depends_on and WP-CLI
provisioning flow waits on this readiness status, while preserving the current
environment, ports, and volumes.

In `@docker/run-tests.sh`:
- Around line 6-10: Update the installation guard in the test setup to validate
both the test suite and WordPress core directories, and compare a persisted
installed-version marker with WP_VERSION. Reinstall when either directory is
incomplete or the recorded version differs, then write/update the marker only
after installation succeeds; preserve the existing cleanup and install command.

---

Nitpick comments:
In `@docker/test.Dockerfile`:
- Line 1: Update the FROM instruction in the test Dockerfile to use a
deliberately tested, immutable WordPress CLI image tag or digest instead of the
floating wordpress:cli reference, preserving the required CLI/PHP runtime.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: feb86746-699e-4aa9-ab70-4d4de6d6bc87

📥 Commits

Reviewing files that changed from the base of the PR and between 5269bf7 and 723dbb7.

📒 Files selected for processing (9)
  • .env.example
  • .gitignore
  • .prettierignore
  • CONTRIBUTING.md
  • develop
  • docker-compose.yml
  • docker/provision.sh
  • docker/run-tests.sh
  • docker/test.Dockerfile

Comment thread CONTRIBUTING.md Outdated
Comment thread develop Outdated
Comment thread docker-compose.yml
Comment thread docker/run-tests.sh Outdated
@adriaanzon
adriaanzon force-pushed the docker-environment branch from 723dbb7 to d7477fc Compare July 14, 2026 08:51
@adriaanzon
adriaanzon merged commit 9fe4bf0 into main Jul 14, 2026
9 checks passed
@adriaanzon
adriaanzon deleted the docker-environment branch July 14, 2026 08:55
@coderabbitai coderabbitai Bot mentioned this pull request Aug 7, 2026
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