Saltar al contenido principal

Your First Pull Request

1. Create a feature branch

Always branch from develop:

git checkout develop
git pull origin develop
git checkout -b 020-your-feature-description

The number prefix (020-) is sequential across the plugin. Check existing branches to find the next available number.

2. Code

Follow coding standards. Keep the change focused — one feature or bug fix per branch.

3. Write tests

Every PR must include tests for the code it adds:

TypeWhen to write
Unit testsEvery model method, service, utility
Integration testsDB interactions, model load/save
E2E tests (Playwright)Every user-facing flow, one per wireframe
Permission testsOne per role per feature

Tests live in Test/ inside each plugin repo.

# Run all tests
./vendor/bin/phpunit --testdox

# Run a specific test file
./vendor/bin/phpunit Test/Unit/AppointmentModelTest.php

A PR without tests is rejected by Javi. This is a hard rule.

4. Check for build errors

# PHP syntax check (catches parse errors)
find . -name "*.php" -not -path "./vendor/*" -exec php -l {} \; | grep -v "No syntax errors"

# If you touched the docs site
npm run build

5. Push and open the PR

git push -u origin 020-your-feature-description

gh pr create \
--base develop \
--title "feat: your feature description" \
--body "See REVIEW.md for smoke test checklist."

6. Write REVIEW.md

Every PR includes a REVIEW.md at the repo root in your branch:

# REVIEW.md — PR #NNN: Feature Name

## What changed
- Bullet list of changes (not a git log — explain the WHY)

## How to test
1. Install plugin fresh on clean FacturaScripts
2. Steps to reproduce the feature
3. Expected result

## Smoke test checklist
- [ ] Plugin installs without errors
- [ ] Main flow works end-to-end
- [ ] Edge cases covered (list them)
- [ ] No regressions in adjacent features
- [ ] DB migrations applied cleanly
- [ ] Translations present (es_ES + en_US)

## Notes for Javi
Any deployment notes, migration order, or gotchas.

7. Wait for Javi

Javi reviews and merges on merge days. Do not merge the PR yourself. You will receive GitHub notifications when the PR is merged.

After merge

# Update your local develop
git checkout develop
git pull origin develop

# Delete the merged branch
git branch -d 020-your-feature-description

If the feature changes the master plan spec, move the completed item to obeliOmed-MasterPlan/40-OPERATIVO/MASTERPLAN-CHANGELOG.md and update the plugin _SESSION-LOG.md.