Skip to content

fix(deploy-application): restore file-upload deploy + drop deployer ngrx#5379

Merged
norman-abramovitz merged 3 commits into
cloudfoundry:developfrom
nabramovitz:fix/deploy-step2_2-onenter-data-handoff
May 26, 2026
Merged

fix(deploy-application): restore file-upload deploy + drop deployer ngrx#5379
norman-abramovitz merged 3 commits into
cloudfoundry:developfrom
nabramovitz:fix/deploy-step2_2-onenter-data-handoff

Conversation

@nabramovitz

Copy link
Copy Markdown
Contributor

Summary

  • Stepper hand-off fix. Move the step 2 → step 2_2 (FileScannerInfo) and step 2_2 → step 3 (deployer) data forwards out of the @ViewChild setters and into step2_2Handle.onEnter / step3Handle.onEnter. ViewChild fires at parent view-init (before any step submit), which left pendingFsFileInfo / pendingDeployer undefined at forward time and the deploy WebSocket never opened.
  • Deployer ngrx removal. DeployApplicationDeployer.open() looked up org and space names via selectCfEntity ngrx selectors that the V3 signal-native cutover stopped populating, crashing the URL construction on undefined.entity.name. Switch to CfOrgSpaceDataService.orgList() / .spaceList() — the same signal-native picker the wizard already uses. Drops the store constructor parameter from DeployApplicationDeployer and updates the two call sites.
  • Local dev session expiry. Wire SESSION_STORE_EXPIRY=240 into make dev backend so 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 the pendingFsFileInfo capture but forwarded via the @ViewChild('step2_2') setter. The companion regression test (e8743db968) asserted that order by mocking step2_2Ref = mock after submit — 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

  • Unit: updated deploy-application.component.spec.ts regression-guard now asserts handle.onEnter activation-time forwarding + pendingFsFileInfo clearing. 18/18 deploy-application area tests pass.
  • Manual (Playwright MCP, local stratos against a real CF endpoint):
    • Deploy via Application Folder with { index.html, Staticfile, manifest.yml } bundle, org=e2e, space=e2e
    • WS opens: wss://localhost:5440/pp/v1/{cf}/{org}/{space}/deploy?org=e2e&space=e2e
    • All 3 files upload (258 B)
    • Backend pushes app — staticfile buildpack, nginx install, droplet upload, container start — clean
  • CI gate

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 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.

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.

@norman-abramovitz
norman-abramovitz merged commit 1a06e54 into cloudfoundry:develop May 26, 2026
12 checks passed
@nabramovitz
nabramovitz deleted the fix/deploy-step2_2-onenter-data-handoff branch June 17, 2026 08:11
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.

App Deployment via Stratos Fails

2 participants