fix(deploy-application): restore file-upload deploy + drop deployer ngrx#5379
Merged
norman-abramovitz merged 3 commits intoMay 26, 2026
Conversation
Closes GH cloudfoundry#5045 (file-upload deploy hangs at "Uploading Source files"). When the wizard was migrated to SignalStepHandle (950d860), the hand-off of step 2's FileScannerInfo into step 2_2 (source upload) was placed inside the @ViewChild('step2_2') setter. ViewChild for projected content fires at parent view-init — *before* the user ever clicks Next on step 2 — so the setter ran with `pendingFsFileInfo === undefined` and the deployer's readyFilter fell into the git/docker branch, never opening the deploy WebSocket. Same shape on step 3's pendingDeployer. Route both forwards through the handle's `onEnter` instead. The stepper invokes it on activation, after the upstream step's submit has captured the data — the right timing for the relay. The ViewChild setter keeps its subscription-wiring role (valid$, closeable$, disablePrevious$). Removing only the activation-time call leaves the rest of the setter intact. The previous regression test asserted ViewChild-setter-fires-then behavior by mocking step2_2Ref = mock *after* submit — an order real Angular never produces. The test passed against broken code because it locked in the wrong implementation. Updated to assert the activation-time behavior: ViewChild setter must NOT forward, then handle.onEnter must forward + clear pendingFsFileInfo. Postmortem: stratos KS docs/2026-05-26-deploy-application-ngrx-removal.md
`DeployApplicationDeployer.open()` constructed the deploy WebSocket URL by looking up the org and space entities via `selectCfEntity` ngrx selectors. After the V3 signal-native cutover, the ngrx organization and space entity buckets stopped being populated on the deploy flow, so both selectors returned undefined and the URL construction crashed on `undefined.entity.name`. Read both names directly from `CfOrgSpaceDataService.orgList()` / `.spaceList()` — the same signal-native picker the wizard already uses for the dropdowns. The picker populated both lists when the user made their selection, so the lookup is synchronous. Side effects of removing the last ngrx consumer in this file: - drop `Store`, `CFAppState`, `selectCfEntity`, `organizationEntityType`, `spaceEntityType` imports - drop `mergeMap`, `combineLatest`, `observableOf` rxjs imports - drop `store` constructor parameter - update both call sites (source-upload step and step 3) to drop the `store` argument from `new DeployApplicationDeployer(...)` - drop now-unused `Store` / `CFAppState` imports in source-upload Also encodes the org and space names with `encodeURIComponent` before splicing into the URL — latent fix; the legacy code didn't encode either, but names can contain characters that need encoding.
The cf-package deploy already sets SESSION_STORE_EXPIRY=240 (commit 26467fc) so adepttech sessions outlast multi-step manual / Playwright runs. The local `make dev backend` target was still running with jetstream's 20-minute default — long deploy / Playwright drives kept getting bounced to /login mid-session. Set SESSION_STORE_EXPIRY=240 by default on the dev recipe so local dev matches the deployed config. Overridable on the make line.
norman-abramovitz
approved these changes
May 26, 2026
norman-abramovitz
left a comment
Contributor
There was a problem hiding this comment.
Approving but leaving the issue open because the ngrx removal needs to be completed first, and then the app deployment stepper will be tested again.
6 tasks
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
@ViewChildsetters and intostep2_2Handle.onEnter/step3Handle.onEnter. ViewChild fires at parent view-init (before any step submit), which leftpendingFsFileInfo/pendingDeployerundefined at forward time and the deploy WebSocket never opened.DeployApplicationDeployer.open()looked up org and space names viaselectCfEntityngrx selectors that the V3 signal-native cutover stopped populating, crashing the URL construction onundefined.entity.name. Switch toCfOrgSpaceDataService.orgList()/.spaceList()— the same signal-native picker the wizard already uses. Drops thestoreconstructor parameter fromDeployApplicationDeployerand updates the two call sites.SESSION_STORE_EXPIRY=240intomake dev backendso local dev matches the cf-package deploy default — long Playwright drives no longer get bounced to /login mid-session.Closes #5045.
Why the original fix didn't hold
The earlier fix attempt (commit
85612fb87f) added thependingFsFileInfocapture but forwarded via the@ViewChild('step2_2')setter. The companion regression test (e8743db968) asserted that order by mockingstep2_2Ref = mockaftersubmit— an order real Angular never produces. The test passed against broken production code; the deploy stayed broken. Updated test in this PR asserts the activation-time behavior instead.Test plan
deploy-application.component.spec.tsregression-guard now asserts handle.onEnter activation-time forwarding + pendingFsFileInfo clearing. 18/18 deploy-application area tests pass.{ index.html, Staticfile, manifest.yml }bundle, org=e2e, space=e2ewss://localhost:5440/pp/v1/{cf}/{org}/{space}/deploy?org=e2e&space=e2e