diff --git a/.github/workflows/pre-merge.yml b/.github/workflows/pre-merge.yml index 539d1ba..3c37eeb 100644 --- a/.github/workflows/pre-merge.yml +++ b/.github/workflows/pre-merge.yml @@ -40,6 +40,11 @@ jobs: - name: Gradle build (arch + unit + process + model validation + spec export) run: ./gradlew build --no-daemon + # generateBpmnModels runs as part of `./gradlew build` and writes the typed process API into + # the committed source tree; fail if the .bpmn models and the checked-in generated code drift. + - name: Verify the generated BPMN process API is in sync + run: git diff --exit-code -- 'service/app/src/main/kotlin/io/miragon/blueprint/adapter/process/*ProcessApi.kt' + # The OpenAPI spec is generated by a test and committed; fail if the code and the checked-in # contract have drifted. See docs/adr/0004-openapi-as-the-checked-in-contract.md. - name: Verify the committed OpenAPI contract is in sync diff --git a/AGENTS.md b/AGENTS.md index a4626f1..3d42f9d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -79,6 +79,9 @@ codebase "process" means the BPMN model, so the step rail is `widgets/leasing-pr - `bpmn-to-code` generates typed process constants from the models at build time; a custom model test requires every service task to use a delegate expression (`#{beanName}`). +- The generated `*ProcessApi.kt` is committed and **drift-gated**: `./gradlew build` regenerates it + in place, and CI runs `git diff --exit-code` on it, so a `.bpmn` edit without a regenerate fails + the build — same contract as the OpenAPI spec (ADR-0004). - `bpmnlint` runs on staged `.bpmn` via `.githooks/pre-commit` (install: `npm run hooks:install`). ## Testing