fix(mgmt): version-agnostic OpenAPI drift test + regenerate the 0.5.0 snapshot
apple / swift (push) Successful in 1m11s
apple / screenshots (push) Has been cancelled
ci / rust (push) Has been cancelled
ci / web (push) Has been cancelled
ci / docs-site (push) Has been cancelled
ci / bench (push) Has been cancelled
android-screenshots / screenshots (push) Successful in 50s
windows-host / package (push) Successful in 6m40s
windows-msix / package (arm64, C:\Users\Public\ffmpeg-arm64, aarch64-pc-windows-msvc, C:\t-a64) (push) Successful in 1m5s
android / android (push) Successful in 3m23s
decky / build-publish (push) Successful in 15s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 6s
windows-msix / package (x64, C:\Users\Public\ffmpeg, x86_64-pc-windows-msvc, C:\t) (push) Successful in 1m7s
release / apple (push) Successful in 10m8s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 33s
deb / build-publish (push) Successful in 3m34s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 7s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 5s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 5s
linux-client-screenshots / screenshots (push) Successful in 2m1s
flatpak / build-publish (push) Successful in 4m28s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Successful in 9m14s
web-screenshots / screenshots (push) Has been cancelled
docker / deploy-docs (push) Has been cancelled
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Has been cancelled
apple / swift (push) Successful in 1m11s
apple / screenshots (push) Has been cancelled
ci / rust (push) Has been cancelled
ci / web (push) Has been cancelled
ci / docs-site (push) Has been cancelled
ci / bench (push) Has been cancelled
android-screenshots / screenshots (push) Successful in 50s
windows-host / package (push) Successful in 6m40s
windows-msix / package (arm64, C:\Users\Public\ffmpeg-arm64, aarch64-pc-windows-msvc, C:\t-a64) (push) Successful in 1m5s
android / android (push) Successful in 3m23s
decky / build-publish (push) Successful in 15s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 6s
windows-msix / package (x64, C:\Users\Public\ffmpeg, x86_64-pc-windows-msvc, C:\t) (push) Successful in 1m7s
release / apple (push) Successful in 10m8s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 33s
deb / build-publish (push) Successful in 3m34s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 7s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 5s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 5s
linux-client-screenshots / screenshots (push) Successful in 2m1s
flatpak / build-publish (push) Successful in 4m28s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Successful in 9m14s
web-screenshots / screenshots (push) Has been cancelled
docker / deploy-docs (push) Has been cancelled
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Has been cancelled
The snapshot comparison now normalizes info.version on both sides and compares structurally — a version bump alone can never invalidate the checked-in spec again (the 0.5.0 release tripped on exactly this; the API surface is what drift-control protects). Snapshot regenerated so the docs-site copy shows the current version. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2310,11 +2310,17 @@ mod tests {
|
||||
);
|
||||
|
||||
let checked_in = include_str!("../../../api/openapi.json");
|
||||
// Compare content, not line-ending style: the generated `json` is LF (serde_json), but git
|
||||
// may check the file out CRLF on Windows.
|
||||
// Compare STRUCTURALLY with `info.version` normalized on both sides: the served document
|
||||
// stamps the live crate version, but a version bump alone must never invalidate the
|
||||
// snapshot — the API *surface* is what drift-control protects (the 0.5.0 release tripped
|
||||
// on exactly this). Structural comparison also makes line endings a non-issue (git may
|
||||
// check the file out CRLF on Windows).
|
||||
let mut generated = doc;
|
||||
let mut snapshot: serde_json::Value = serde_json::from_str(checked_in).unwrap();
|
||||
generated["info"]["version"] = serde_json::json!("<any>");
|
||||
snapshot["info"]["version"] = serde_json::json!("<any>");
|
||||
assert_eq!(
|
||||
json.trim().replace('\r', ""),
|
||||
checked_in.trim().replace('\r', ""),
|
||||
generated, snapshot,
|
||||
"api/openapi.json is stale — regenerate with: \
|
||||
cargo run -p punktfunk-host -- openapi > api/openapi.json"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user