From d753187ea419318a06ded342a949f7c5eb36b860 Mon Sep 17 00:00:00 2001 From: bdemoss-runwise Date: Mon, 27 Jul 2026 16:41:52 -0400 Subject: [PATCH] fix(cloudformation): point the SAM alias at $LATEST MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Real SAM points AutoPublishAlias at the published version, and the first revision of this change did the same. Floci cannot invoke a published version: the snapshot carries no code path, so a version-qualified invoke times out on a cold start (#1987), and silently runs $LATEST's code when a warm container happens to exist (#1988). Emitting the faithful form therefore broke the alias-qualified invoke this expansion exists to enable — strictly worse than not expanding the property. Point the alias at $LATEST instead. The Version resource is still emitted, so the resource set and GetAtt still match SAM; only the alias target differs, and it flips back to the version in one line once #1987 lands. The integration test asserted the alias record existed with a numeric FunctionVersion, which the broken form satisfied — so it passed while the behavior was broken. It now invokes through the alias and asserts the function actually runs, which fails against the version-pointing form (verified by reverting it with the record assertion relaxed). --- .../cloudformation/SamTransformProcessorTest.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/test/java/io/github/hectorvent/floci/services/cloudformation/SamTransformProcessorTest.java b/src/test/java/io/github/hectorvent/floci/services/cloudformation/SamTransformProcessorTest.java index 373f7aa263..fc0eb8dd34 100644 --- a/src/test/java/io/github/hectorvent/floci/services/cloudformation/SamTransformProcessorTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/cloudformation/SamTransformProcessorTest.java @@ -137,12 +137,11 @@ class SamTransformProcessorTest { assertEquals("production", aliasProps.path("Name").asText()); assertEquals("MyFunc", aliasProps.path("FunctionName").path("Ref").asText()); - // The alias points at the generated version via Fn::GetAtt, which is also what gives the - // provisioning order function -> version -> alias. - JsonNode versionRef = aliasProps.path("FunctionVersion"); - assertTrue(versionRef.has("Fn::GetAtt")); - assertEquals("MyFuncVersion", versionRef.path("Fn::GetAtt").get(0).asText()); - assertEquals("Version", versionRef.path("Fn::GetAtt").get(1).asText()); + // The alias deliberately targets $LATEST rather than the published version real SAM points + // at: Floci cannot invoke a published version (#1987 cold-start timeout, #1988 warm-pool + // keying), so the faithful form would break the alias-qualified invoke this expansion + // exists to enable. + assertEquals("$LATEST", aliasProps.path("FunctionVersion").asText()); } @Test