Skip to content

fix(health): add pagination metadata envelope on /api/health - #1032

Merged
greatest0fallt1me merged 4 commits into
CalloraOrg:mainfrom
ugoocreates-pixel:feature/b036-health-envelope
Jul 29, 2026
Merged

fix(health): add pagination metadata envelope on /api/health#1032
greatest0fallt1me merged 4 commits into
CalloraOrg:mainfrom
ugoocreates-pixel:feature/b036-health-envelope

Conversation

@ugoocreates-pixel

Copy link
Copy Markdown
Contributor

Closes #901

This PR addresses the backend issue for the GrantFox FWC26 campaign. It updates the /api/health endpoint to return responses wrapped in a pagination metadata envelope ({items, next_cursor, total?}). This provides a standardized response structure, removing any ambiguity for clients consuming the API.

Changes Made

  • Endpoint Update (src/routes/health.ts):
    • Refactored the standard health check response to return the system health payload inside the items array of the envelope.
    • Set next_cursor to null and total to 1 by default.
    • Refactored the maintenance mode response to be wrapped in the same pagination envelope format.
  • Testing Updates (tests/integration/health.test.ts):
    • Updated 50+ existing assertions to validate against the new response.body.items[0] structure instead of the root response.body.
    • Added a dedicated test to verify that the envelope structure itself (items array, next_cursor, total) is correctly formed.

Requirements Addressed

  • Return {items, next_cursor, total?} envelope on /api/health.
  • Add focused tests for the envelope format.
  • Ensure minimum 90% test coverage on changed lines (tested via unit/integration coverage).
  • Maintain existing input validation and standardized error patterns.
  • Adhere to the repo's linting and formatting rules.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@ugoocreates-pixel 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

@greatest0fallt1me
greatest0fallt1me merged commit f0dac19 into CalloraOrg:main Jul 29, 2026
1 check passed
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

LGTM — clean, tested. Merged 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pagination metadata envelope on /api/health [b#036]

2 participants