PHANTOM
🇮🇳 IN
Skip to content

CFn: remove UpdateModel from ChangeSet instance state#13796

Draft
simonrw wants to merge 3 commits intomainfrom
cfn/remove-updatemodel-from-state
Draft

CFn: remove UpdateModel from ChangeSet instance state#13796
simonrw wants to merge 3 commits intomainfrom
cfn/remove-updatemodel-from-state

Conversation

@simonrw
Copy link
Contributor

@simonrw simonrw commented Feb 19, 2026

Motivation

During a discussion about the upcoming state management changes, we uncovered that one of the challenges is having to serialize the UpdateModel because this requires serializing the entirity of the internal representation of the template update, which brings in lots of types. Some of these types are better behaved (from a typing perspective) than others. All of them are annoying to serialize however!

Changes

  • Make the update_model a non-serialized state, by removing the type from the type definition in the class. This should mean that we don't need to persist the UpdateModel and can compute it in a deserialize hook.
  • Move the update model computation to an instance method on ChangeSet so it can easily be called in the deserialization hook.
  • Simplify the provider _setup_change_set_model function
  • Due to this move, the imports had to be updated to only import some types at type checking time to prevent circular imports
  • Minor code restructuring

@simonrw simonrw added semver: patch Non-breaking changes which can be included in patch releases docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes labels Feb 19, 2026
@github-actions
Copy link

github-actions bot commented Feb 19, 2026

Test Results - Preflight, Unit

23 123 tests  ±0   21 252 ✅ ±0   6m 45s ⏱️ +33s
     1 suites ±0    1 871 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 71f0521. ± Comparison against base commit 184fb93.

♻️ This comment has been updated with latest results.

# Motivation

During a discussion about the upcoming state management changes, we uncovered that one of the challenges is having to serialize the `UpdateModel` because this requires serializing the entirity of the internal representation of the template update, which brings in lots of types. Some of these types are better behaved (from a typing perspective) than others. All of them are annoying to serialize however!

# Changes

* Make the `update_model` a non-serialized state, by removing the type from the type definition in the class. This should mean that we don't need to persist the `UpdateModel` and can compute it in a deserialize hook.
* Move the update model computation to an instance method on `ChangeSet` so it can easily be called in the deserialization hook.
* Simplify the provider `_setup_change_set_model` function
* Due to this move, the imports had to be updated to only import some types at type checking time to prevent circular imports
* Minor code restructuring
@simonrw simonrw force-pushed the cfn/remove-updatemodel-from-state branch from 153813e to 71f0521 Compare February 20, 2026 22:47
@github-actions
Copy link

Test Results (amd64) - Acceptance

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

Results for commit 71f0521. ± Comparison against base commit 184fb93.

@github-actions
Copy link

LocalStack Community integration with Pro

  2 files  ±    0    2 suites  ±0   30m 38s ⏱️ - 1h 32m 59s
573 tests  - 4 752  466 ✅  - 4 491  107 💤  - 261  0 ❌ ±0 
575 runs   - 4 752  466 ✅  - 4 491  109 💤  - 261  0 ❌ ±0 

Results for commit 71f0521. ± Comparison against base commit 184fb93.

This pull request removes 4752 tests.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…

@github-actions
Copy link

Test Results (amd64) - Integration, Bootstrap

  5 files    5 suites   43m 13s ⏱️
597 tests 491 ✅ 106 💤 0 ❌
603 runs  491 ✅ 112 💤 0 ❌

Results for commit 71f0521.

@github-actions
Copy link

Test Results - Alternative Providers

572 tests   311 ✅  17m 35s ⏱️
  1 suites  261 💤
  1 files      0 ❌

Results for commit 71f0521.

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

Labels

docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant