fix(statuspage): parse live v2 shape; guard maintenance status-page overflow#51
Merged
KhaledSalhab-Develeap merged 3 commits intoJul 14, 2026
Merged
Conversation
…verflow list_status_pages() returned [] against the live v2 API: the StatusPage model required 'subdomain', but the API returns the hosted subdomain under 'hostedsubdomain' (and omits it for custom-domain pages), so every record failed validation and was silently dropped. Make subdomain optional + aliased to hostedsubdomain; also parse hostname and url. create_maintenance() silently phantom-failed with >51 status pages: the API returns a uuid but never persists the window. Guard with a clear HyperpingValidationError (MAX_STATUSPAGES_PER_MAINTENANCE=51, verified live). Bump 1.8.0 -> 1.8.1; add tests for both.
…ages Callers that need to cover more than 51 status pages (e.g. a broadcast to all tenant status pages) hit the per-window limit that create_maintenance() now rejects. create_maintenance_windows() splits the statuspages list into consecutive windows of at most 51 pages, each carrying the full monitor set (the API requires >=1 monitor per window). Added on both the sync and async clients; MAX_STATUSPAGES_PER_MAINTENANCE is exported for callers that chunk themselves. Also adds the >51 guard to the async create_maintenance for parity.
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
Two live-API defects plus a chunking helper, found while wiring maintenance windows to all tenant status pages. All behaviour verified against the live Hyperping API on 2026-07-14.
1.
list_status_pages()returned an empty listThe
StatusPagemodel required asubdomainfield, but the v2 API returns the hosted subdomain underhostedsubdomainand omits it for custom-domain pages. Every record failed validation and was silently skipped (list_status_pages()→[]).subdomainis now optional and aliased tohostedsubdomain;hostnameandurlare parsed.2.
create_maintenance()silently phantom-failed above 51 status pagesHyperping's v1 maintenance-windows API accepts a create with a large
statuspagesarray (returns{"uuid": ...}) but never persists the window — the follow-up GET 404s and it is absent from the list. The cutoff is exactly 51 (51 persists, 52+ vanishes), bracketed against the live API.create_maintenance()(sync + async) now raisesHyperpingValidationErroraboveMAX_STATUSPAGES_PER_MAINTENANCE(51) instead of returning a phantom window.3.
create_maintenance_windows()— chunk large page setsNew sync + async helper that splits a large
statuspageslist into consecutive windows of ≤51 pages, so a caller (e.g. a broadcast-to-all-tenants command) can cover more pages than one window allows. Each window carries the full monitor set (the API requires ≥1 monitor per window; verified).MAX_STATUSPAGES_PER_MAINTENANCEis exported for callers that chunk themselves.Tests
test_statuspages.py+test_maintenance.py: 47 passed. ruff + mypy clean.Version
1.8.0 → 1.8.1 (+ CHANGELOG).
Consumer note
hyp maintenance broadcast(hyperping-automation repo) passes all ~57 tenant pages in one call and must switch tocreate_maintenance_windows()after bumping this SDK to 1.8.1.