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: Handle dot notations in the path_prop_name variables (#1537) #1550
Conversation
There are some changes in this codepath that could change your code. Can you rebase on latest |
@sanathkr Merged with the latest |
@wingkwong I am not sure this PR actually solves the problem of the issue. If all of our code was went through this Template class, this would work but build does not (Template is used only by the package command from what I could trace and understand). The package command in the Maybe I am missing something, where this PR is actually solving the issue. I think what we will want to do here is create another dummy glue resource here and update this test to assert the dot notation update is actually happening. Would you be able to add this tests? This will help us with ensure this doesn't break in the future and help us understand this is doing what we are expecting. |
@jfuss Thanks for the clarification. I'll take a look later. |
@jfuss I think my fix updates the path inside move_template -> _update_relative_paths instead of update_template . If you run |
… fix-dot-notation
@jfuss on second thought, there is no functions_to_build in this case which means |
@wingkwong Good catch. I think |
… fix-dot-notation
…am-cli into fix-dot-notation
@jfuss @wingkwong How close are we to getting this merged? |
@wnkz I don't have further changes to make. I've been waiting for someone to review it. |
@wingkwong Apologize on the delay here. The missing piece is another test. I think this got lost in one of my comments above. I think what we will want to do here is create another dummy glue resource here and update this test to assert the dot notation update is actually happening. Would you be able to add this tests? This will help us with ensure this doesn't break in the future and help us understand this is doing what we are expecting. I know you have added a test within the |
@jfuss Sure. I'll take a look tonight. Thanks a lot. |
@jfuss Added. Please take a look to see if it is what you want. Thanks. |
@wingkwong Thanks for adding the extra tests. While reviewing, I noticed that you were not using jmespath (allows searching json based on dot notation). In the package command, we already use jmespath to do something very similar and why we have the dot notation defined in the resources.py. I updated your implementation to mimic what we do in package already. I also added an integ tests to validate that we update the nested property correctly. This is what I thought the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With addition of jmespath, the PR is much easier to follow. Approved.
Issue #, if available:
#1537
Description of changes:
Support dot notations in the path_prop_name variables under
samcli/commands/_utils/template.py
Checklist:
make pr
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.