|
| 1 | +# Contributing |
| 2 | + |
| 3 | +## Workflow overview |
| 4 | + |
| 5 | +All changes enter `master` exclusively via pull request. Direct pushes to `master` are blocked by branch protection rules. |
| 6 | + |
| 7 | +``` |
| 8 | +feature-branch → PR → CI (cs-fixer, phpstan, phpunit) → merge to master |
| 9 | +``` |
| 10 | + |
| 11 | +After merge, CI runs again on `master`. Release Please then opens or updates a "Release PR" that tracks the next version. When that Release PR is merged, a GitHub Release is created automatically and the Docker image is published. |
| 12 | + |
| 13 | +## Branch naming |
| 14 | + |
| 15 | +Use a descriptive lowercase name, optionally prefixed by the change type: |
| 16 | + |
| 17 | +``` |
| 18 | +fix/timer-table-layout |
| 19 | +feat/db-user-sync |
| 20 | +refactor/sass-build |
| 21 | +chore/composer-update |
| 22 | +``` |
| 23 | + |
| 24 | +No enforced pattern beyond keeping it readable. |
| 25 | + |
| 26 | +## Commit messages |
| 27 | + |
| 28 | +This project follows [Conventional Commits](https://www.conventionalcommits.org/). Every commit reachable from `master` must have a conforming title because Release Please reads them to determine the next version and generate the changelog. |
| 29 | + |
| 30 | +``` |
| 31 | +type(scope): short imperative description |
| 32 | +``` |
| 33 | + |
| 34 | +Common types and their effect on versioning: |
| 35 | + |
| 36 | +| Type | SemVer bump | Appears in changelog | |
| 37 | +|------------|-------------|----------------------| |
| 38 | +| `feat` | minor | yes | |
| 39 | +| `fix` | patch | yes | |
| 40 | +| `perf` | patch | yes | |
| 41 | +| `refactor` | patch | yes | |
| 42 | +| `chore` | patch | yes | |
| 43 | +| `docs` | patch | hidden | |
| 44 | +| `test` | patch | hidden | |
| 45 | +| `ci` | patch | hidden | |
| 46 | + |
| 47 | +A `!` suffix or `BREAKING CHANGE:` footer triggers a **major** bump regardless of type. |
| 48 | + |
| 49 | +Useful scopes for this project: `ui`, `auth`, `api`, `db`, `config`, `docker`, `ci`, `docs`. |
| 50 | + |
| 51 | +## Creating a pull request |
| 52 | + |
| 53 | +1. Create a branch from the latest `master`. |
| 54 | +2. Make commits with Conventional Commit titles. |
| 55 | +3. Push and open a PR against `master`. |
| 56 | +4. CI runs three jobs automatically: `PHP CS Fixer`, `PHPStan`, `PHPUnit`. |
| 57 | +5. All three must pass before the PR can be merged. |
| 58 | +6. Request review or merge it yourself if you are a maintainer. |
| 59 | + |
| 60 | +## Merge policy |
| 61 | + |
| 62 | +Use **squash merge** when merging PRs. The squash commit title becomes the changelog entry, so make sure it is a valid Conventional Commit title (GitHub pre-fills it from the PR title). |
| 63 | + |
| 64 | +After merge, CI reruns on `master`. If it passes, Release Please updates or creates its Release PR. |
| 65 | + |
| 66 | +## Code style |
| 67 | + |
| 68 | +Run the following before pushing to avoid CI failures: |
| 69 | + |
| 70 | +```bash |
| 71 | +vendor/bin/php-cs-fixer fix |
| 72 | +vendor/bin/phpstan analyse --no-progress |
| 73 | +vendor/bin/phpunit --no-progress |
| 74 | +``` |
| 75 | + |
| 76 | +See [testing.md](testing.md) for the full checklist and [standards.md](standards.md) for code conventions. |
0 commit comments