mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-09 01:35:18 +02:00
Revert "Add opt-in git hook for openapi.json drift"
This reverts commit 7427d87e9a.
This commit is contained in:
parent
7427d87e9a
commit
9eb3c9fde4
2 changed files with 0 additions and 32 deletions
|
|
@ -16,23 +16,6 @@ cargo test --workspace
|
|||
If you touch S3-backed flows, the CI model uses a local RustFS instance for
|
||||
integration tests.
|
||||
|
||||
### OpenAPI spec
|
||||
|
||||
`openapi.json` is a committed artifact generated from the Utoipa annotations in
|
||||
`crates/omnigraph-server`. CI fails if it drifts from the source. To regenerate
|
||||
manually:
|
||||
|
||||
```bash
|
||||
OMNIGRAPH_UPDATE_OPENAPI=1 cargo test -p omnigraph-server --test openapi openapi_spec_is_up_to_date
|
||||
```
|
||||
|
||||
Optional: enable the project's git hook to regenerate automatically when you
|
||||
commit server changes:
|
||||
|
||||
```bash
|
||||
git config core.hooksPath scripts/hooks
|
||||
```
|
||||
|
||||
## Pull Requests
|
||||
|
||||
- keep changes focused
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Regenerate openapi.json when the server API surface changes.
|
||||
set -euo pipefail
|
||||
|
||||
staged=$(git diff --cached --name-only --diff-filter=ACMR)
|
||||
|
||||
echo "$staged" | grep -qE '^(crates/omnigraph-server/src/.*\.rs|crates/omnigraph-server/Cargo\.toml)$' || exit 0
|
||||
|
||||
echo "[pre-commit] regenerating openapi.json..."
|
||||
OMNIGRAPH_UPDATE_OPENAPI=1 cargo test -p omnigraph-server --test openapi openapi_spec_is_up_to_date --quiet
|
||||
|
||||
if ! git diff --quiet -- openapi.json; then
|
||||
git add openapi.json
|
||||
echo "[pre-commit] openapi.json updated and staged"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue