From 428bea1f0b8e156acfda3263b863f4426d084cf6 Mon Sep 17 00:00:00 2001 From: Marco Schaeck Date: Fri, 21 Aug 2026 08:44:47 +0200 Subject: [PATCH] build(ci): gate bpmn-to-code process-api drift Add a git diff --exit-code gate on the generated *ProcessApi.kt in the pre-merge backend job, mirroring the OpenAPI drift gate. ./gradlew build already regenerates the files in place, so a .bpmn edit without a regenerate now fails CI instead of silently drifting. Document the drift gate in AGENTS.md alongside the BPMN quality gates. --- .github/workflows/pre-merge.yml | 5 +++++ AGENTS.md | 3 +++ 2 files changed, 8 insertions(+) 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