Load existing modeled methods before saving, to avoid overwriting data#2621
Merged
robertbrignull merged 4 commits intomainfrom Jul 20, 2023
Merged
Load existing modeled methods before saving, to avoid overwriting data#2621robertbrignull merged 4 commits intomainfrom
robertbrignull merged 4 commits intomainfrom
Conversation
Contributor
Author
|
I realise this is a bit of a change to behaviour. I could try to get the framework mode PR up so you can see how this new behaviour will be used. |
Contributor
Author
|
Actually, framework mode, by clicking "switch mode" is working pretty well with this PR and saving individual sections is working as intended. |
koesie10
approved these changes
Jul 19, 2023
Member
koesie10
left a comment
There was a problem hiding this comment.
These changes make sense to me
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.
The idea of this PR is to avoid the possibility of losing data when writing data extension YAML files. We read the modeled methods in and then merge the existing contents with the new contents. As you can see from the tests, the behaviour when there are no existing modeled methods is the same, and there are new tests for when there are existing modeled methods.
The feature that's pushing us to implement this is to allow saving only some of the modeled methods from a model at a time. This will be necessary to support framework mode where we want to only save methods from a single package.
I've tested this locally and I believe it's doing the right thing. If I modify or add a new model file while the extensions editor is open, it will not delete the new file and any changes will be merged into the existing content. Framework mode doesn't quite work fully yet so I can't test it there, but implementing framework mode fully is the next thing I will look at.
Checklist
ready-for-doc-reviewlabel there.