8000 CloudFormation v2 Engine: V1 Test Porting and Annotations and Batch of Parity Improvements by MEPalma · Pull Request #12660 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

CloudFormation v2 Engine: V1 Test Porting and Annotations and Batch of Parity Improvements #12660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 2, 2025

Conversation

MEPalma
Copy link
Contributor
@MEPalma MEPalma commented May 26, 2025

* Extends #12650

Motivation

The introduction of the CloudFormation v2 engine laid the foundation for a redesigned engine capable of accurately determining update requirements between CloudFormation deployments, while also enabling parallel execution during updates. However, the current implementation still has significant parity gaps with the CloudFormation v1 provider. These changes: port the v1 test suite to v2, enabling it for CI runs on the new provider; bring parity issue annotations to guide development; resolve a number of parity issues in the v2 provider.

Changes

  • Ported the v1 test suite for resources, api, and engine
  • Annotated each failing test with a CFNV2:<issue-identifier> format to guide development towards parity with the v1 engine
  • Resolved a number of parity issues, notably:
    • Resolved an issue for which sometimes changes to dynamic parameters were not picked-up by the update engine
    • Added base support for Fn::GetAtt to use the dot path syntax
    • Resolved an issue with the sampling of after values during describe change set operations
    • Resolved an issue for which runtime values of resources not requiring an update were lost after the first update cycle
    • Resolved an issue for which the physical resource id of a resource being updated but not rewritten was lost
    • Strengthened the computation of dependent entities ahead of use by enforcing evaluation ahead of returning upstream; this could lead to odd behaviors for which resources or values were being computed and noted as missing
    • Improved the debugability of the v2 engine by ensuring reproducible sorting of events
    • Resolved sorting issues in the v2 test utils
    • Other minors and related changes

@MEPalma MEPalma added this to the 4.5 milestone May 26, 2025
@MEPalma MEPalma self-assigned this May 26, 2025
@MEPalma MEPalma added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label May 26, 2025
@MEPalma MEPalma changed the title Mep cfn v1 test port CloudFormation v2 Engine: V1 Test Porting and Annotations and Batch of Parity Improvements May 26, 2025
@MEPalma MEPalma requested review from dominikschubert and removed request for dominikschubert, pinzon and simonrw May 26, 2025 08:18
Copy link
github-actions bot commented May 26, 2025

Test Results - Preflight, Unit

21 579 tests  ±0   19 927 ✅ ±0   6m 19s ⏱️ +11s
     1 suites ±0    1 652 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit bd336d9. ± Comparison against base commit e42e683.

♻️ This comment has been updated with latest results.

Copy link
github-actions bot commented May 26, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 9s ⏱️ +3s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit bd336d9. ± Comparison against base commit e42e683.

♻️ This comment has been updated with latest results.

Copy link
github-actions bot commented May 26, 2025

Test Results - Alternative Providers

914 tests   526 ✅  21m 23s ⏱️
  4 suites  388 💤
  4 files      0 ❌

Results for commit bd336d9.

♻️ This comment has been updated with latest results.

Copy link
github-actions bot commented May 26, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files      5 suites   2h 20m 26s ⏱️
5 141 tests 4 286 ✅ 855 💤 0 ❌
5 147 runs  4 286 ✅ 861 💤 0 ❌

Results for commit bd336d9.

♻️ This comment has been updated with latest results.

Copy link
github-actions bot commented May 26, 2025

LocalStack Community integration with Pro

    2 files  ±  0      2 suites  ±0   1h 42m 50s ⏱️ + 1m 12s
4 786 tests +308  4 084 ✅ +4  702 💤 +304  0 ❌ ±0 
4 788 runs  +308  4 084 ✅ +4  704 💤 +304  0 ❌ ±0 

Results for commit bd336d9. ± Comparison against base commit e42e683.

This pull request skips 1 test.
tests.aws.services.cloudformation.v2.ported_from_v1.resources.test_acm ‑ test_cfn_acm_certificate

♻️ This comment has been updated with latest results.

@MEPalma MEPalma requested review from simonrw and removed request for dominikschubert May 27, 2025 16:49
@MEPalma MEPalma changed the base branch from master to MEP-CFN-fn_sub May 28, 2025 09:28
Copy link
Contributor
@simonrw simonrw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of questions but lgtm

@@ -29,6 +29,12 @@ def capture(stack_name: str) -> PerResourceStackEvents:
return capture


def _normalise_describe_change_set_output(value: DescribeChangeSetOutput) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the order of changes in the output gives us clues into the implementation on the AWS side. If we have a difference then perhaps our visiting order needs adjusting instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I’ve observed, AWS returns changes in the same order as they are declared in the template.

Our implementation currently mirrors this behavior (it is also true that the json library preserving key order after 3.7, but this is not the only reason for our compliance here), except in cases where the user doesn’t explicitly sort dependencies in the template. In those situations, our system places the dependee’s resource change first (if a change exists there), though it otherwise respects the original order of the template for all other changes.

I’ve decided to omit these specifics for now, but it’s unfortunate that the snapshot is being influenced by the normalization process.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we either add a skipped test that exercises this behaviour or at least a TODO comment in the describe_change_set provider method to come back to in the future? I agree it's not critical for parity at this stage, but it is still a discrepancy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes absolutely, I'm adding this TODO in the PR for Fn::Split, after I merge this train of PRs today

@@ -0,0 +1,45 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there so many of these files?

@MEPalma MEPalma force-pushed the MEP-CFN-v1_test_port branch from f90a2db to 66937e0 Compare June 2, 2025 07:40
Base automatically changed from MEP-CFN-fn_sub to master June 2, 2025 08:15
@MEPalma MEPalma merged commit 7656937 into master Jun 2, 2025
57 checks passed
@MEPalma MEPalma deleted the MEP-CFN-v1_test_port branch June 2, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0