CFn: remove UpdateModel from ChangeSet instance state#13796
Draft
CFn: remove UpdateModel from ChangeSet instance state#13796
Conversation
# 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
153813e to
71f0521
Compare
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 30m 38s ⏱️ - 1h 32m 59s Results for commit 71f0521. ± Comparison against base commit 184fb93. This pull request removes 4752 tests. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 43m 13s ⏱️ Results for commit 71f0521. |
Test Results - Alternative Providers572 tests 311 ✅ 17m 35s ⏱️ Results for commit 71f0521. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
During a discussion about the upcoming state management changes, we uncovered that one of the challenges is having to serialize the
UpdateModelbecause 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
update_modela non-serialized state, by removing the type from the type definition in the class. This should mean that we don't need to persist theUpdateModeland can compute it in a deserialize hook.ChangeSetso it can easily be called in the deserialization hook._setup_change_set_modelfunction