-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix(general): Used jsonpath to update vertex attributes #6852
Merged
+256
−9
Conversation
This file contains 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
…is a default one from cloudformation and shouldn't exist in the code
bo156
force-pushed
the
bugfix/cloudformation-if-evaluation-graph
branch
from
November 18, 2024 14:00
4c2b48c
to
85c5c8e
Compare
…ugfix/cloudformation-if-evaluation-graph
bo156
force-pushed
the
bugfix/cloudformation-if-evaluation-graph
branch
from
November 18, 2024 14:44
9f1f030
to
75b7788
Compare
bo156
changed the title
Bugfix/cloudformation if evaluation graph
fix(general): Used jsonpath to update vertex attributes
Nov 18, 2024
bo156
force-pushed
the
bugfix/cloudformation-if-evaluation-graph
branch
from
November 19, 2024 07:46
516009f
to
496a202
Compare
omriyoffe-panw
approved these changes
Nov 19, 2024
OfekShimko
approved these changes
Nov 19, 2024
Saarett
pushed a commit
that referenced
this pull request
Nov 19, 2024
* Added calculation of Fn::Sub in case of using Pseudo Parameter as it is a default one from cloudformation and shouldn't exist in the code * Only do sub in case of pseudo parameter usage * added example * Middle of debugging, currently works * Refactored update attribtue code to a method for jsonpath specifically * Created test based on example * Do not return jsonpath key from inner function * Check key in attribtues before accessing it * Removed mistakenly changed calculation of end vertices * Removed tmp example files * Added try-except to handle errors when parsing the jsonpath attribute * Removed re module usage to improve performance * Implemented cache for jsonpath to improve performance * Updated threshold on linux machine performance from 10 to 11 * Removed bad comment:
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.
User description
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
This PR fixes an inner method of updating attributes in vertices for all frameworks using graphs (like cloudformation and terraform). There was an issue in which we could override certain complex attributes mistakenly when setting the rendered value, as we would replace the entire attribute value instead of just the specific part of it. This PR adds jsonpath usage to find the correct location inside the attribute and replace only it.
Checklist:
Generated description
Below is a concise technical summary of the changes proposed in this PR:
This pull request addresses a bug in the method for updating vertex attributes across various frameworks, such as CloudFormation and Terraform, by implementing
jsonpath
to accurately target and update specific parts of complex attributes. TheCloudformationBlock
class now includes a method_handle_unique_key_characters
to manage unique key characters likeFn::If
. Additionally, theBlock
class has been enhanced with a caching mechanism for parsed JSONPath statements to improve performance. TheCloudformationVariableRenderer
class has been updated to handle conditions more robustly. New tests have been added to ensure the correctness of these changes, including a performance test adjustment and a new YAML test case for complex JSONPath conditions.jsonpath
to update specific parts of complex attributes in vertex updates, preventing unintended overwrites.Modified files (2)
Latest Contributors(2)
CloudformationVariableRenderer
to support complex JSONPath conditions.Modified files (1)
Latest Contributors(2)
Modified files (1)
Latest Contributors(2)
Modified files (3)
Latest Contributors(2)