Skip to content

fix: restore package-type Image branching (regression in v1.1.1)#73

Open
JamBalaya56562 wants to merge 1 commit intoaws-actions:mainfrom
JamBalaya56562:pr73
Open

fix: restore package-type Image branching (regression in v1.1.1)#73
JamBalaya56562 wants to merge 1 commit intoaws-actions:mainfrom
JamBalaya56562:pr73

Conversation

@JamBalaya56562
Copy link
Copy Markdown
Contributor

The durable-functions refactor (#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 feat: add support for durable functions #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 #70.

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

Failed to package artifacts: Code artifacts directory path must be provided

1 participant