fix: restore package-type Image branching (regression in v1.1.1)#73
Conversation
The durable-functions refactor (aws-actions#65) removed the package-type branching in run(), createFunction, and updateFunctionCode, so Image deployments now fail unconditionally with: Packaging code artifacts from Failed to package artifacts: Code artifacts directory path must be provided because packageCodeArtifacts() is called even when no code-artifacts-dir is configured. This restores the v1.1.0 behavior: - run() skips packageCodeArtifacts when packageType === 'Image' - createFunction sends Code: { ImageUri } and PackageType: 'Image', and omits Runtime / Handler / Layers for Image - createFunction includes ImageConfig only for Image - updateFunctionCode sends ImageUri instead of ZipFile for Image - updateFunctionConfiguration omits Handler / Runtime / Layers for Image and includes ImageConfig only for Image - hasConfigurationChanged uses the same gating - the PackageType-change guard is restored - durable-functions config from aws-actions#65 is preserved unchanged Adds a regression test that exercises the real createFunction and updateFunctionCode with package-type: Image and asserts that ImageUri is sent and that ZipFile / Runtime / Handler / Layers are not. Fixes aws-actions#70.
|
@reedham-aws Could you review it? |
reedham-aws
left a comment
There was a problem hiding this comment.
Thank you very much for raising this!
There is one thing I'm confused about, which is where this issue was introduced. Looking at #65, this code isn't deleted, but it was deleted in #39 (my own pr to add a linter action). I have no idea why this was changed in that PR because theoretically it was only linting. Do you know if this has been an issue since that was merged on 2025-08-20?
Would you mind explaining what lead you to the durable functions PR? Was it the version of the action that started failing?
| // Regression tests for issue #70: v1.1.1 broke Image package type by | ||
| // unconditionally calling packageCodeArtifacts and stripping packageType | ||
| // from createFunction / updateFunctionCode. | ||
| describe('Image package type wiring (regression for #70)', () => { |
There was a problem hiding this comment.
I don't think it makes sense to reference the issue number in the code because it's not clear at a glance what the issue is or what this test is doing from that name.
There was a problem hiding this comment.
Good point — agreed, the issue number doesn't convey what's being tested.
I've renamed it to Image package type wiring through createFunction and updateFunctionCode and dropped the // Regression tests for issue #70… comment above the describe block.
The PR description still links #70 for the historical context.
Thanks for digging into this — you're right. So yes: the bug has been on As for why I pointed at #65: I was working from the v1.1.1 release notes / changelog rather than the actual diff. |
The durable-functions refactor (#65) removed the package-type branching
in run(), createFunction, and updateFunctionCode, so Image deployments
now fail unconditionally with:
because packageCodeArtifacts() is called even when no
code-artifacts-dir is configured.
This restores the v1.1.0 behavior:
and omits Runtime / Handler / Layers for Image
Image and includes ImageConfig only for Image
Adds a regression test that exercises the real createFunction and
updateFunctionCode with package-type: Image and asserts that ImageUri
is sent and that ZipFile / Runtime / Handler / Layers are not.
Fixes #70.