Skip to content

CF endpoint service: retire ngrx + extend counts handlers with org/space filters#5341

Merged
norman-abramovitz merged 5 commits into
cloudfoundry:developfrom
nabramovitz:feature/a1-cf-endpoint-service-ngrx-retirement
May 18, 2026
Merged

CF endpoint service: retire ngrx + extend counts handlers with org/space filters#5341
norman-abramovitz merged 5 commits into
cloudfoundry:developfrom
nabramovitz:feature/a1-cf-endpoint-service-ngrx-retirement

Conversation

@nabramovitz
Copy link
Copy Markdown
Contributor

Summary

Track A workstream #1 (CF endpoint service ngrx retirement). Three atomic
commits, safe to revert individually:

  1. Remove orphan cf-org-card component. No module declaration or
    list-config referenced it anymore — the per-CF Organizations tab is
    signal-list driven via cf-orgs-signal-config.service. Removes the
    only real consumer of CloudFoundryEndpointService.deleteOrg.

  2. Backend: ?return=counts branches honor organization_guids +
    space_guids filters.
    getNativeApps and getNativeRouteCount were
    cnsi-wide on the counts tier by design — comment said adding filter
    forwarding would be dead code. A.Integrating helion-ui-framework #1 makes that filter forwarding live:
    the per-org Apps and Routes summary cards need an org-scoped count
    without paying for a full apps/routes drain. Uses the same comma-split
    convention as the list-path filters. Updates the
    TestGetNativeRouteCount_SpaceGuidsFilter assertion that pinned the
    old cnsi-wide-by-design behavior and adds parallel coverage for the
    apps handler.

  3. CF endpoint service: retire ngrx, swap counts to native. Static
    fetchAppCount and fetchRouteCount (which took Store +
    PaginationMonitorFactory + ngrx action classes) become instance
    methods that hit the native handlers directly. Dead methods (deleteOrg,
    fetchDomains — both had zero callers after step 1) deleted, which
    eliminates the last cfEntityCatalog reference on this service. Sibling
    services (CloudFoundryOrganizationService, CloudFoundrySpaceService)
    and cf-space-card updated to call the instance methods. Store stays
    in the sibling services for now — fetchServiceInstancesCount keeps
    the V2 dispatch alive there, and that's A.Installing JavaScript libraries #9 territory.

After this PR, cloudfoundry-endpoint.service.ts has zero @ngrx/*
imports.

Test plan

  • make check gate green on the full branch
  • Backend specs (apps + routes counts honoring org_guids / space_guids,
    backwards-compat for unfiltered counts)
  • Frontend spec for the new instance helpers (URL shape, both filters,
    0-on-error degradation)
  • Adepttech deploy verify on dev.88 — confirm per-org Apps and Routes
    summary card counts match what the legacy ngrx-pagination helper
    returned

CfOrgCardComponent was the V2 ngrx-era card for the org list, but
no module declaration or list-config references it anymore — the
per-CF Organizations tab is signal-list driven via
cf-orgs-signal-config.service. The only remaining references were
the component's own files and historical comments in sibling
cards.

Removes one ngrx survivor file (the component imports Store +
cfEntityCatalog) and the only real caller of
CloudFoundryEndpointService.deleteOrg, which lets A.cloudfoundry#1's later
deleteOrg cleanup drop the V2 cfEntityCatalog dispatch entirely.

Part of A.cloudfoundry#1 (cloudfoundry-endpoint.service ngrx retirement).
A.cloudfoundry#1 retires CloudFoundryEndpointService.fetchAppCount and
fetchRouteCount — the V2 ngrx-pagination helpers that scoped
counts by orgGuid / spaceGuid client-side. The native handlers'
?return=counts branches were cnsi-wide by design (home-page card,
endpoint totals) and rejected filter forwarding as dead code.

A.cloudfoundry#1 makes that filter forwarding a live consumer: the per-org
Apps and Routes summary cards need an org-scoped count without
paying for a full apps/routes drain. Both getNativeApps and
getNativeRouteCount counts branches now honor organization_guids
and space_guids using the same comma-split convention as the
existing list-path filters.

Updates the TestGetNativeRouteCount_SpaceGuidsFilter assertion
that explicitly pinned the old cnsi-wide-by-design behavior, and
adds parallel coverage for the apps handler.
A.cloudfoundry#1 closeout. CloudFoundryEndpointService no longer dispatches
V2 ngrx pagination actions for app/route counts; the static
fetchAppCount and fetchRouteCount helpers (which took Store +
PaginationMonitorFactory + ngrx action classes) become instance
methods that hit /pp/v1/cf/{apps,routes}/{cnsi}?return=counts
directly with the new organization_guids / space_guids filters.

Drops dead code: fetchDomains and deleteOrg had zero callers
once cf-org-card was removed; they retained the cfEntityCatalog
import surface alone, so deleting them eliminates the last
catalog-dispatch reference on this service.

Sibling services (CloudFoundryOrganizationService,
CloudFoundrySpaceService) and the cf-space-card list cell are
updated to call the instance methods. PaginationMonitorFactory
drops out of cf-space-card entirely. Store stays in the sibling
services for now — fetchServiceInstancesCount keeps the V2
dispatch alive there, and that's A.cloudfoundry#9 territory.

New spec pins the URL shape of the count helpers and the
0-on-error degradation path so a transient CAPI hiccup never
turns a count cell red.
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 18, 2026

CLA Not Signed

The component has CloudFoundryOrganizationService in its own
component-level providers array, which overrides the test's
mockOrgService and runs the real org service against the
mocked CloudFoundryEndpointService. Real org service calls
this.cfEndpointService.fetchRouteCount(...) in
initialiseObservables (added in this PR), which TypeError'd
because the mock didn't expose the new instance method.

Stub fetchAppCount and fetchRouteCount on the mock to return
of(0) — they're not what this spec asserts on (it only checks
component truthy-creation).
@norman-abramovitz norman-abramovitz merged commit 04876c1 into cloudfoundry:develop May 18, 2026
11 of 12 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

Development

Successfully merging this pull request may close these issues.

2 participants