Skip to content

Commit 2a29125

Browse files
committed
fix: drop bogus Incidents.delete and add StatusPages.reorder_layout
Two surface-parity gaps surfaced by `tests/surfaces/parity/`: 1. **Drop `Incidents.delete()`** — the underlying API endpoint `DELETE /api/v1/incidents/{id}` does not exist; calling this method would always return a 404. The method was a leftover from earlier API experimentation and was missing from sdk-js / mcp-server / cli, so the parity check (rightly) flagged sdk-python as out of sync. Removing it here is the canonical decision: incidents are auto-resolved or manually resolved via `incidents.resolve(...)`, never deleted. This is technically a breaking change to the `devhelm` Python package public API, but no real consumers exist (the method has never produced a successful response). Captured in the version bump for the next release. 2. **Add `StatusPages.reorder_layout(id, body)`** — hits the existing `PUT /api/v1/status-pages/{id}/layout/reorder` endpoint, mirroring `sdk-js.StatusPages.reorderLayout`. Wires through the `ReorderPageLayoutRequest` model (already in `_generated.py`); also re-exports it from the top-level `devhelm` package and `devhelm.types`, plus a harness entry for the surface-test suite. Synced uv.lock to match `devhelm` 0.2.0 already in pyproject.toml. Verified locally: - `pytest tests/` — 707 passed - `mypy src/` — clean - `ruff format` / `ruff check` — clean - `make test-surface SURFACE=sdk_python` (against test API) — 174 passed, 1 skipped Made-with: Cursor
1 parent be03beb commit 2a29125

6 files changed

Lines changed: 26 additions & 9 deletions

File tree

src/devhelm/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
NotificationPolicyDto,
8383
PublishIncidentStatus,
8484
ReorderComponentsRequest,
85+
ReorderPageLayoutRequest,
8586
ResolveIncidentRequest,
8687
ResourceGroupDto,
8788
ResourceGroupHealthStatus,
@@ -204,6 +205,7 @@
204205
"AddCustomDomainRequest",
205206
"AdminAddSubscriberRequest",
206207
"ReorderComponentsRequest",
208+
"ReorderPageLayoutRequest",
207209
"CreateMonitorRequest",
208210
"UpdateMonitorRequest",
209211
"CreateManualIncidentRequest",

src/devhelm/resources/incidents.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
IncidentDto,
99
ResolveIncidentRequest,
1010
)
11-
from devhelm._http import api_delete, api_get, api_post, path_param
11+
from devhelm._http import api_get, api_post, path_param
1212
from devhelm._pagination import Page, fetch_all_pages, fetch_page
1313
from devhelm._validation import RequestBody, parse_single, validate_request
1414

@@ -57,7 +57,3 @@ def resolve(
5757
api_post(self._client, f"/api/v1/incidents/{path_param(id)}/resolve", body),
5858
f"POST /api/v1/incidents/{id}/resolve",
5959
)
60-
61-
def delete(self, id: int | str) -> None:
62-
"""Delete an incident."""
63-
api_delete(self._client, f"/api/v1/incidents/{path_param(id)}")

src/devhelm/resources/status_pages.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
CreateStatusPageIncidentUpdateRequest,
1212
CreateStatusPageRequest,
1313
ReorderComponentsRequest,
14+
ReorderPageLayoutRequest,
1415
StatusPageComponentDto,
1516
StatusPageComponentGroupDto,
1617
StatusPageCustomDomainDto,
@@ -392,3 +393,16 @@ def update(
392393
def delete(self, id: int | str) -> None:
393394
"""Delete a status page."""
394395
api_delete(self._client, _page_path(id))
396+
397+
def reorder_layout(
398+
self, id: int | str, body: RequestBody[ReorderPageLayoutRequest]
399+
) -> None:
400+
"""Batch-reorder the page layout: top-level sections (groups +
401+
ungrouped components) and, optionally, within-group component ordering.
402+
403+
Returns 204 No Content on success.
404+
"""
405+
body = validate_request(
406+
ReorderPageLayoutRequest, body, "statusPages.reorderLayout"
407+
)
408+
api_put(self._client, f"{_page_path(id)}/layout/reorder", body)

src/devhelm/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
PublishStatusPageIncidentRequest,
8282
RecordType,
8383
ReorderComponentsRequest,
84+
ReorderPageLayoutRequest,
8485
ResolutionReason,
8586
ResolveIncidentRequest,
8687
ResourceGroupDto,
@@ -250,6 +251,7 @@
250251
"NotificationPolicyDto",
251252
"PublishStatusPageIncidentRequest",
252253
"ReorderComponentsRequest",
254+
"ReorderPageLayoutRequest",
253255
"ResolveIncidentRequest",
254256
"ResourceGroupDto",
255257
"ResourceGroupMemberDto",

tests/run_sdk.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
Devhelm,
4040
DevhelmError,
4141
ReorderComponentsRequest,
42+
ReorderPageLayoutRequest,
4243
ResolveIncidentRequest,
4344
UpdateAlertChannelRequest,
4445
UpdateEnvironmentRequest,
@@ -137,9 +138,6 @@ def run(client: Devhelm, resource: str, action: str, rest: list[str]) -> Any: #
137138
else None
138139
)
139140
return client.incidents.resolve(rest[0], body)
140-
if op == "incidents.delete":
141-
client.incidents.delete(rest[0])
142-
return None
143141

144142
# -- Alert Channels --
145143
if op == "alert-channels.list":
@@ -311,6 +309,11 @@ def run(client: Devhelm, resource: str, action: str, rest: list[str]) -> Any: #
311309
if op == "status-pages.delete":
312310
client.status_pages.delete(rest[0])
313311
return None
312+
if op == "status-pages.reorder-layout":
313+
client.status_pages.reorder_layout(
314+
rest[0], _parse(ReorderPageLayoutRequest, rest[1])
315+
)
316+
return None
314317

315318
# -- Status Page Components --
316319
if op == "status-pages.components.list":

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)