Skip to content

Add OpenAPI/email type tests, CI drift detection, and bound admin blockchain replay - #1664

Merged
hman38705 merged 3 commits into
solutions-plug:mainfrom
brite-side0:drips/1504-1505-1506
Sep 28, 2026
Merged

hman38705 merged 3 commits into
solutions-plug:mainfrom
brite-side0:drips/1504-1505-1506

Conversation

@brite-side0

Copy link
Copy Markdown
Contributor

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:

  • Changed: services/api/src/openapi_spec.rs, .github/workflows/openapi-validation.yml
  • Add #[cfg(test)] module in services/api/src/openapi_spec.rs with unit tests asserting the generated spec includes expected paths for a given Config
  • Unit tests must assert expected security schemes are present in the generated spec
  • Unit tests must assert the expected server URL is set from the given Config

#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:

  • Changed: services/api/src/email/types.rs
  • Add round-trip serialize/deserialize tests for each public type in services/api/src/email/types.rs
  • Add tests for any custom Default and From implementations in the module
  • Ensure tests fail if a field is renamed or an enum variant is removed without an explicit migration note

#1506 — Bound blockchain event replay to prevent unbounded RPC pagination

Bound the admin blockchain event replay so a very old or zero from_ledger cannot trigger unbounded getEvents RPC pagination. Enforce a maximum ledger range and/or page count plus a wall-clock timeout in the replay path, return 400 when the bound is exceeded, and add a regression test proving an over-bound replay is rejected before any RPC calls are made.

Addressed:

  • Changed: README.md
  • Enforce a maximum ledger range and/or maximum page count per replay request in the replay path (handlers::blockchain_replay / BlockchainClient::replay_events / fetch_events_since).
  • Return HTTP 400 when the requested replay exceeds the configured bound.
  • Add a wall-clock timeout around the replay loop with a clear error response.

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

  1. Add unit tests for OpenAPI spec generation module #1504 — Add unit tests for OpenAPI spec generation module (Changed: services/api/src/openapi_spec.rs, .github/workflows/openapi-validation.yml)
  2. Add unit tests for email/types.rs serialization contracts #1505 — Add unit tests for email/types.rs serialization contracts (Changed: services/api/src/email/types.rs)
  3. Bound blockchain event replay to prevent unbounded RPC pagination #1506 — Bound blockchain event replay to prevent unbounded RPC pagination (Changed: README.md)

Issues

Closes #1504
Closes #1505
Closes #1506

@drips-wave

drips-wave Bot commented Sep 28, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@hman38705
hman38705 merged commit 1b08205 into solutions-plug:main Sep 28, 2026
14 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants