Skip to content

fix(aws): ecs update/wait tolerate Floci's missing deployments field (#937) - #941

Merged
lex00 merged 1 commit into
mainfrom
fix/floci-ecs-no-deployments-937
Jul 15, 2026
Merged

lex00 merged 1 commit into
mainfrom
fix/floci-ecs-no-deployments-937

Conversation

@lex00

@lex00 lex00 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Closes #937.

Problem

realEcs.updateService / describeService (lexicons/aws/src/components/cloud-executor.ts) crash against Floci:

described.service.deployments[0]?.id   // deployments is undefined on Floci → throws on [0]
(svc?.deployments.length ?? 0)         // svc ok, but svc.deployments undefined → throws on .length

Floci's ECS responses omit the deployments field entirely (real AWS always includes it), and the optional chaining only guarded the first hop, not the chained index / .length. So ecs-update-service and wait-steady-state fail unconditionally against Floci for any project using them — blocking local/CI validation.

Fix

Extract the two fragile reads into pure, guarded helpers and use them in realEcs:

  • ecsDeploymentId(described) → described.service.deployments?.[0]?.id ?? ""
  • ecsServiceStable(svc) → (svc?.deployments?.length ?? 0) <= 1

Parsed types now mark deployments optional (honest about Floci). Unit tests cover both the real-AWS shape and the Floci (no-deployments) shape for each. aws build + tests green.

#937)

`realEcs.updateService`/`describeService` crashed against Floci —
`described.service.deployments[0]` and `svc?.deployments.length` throw
`Cannot read properties of undefined` because Floci's ECS responses omit the
`deployments` field entirely (real AWS always includes it), and the optional
chaining only guarded the first hop, not the chained index/`.length`.

Extract the two fragile reads into pure `ecsDeploymentId` / `ecsServiceStable`
helpers that guard the whole chain (`deployments?.[0]?.id`, `deployments?.length
?? 0`), and unit-test both the real-AWS and Floci shapes. Unblocks
ecs-update-service / wait-steady-state for any project validating via Floci.
@lex00
lex00 merged commit 7b0f8d5 into main Jul 15, 2026
5 checks passed
@lex00
lex00 deleted the fix/floci-ecs-no-deployments-937 branch July 15, 2026 18:21
lex00 added a commit that referenced this pull request Jul 15, 2026
#937/#938 landed independently as #941/#942 while this was in flight; this is the reconciled remainder on top of them + #943.

- #935 aws: Outputs section walks nested AttrRef (Join/Sub) to Fn::GetAtt (line 349 LexiconOutput path — distinct from #943's stackOutput path) instead of leaking the __attrRef envelope (+ regression test)
- #936 core: docker-build joins dockerfile onto context (its documented contract), not -f relative to cwd
- #939 core: health-gate composes a URL from an optional host (a cross-stack Wiring value) + path

Full suite green (7932 tests); validated end-to-end by loomster's 7/7 Floci deploy.
@lex00 lex00 mentioned this pull request Jul 15, 2026
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.

aws lexicon: ecs-update-service / wait-steady-state crash when ECS response has no deployments field (Floci)

1 participant