Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# CodeRabbit Configuration File
# Documentation: https://coderabbit.ai/docs/configuration

language: "en-US"
early_access: false

reviews:
# 'chill' provides a more relaxed review.
# Other option: 'assertive' (more strict)
profile: "chill"

# Set to true to allow CodeRabbit to request changes on PRs instead of just commenting
request_changes_workflow: false

# Adds a high-level summary at the top of the PR
high_level_summary: true

# A short informative poem about the changes
poem: true

# Updates the review status dynamically
review_status: true

# Whether to collapse the walkthrough table
collapse_walkthrough: false

# Paths to exclude from reviews. The '!' prefix means "ignore".
path_filters:
- "!**/*.min.css"
- "!**/*.min.js"
- "!vendor/**"
- "!node_modules/**"
- "!tags/**"
- "!assets/**"

# Example of how to add custom instructions for specific files:
# path_instructions:
# - path: "**/*.php"
# instructions: |
# Please ensure WordPress coding standards are followed.
# Pay special attention to security and input sanitization (e.g., escaping output).

chat:
# Allow CodeRabbit to automatically reply to comments on lines of code
auto_reply: true
6 changes: 5 additions & 1 deletion .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ When committing changes, you **MUST** follow strict commit hygiene practices:
- If a task involves multiple distinct logical changes, they must be committed separately.
2. **Commit Isolation**: Always review `git status` carefully before adding files. Do not use `git add .` unless you are absolutely certain that every modified file belongs in the same logical changeset. Add specific paths instead (`git add path/to/file`).
3. **Commit Messages**: Use clear, descriptive commit messages that specify the exact component being changed and the reason. Prefix with Conventional Commits tags like `Security:`, `Fix:`, `Chore:`, `Feat:` where appropriate.
4. **Environment Separation**: Never commit local testing configurations (e.g. `.wp-env.json`), workflow files, or temporary documentation drafts to the plugin release history unless explicitly required.
4. **Environment Separation & Repository Scope**: ONLY check in files that relate to the development, testing, and operation of this project. **NEVER** check in personal or business documents (like email templates, passwords, or unrelated data).
5. **Git Flow & Branching**:
- **Never push directly to `master`.**
- All development must take place on a dedicated feature or bugfix branch (e.g. `feature/ci-cd-setup`, `fix/xss-tooltip`).
- Changes must be pushed up to open a Pull Request against `master`, allowing CI tests to run and pass before merging.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json linguist-generated=true
19 changes: 19 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Deploy to WordPress.org

on:
push:
tags:
- "*"

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: none
tools: composer

- name: Install PHP dependencies
run: composer install --prefer-dist --no-progress

- name: Install NPM dependencies
run: npm ci

- name: Start Docker environment
run: npx @wordpress/env start

- name: Run PHPUnit Tests
run: npm run test:php

- name: Run E2E Tests
run: npm run test:e2e
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
vendor/
artifacts/
.phpunit.result.cache
pr_description.md
7 changes: 5 additions & 2 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"plugins": [
"."
".",
"https://downloads.wordpress.org/plugin/classic-editor.latest-stable.zip"
],
"testsEnvironment": false
"themes": [
"https://downloads.wordpress.org/theme/twentytwentyone.latest-stable.zip"
]
}
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Bootstrap Shortcodes Development Workflow

Welcome to the development repository for the Bootstrap Shortcodes WordPress Plugin.

## Git Flow & Contributing
This repository strictly adheres to **Git Flow**:
1. **No direct commits to `master`.** The `master` branch is protected.
2. For all changes, checkout a new branch from `master` (e.g., `feature/awesome-new-button` or `fix/button-styling`).
3. Commit your changes logically and atomically. Do not include unrelated files or business/personal notes.
4. Push your branch and open a Pull Request against `master`.
5. Automated CI/CD pipelines will run against your Pull Request. Once CI passes and the PR is reviewed, it may be merged.

## Repository Hygiene
Only development, testing, and project-related files are permitted in this repository. Never commit business communications, credentials, or unrelated documents.

## Local QA Testing
For local testing, we use `@wordpress/env`. See the [detailed workflow](.agents/workflows/local-qa.md) for instructions on spinning up the local test site.

## Automated Testing
This repository includes automated tests using PHPUnit for PHP logic and Playwright for End-to-End (E2E) testing. Both suites run inside the local `@wordpress/env` Docker environment.

### Setup
Install dependencies and initiate the test container:
```bash
npm install
npx wp-env start
npx wp-env run tests-cli \
--env-cwd=wp-content/plugins/bootstrap-shortcodes \
composer install
```

### Running Tests
To run the PHPUnit test suite:
```bash
npm run test:php
```

To run the Playwright E2E test suite:
```bash
npm run test:e2e
```
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "thewebshop/bootstrap-shortcodes",
"description": "Bootstrap Shortcodes WordPress Plugin",
"require-dev": {
"phpunit/phpunit": "^9.6",
"yoast/phpunit-polyfills": "^1.0 || ^2.0"
}
}
Loading
Loading