Add OpenAPI/email type tests, CI drift detection, and bound admin blockchain replay - #1664
Merged
Merged
Conversation
|
@brite-side0 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add OpenAPI/email type tests, CI drift detection, and bound admin blockchain replay
What was solved
#1504 — Add unit tests for OpenAPI spec generation module
Add a #[cfg(test)] unit test module to services/api/src/openapi_spec.rs that exercises the spec-building logic in isolation, asserting expected paths, security schemes, and server URL for a given Config. Also wire up CI drift detection by regenerating openapi.yaml via generate_openapi and diffing against the committed file, and document the regeneration command in dev docs.
Addressed:
#1505 — Add unit tests for email/types.rs serialization contracts
Add a #[cfg(test)] module to services/api/src/email/types.rs covering serde round-trips for each public type, custom Default/From implementations, and enum variant stability, so silent serde attribute or field/variant changes fail tests.
Addressed:
#1506 — Bound blockchain event replay to prevent unbounded RPC pagination
Bound the admin blockchain event replay so a very old or zero
from_ledgercannot trigger unboundedgetEventsRPC pagination. Enforce a maximum ledger range and/or page count plus a wall-clock timeout in the replay path, return400when the bound is exceeded, and add a regression test proving an over-bound replay is rejected before any RPC calls are made.Addressed:
handlers::blockchain_replay/BlockchainClient::replay_events/fetch_events_since).400when the requested replay exceeds the configured bound.Changes
README.md(modify)services/api/src/openapi_spec.rs(modify).github/workflows/openapi-validation.yml(modify)services/api/src/email/types.rs(modify)Approach
Issues
Closes #1504
Closes #1505
Closes #1506