Skip to content

refactor(deploy-app): drop deployApplication ngrx slice for signal-native - #5380

Merged
norman-abramovitz merged 3 commits into
cloudfoundry:developfrom
nabramovitz:refactor/deploy-application-ngrx-removal
May 26, 2026
Merged

refactor(deploy-app): drop deployApplication ngrx slice for signal-native#5380
norman-abramovitz merged 3 commits into
cloudfoundry:developfrom
nabramovitz:refactor/deploy-application-ngrx-removal

Conversation

@nabramovitz

Copy link
Copy Markdown
Contributor

Summary

Migrates the deploy-application wizard's cross-step state from an
@ngrx reducer + effect to a signal-native service. CfDeployAppDataService
now owns the wizard slice directly as a WritableSignal and exposes
async checkProjectExists() in place of the legacy CheckProjectExists
action + DeployAppEffects pipeline.

  • 351 lines of reducer + effect + selectors + action classes deleted
  • All consumers (wizard component + 5 step children + form validator
    • 2 github-commits list configs) read/write through the service
  • deployApplication is no longer a StoreModule.forFeature slice
  • CFAppState loses its deployApplication field
  • Public-API exports of CheckProjectExists and selectDeployAppState
    removed (verified zero external consumers under src/frontend and
    src/extensions)
  • RouterNav dispatches in the wizard stay on @ngrx/store (router slice
    is a separate workstream, not in this PR's scope)

Followup to #5379 (file-upload deploy fix). Same migration spirit —
removing the ngrx mediation layer between the wizard and its own state.

Test plan

  • bun run test — 2344 passed, 3 skipped, no new failures
  • make check gate — lint + unit tests + production build all green
  • CfDeployAppDataService spec rewritten to test signal API + the
    three-phase checkProjectExists contract (200 / 404 / error)
  • Two unrelated cf-apps-signal-config spec http-mock holes patched
    (deleteServiceBinding / deleteRoute) — drops vitest's
    uncaught-exception count by 2
  • End-to-end browser smoke of the file-upload deploy path
    (verified during fix(deploy-application): restore file-upload deploy + drop deployer ngrx #5379 work; same code path)
  • End-to-end browser smoke of the git-deploy path

…ntainer

Replaces the toSignal(store.select(...)) read-only bridge with a
WritableSignal that owns the wizard's cross-step state directly. The
service is now the single source of truth for cf details, source type,
git/docker app details, overrides, and the project-exists probe — so
consumers can read AND write through one signal-native interface
instead of dispatching @ngrx actions.

The legacy DeployAppEffects.checkAppExists$ pipeline (CheckProjectExists
→ scm.getRepository() → ProjectExists/ProjectDoesntExist/ProjectFetchFail)
collapses into a single checkProjectExists(scm, projectName) async
method that maintains the same three-phase observable contract for the
github-project-exists form validator.

Spec rewritten to test the new signal API directly; no mock store
required.

Refs cloudfoundry#5045 followup
…tive

Migrates every consumer of the deployApplication reducer to read/write
through CfDeployAppDataService instead of dispatching @ngrx actions or
selecting from the store:

  deploy-application.component                StoreCFSettings,
                                              DeleteDeployAppSection,
                                              selectApplicationSource
  deploy-application-step2.component          SaveAppDetails ×3,
                                              SetAppSourceDetails,
                                              SetBranch ×2,
                                              SetDeployBranch ×2,
                                              ProjectDoesntExist
  deploy-application-step2-1.component        SetDeployCommit
  deploy-application-options-step.component   SaveAppOverrides
  deploy-application-step3.component          DeleteDeployAppSection
  github-project-exists.directive             CheckProjectExists
  github-commits-list-config-app-tab          StoreCFSettings,
                                              CheckProjectExists,
                                              SetAppSourceDetails,
                                              SetDeployBranch,
                                              SetDeployCommit
  github-commits-list-config-deploy           selectApplicationSource

RouterNav dispatches in the wizard remain on @ngrx/store — the router
slice is its own workstream and not part of the deployApplication
slice removal.

Deletes the now-unreferenced reducer, effect, selectors, and action
classes (351 lines across 4 files) plus the StoreModule.forFeature
registration in cloud-foundry.reducers.module.ts and the
DeployAppEffects registration in cloud-foundry.store.module.ts +
cloud-foundry-test.module.ts. CFAppState loses its
deployApplication field. public_api.ts drops the CheckProjectExists
and selectDeployAppState exports (no external consumers; verified via
grep across src/frontend and src/extensions).

Refs cloudfoundry#5045 followup
Two specs (deleteServiceBinding, deleteRoute) passed httpMock objects
with only a delete() method. EndpointDataService (providedIn: 'root')
is wired up via DI when CfAppsSignalConfigService is constructed, and
its load() path calls this.http.get(...) — which threw "this.http.get
is not a function" as an uncaught exception during the test, polluting
the cloud-foundry vitest output with 2 errors.

Tests passed regardless because the assertion ran before the async
EndpointDataService.load chain blew up, but the noise hid real
regressions. Adding the makeHttp().get baseline to both mocks drops
the cloud-foundry uncaught-exception count from 25 → 23.

@norman-abramovitz norman-abramovitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@norman-abramovitz
norman-abramovitz merged commit 0397893 into cloudfoundry:develop May 26, 2026
12 checks passed
@nabramovitz
nabramovitz deleted the refactor/deploy-application-ngrx-removal branch June 17, 2026 08:12
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