feat: revise OpenAPI compatibility enforcement#2572
Conversation
Test Results 3 files ± 0 88 suites ±0 13m 45s ⏱️ -38s Results for commit a72b8dd. ± Comparison against base commit bc83454. This pull request removes 12 and adds 27 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull Request Overview
This PR revises the OpenAPI compatibility enforcement by eliminating the use of the 412 Precondition Failed response in the OpenAPI specification and shifting version mismatch handling to client-side warning logs.
- Removed API version mismatch 412 responses from openapi.yaml.
- Updated both signer and aggregator clients to log warnings instead of raising errors on version mismatches.
- Adjusted tests and dependency configurations accordingly.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| openapi.yaml | Removed 412 responses for API version mismatches. |
| mithril-signer/Cargo.toml | Added semver dependency. |
| mithril-client/src/aggregator_client.rs | Removed error handling for 412; added warning logging logic. |
| mithril-client/Cargo.toml | Added dependency on http library. |
| mithril-aggregator/src/services/aggregator_client.rs | Replaced error handling with warning log for version mismatch. |
| mithril-aggregator/src/http_server/routes/router.rs | Removed API version header validation middleware. |
jpraynaud
left a comment
There was a problem hiding this comment.
LGTM 👍
There is a lot of duplicated code, maybe it's time to create a common aggregator client which can be used in signer, aggregator and client?
3655419 to
7db9922
Compare
adc4f48 to
6be0ff8
Compare
…rsion of the OpenAPI
…AggregatorClient`
- rewrite `API_VERSION_MISMATCH_WARNING_MESSAGE` value - use tuple match instead of nested `if let` / `match` / `if` for better readability - improve `warn!` usage - enhance test readability
…tests, ensuring the order
* mithril-aggregator from `0.7.61` to `0.7.62` * mithril-client from `0.12.13` to `0.12.14` * mithril-signer from `0.2.252` to `0.2.253` * openapi.yaml from `0.1.49` to `0.1.50`
6be0ff8 to
a72b8dd
Compare
Content
This PR removes the HTTP response status code
412 Precondition Failedreturned by the aggregator on OpenAPI version mismatch and adds a client-side warning log when a mismatch is detected.Pre-submit checklist
Issue(s)
Closes #2535