Skip to content

fix(servicecatalog): avoid asset hash change for latest version in Pr… - #38608

Open
1001R wants to merge 2 commits into
aws:mainfrom
1001R:aws#24561
Open

fix(servicecatalog): avoid asset hash change for latest version in Pr…#38608
1001R wants to merge 2 commits into
aws:mainfrom
1001R:aws#24561

Conversation

@1001R

@1001R 1001R commented Aug 20, 2026

Copy link
Copy Markdown

Issue #24561

Closes #24561.

Reason for this change

When you use ProductStackHistory to handle the previous versions of your product and add a new version, the most recent version (prior to adding the new one) is altered because the asset hash calculated for the product template changes. This occurs because the asset hash for the current version and the historic versions is calculated differently.

Description of changes

I modified the code to ensure that the asset hash for a product template is calculated consistently, whether it comes directly from a ProductStack instance (as it does in the current version) or is retrieved from a snapshot. Previously, for the current version, the code generated the template in memory and hashed the string before saving the template to disk. I reversed this process, now saving the template to disk first and then applying FileSystem.fingerprint to the file—this matches the method used for snapshot versions.

This approach ensures that the asset hashes of historical versions of existing products based on ProductStack remain unchanged, since the code changes only impact the current version.

Describe any new or updated permissions being added

No additional permissions have been introduced, and none of the current ones have been modified.

Description of how you validated changes

I've added a unit test to cover this particular scenario.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions Bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Aug 20, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team August 20, 2026 06:22
@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

1 similar comment
@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(servicecatalog): ProductStackHistory changes last product version ID

2 participants