diff --git a/AGENTS.md b/AGENTS.md index b433aea..0521b8d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -74,6 +74,14 @@ stripe listen --forward-to localhost:8080/api/webhooks/stripe Flyway migrations run automatically on Spring Boot startup. Migration files live in `backend/src/main/resources/db/migration/`. Naming: `V__descriptive_name.sql`. +**Before adding a migration:** run `./scripts/next-flyway-version.sh` and use that +version. Never reuse a version number already on `master`. Never edit a migration +after it has merged — add a new higher version instead. CI runs +`scripts/check-flyway-migrations.sh` against `origin/master`. + +If local dev Postgres fails with Flyway checksum / “migration not resolved locally” +after switching branches, run `./gradlew reset` (wipes the Docker DB volume). + To reset: `docker compose down -v && docker compose up -d`. Flyway schema migrations live in `db/migration/`; dev-only seeds (test users, @@ -152,6 +160,21 @@ Full details in `@CODING_GUIDELINES.md`. Key rules: list concrete changes as bullet points. Never write single-line "feat: add X" messages. +**Before every commit (mandatory — agents must not skip):** + +```bash +# from repo root; needs Docker running +export POSTGRES_DB=bilhej POSTGRES_USER=bilhej POSTGRES_PASSWORD=test_pw_ci_123 +export JWT_SECRET=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +export STRIPE_SECRET_KEY=sk_test_fake STRIPE_WEBHOOK_SECRET=whsec_fake STRIPE_PRICE_ID=price_fake +./gradlew check +``` + +This runs frontend lint, frontend unit tests (242), backend tests (163), coverage +thresholds, Flyway checks, and **all 90 E2E tests in Docker**. **Do not commit or +push if this fails.** Optional local guard: `./scripts/install-pre-commit-hook.sh` +(runs the same `check` on every `git commit`). + ### Frontend (Vue.js 3) - `