Skip to content

Commit e70b3de

Browse files
jsell-rhclaude
andcommitted
ci: add OpenAPI generated code drift check
Fails CI if 'make generate' produces different output than what's committed. Catches stale generated code and broken OpenAPI specs. Currently expected to fail — generator has a pre-existing broken $ref in openapi.credentials.yaml (project-scoped paths missing). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 55a9772 commit e70b3de

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,24 @@ jobs:
226226
working-directory: components/ambient-api-server
227227
args: --timeout=5m
228228

229+
- name: Check OpenAPI generated code is up to date
230+
run: |
231+
cd components/ambient-api-server
232+
make generate
233+
if ! git diff --quiet pkg/api/openapi/; then
234+
echo ""
235+
echo "============================================"
236+
echo "ERROR: Generated OpenAPI code is out of date"
237+
echo "============================================"
238+
echo ""
239+
echo "The following files differ from what 'make generate' produces:"
240+
git diff --name-only pkg/api/openapi/
241+
echo ""
242+
echo "Run 'cd components/ambient-api-server && make generate' and commit the result."
243+
exit 1
244+
fi
245+
echo "OpenAPI generated code is up to date."
246+
229247
go-cli:
230248
runs-on: ubuntu-latest
231249
needs: detect-changes

0 commit comments

Comments
 (0)