mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
* fix(ecs): report service deployments and MISSING failures on DescribeServices DescribeServices omitted services[].deployments entirely and always returned an empty failures list. Both are read by AWS's own ServicesStable waiter, which accepts on length(services[?!(length(deployments) == `1` && runningCount == desiredCount)]) == `0` and fails fast on failures[].reason == "MISSING" (botocore ecs/2014-11-13/waiters-2.json). Because that file is codegen'd into every SDK, `aws ecs wait services-stable` and every SDK waiter polled for the full 40 x 15s before giving up, and Terraform's aws_ecs_service never converged (terraform-provider-aws internal/service/ecs/service.go:2206 applies the same len(Deployments) == 1 test). Evaluating the acceptor against the old payload raises JMESPathTypeError, so it could not even be evaluated. An ACTIVE service now reports exactly one PRIMARY deployment derived from its current state, with rolloutState COMPLETED once runningCount reaches desiredCount. The deployment id is derived from the service ARN and task definition rather than generated per request, so it is stable across calls and restarts and rolls over when the task definition changes. An unresolvable service reference is returned as a MISSING failure carrying the ARN it would have had, instead of being dropped. Known deviations are documented in docs/services/ecs.md: a single deployment with no draining ACTIVE alongside it, no deploymentController gating, and pendingCount always 0. Closes #2174 * fix(ecs): stamp a deployment with its own start time, not the service's A task-definition change mints a new deployment id, but both deployment timestamps were still taken from the service's creation time, so the payload contradicted itself: a new deployment claiming to have been created when the service was. botocore documents Deployment.createdAt as "the time when the service deployment was created", and moto stamps it at deployment construction (moto/ecs/models.py:540) rather than reusing the service's. Track when the current deployment began on the service model, set at creation and on every task-definition change, and report that. Services persisted before this field existed fall back to the service creation time. Raised in review on #2176.