Adopt fw-capi typed includes: roles include=space, quota-delete jobs, decoder sweep, isolation segments - #5443
Merged
norman-abramovitz merged 6 commits intoJun 12, 2026
Conversation
Brings the typed include/fields/embed/purge query options, typed
XIncludedFrom decoders, and the relationship-unset {"data":null} fix
(fork PR #3) into jetstream.
listRolesForUsers now requests include=space on /v3/roles and returns a spaceGUID-to-orgGUID map decoded from the included block, so both getNativeUsers and getNativeCurrentUserRoles resolve a space role's parent org in-band. Deletes the chunked listSpacesByGUIDs fallback (GH#5439 lineage: 25+ extra requests at admin scale and request-line fragility) — zero extra requests now. Wire-asserting tests pin include=space on the request and zero /v3/spaces hits. Live-verified against a real CF: admin with 2,505 space roles renders fully-named org/space buckets from the single paged roles drain.
Org/space quota deletes returned a bare 204 that swallowed the CF job reference. Both handlers now mirror deleteNativeRoute: 200 fast-path envelope on quick resolve, 202 + tracked job handoff otherwise (kinds cf.org_quota.delete / cf.space_quota.delete), bare-202 fallback when async wiring is absent. Frontend deleteQuota paths switch to writeWithJob so the post-delete refresh polls the job to terminal instead of racing a still-running delete. Live-verified: create 201, delete 200 fast-path, list refreshes clean.
Eight per-file json.RawMessage decoders across the service reads collapse onto the capi typed helpers plus one shared keyByGUID map-builder. Soft-fail moves from per-entry to block level (warn + empty maps, never 502 the page). Also corrects stale comments: the offerings handler was already decoding Included, and the brokers handler batch-fetches spaces because CAPI rejects ?include= on /v3/service_brokers. Net -97 lines. Live-verified: instance plan/space names and offering broker names resolve on the services and marketplace pages.
Green-field (verified never built — only V2-era type fields existed):
GET /pp/v1/cf/isolation_segments/{cnsi} list + detail handlers on the
org-quotas template, StIsolationSegment DTO, route registration. The
space update handler accepts an optional isolation_segment_guid body
field and chains the V3 relationship PATCH — empty string unassigns
(explicit {"data":null}, requires fork tag .2), absent leaves the
relationship untouched.
Live-verified: endpoint returns the foundation's shared segment.
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
Adoption wave for fw-capi v3.216.8-typed-includes.2 (typed query options + typed included-block decoders + relationship-unset fix).
1. Roles include=space — delete the /v3/spaces fan-out
listRolesForUsersnow requestsinclude=spaceon/v3/rolesand resolves each space role's parent org from the response's included block. The chunkedlistSpacesByGUIDsfallback (GH#5439 lineage) is deleted: at admin scale (2,500+ spaces) this was 25+ extra requests per page load — now zero. Both consumers (getNativeUsers,getNativeCurrentUserRoles) verified live against a real CF: an admin with 2,505 space roles renders fully-named org/space buckets from the single paged roles drain.2. Quota-delete job surfacing
Org/space quota deletes returned bare 204s that swallowed the CF job reference. Both now follow the route-delete async contract: 200 fast-path envelope / 202 tracked-job handoff, with
writeWithJobon the frontend so the post-delete refresh can't race the delete. Live-verified end-to-end (create 201 → delete 200 fast-path → clean refresh).3. Typed included-decoder sweep
Eight hand-rolled
json.RawMessagedecoders across the service reads replaced with the typedXIncludedFromhelpers + one sharedkeyByGUIDmap-builder. Block-level soft-fail (warn + empty maps, never 502). Net −97 lines. Also fixes stale comments that misdescribed the offerings/brokers include behavior.4. Isolation segments (green-field)
Never built in Stratos (verified by git archaeology — only V2-era type fields existed). Adds the read tier:
GET /pp/v1/cf/isolation_segments/{cnsi}list + detail,StIsolationSegmentDTO, and an optionalisolation_segment_guidfield on the space-update body that chains the V3 relationship PATCH (""= unassign via explicit{"data":null}— required the fork's relationship-unset fix, norman-abramovitz/fw-capi#3).Verification
make check gategreenmake devagainst a real CF foundation (users/roles at 2,505-space admin scale, quota create/delete round-trip, services/marketplace name resolution, isolation segments endpoint)