feat: Add in support for nested stack's code sync with Api's and StepFunctions#3948
Merged
mndeveci merged 14 commits intoaws:developfrom Jun 10, 2022
Merged
feat: Add in support for nested stack's code sync with Api's and StepFunctions#3948mndeveci merged 14 commits intoaws:developfrom
mndeveci merged 14 commits intoaws:developfrom
Conversation
mndeveci
reviewed
Jun 8, 2022
Contributor
mndeveci
left a comment
There was a problem hiding this comment.
Looks good to me in general, left a small comment there
Comment on lines
80
to
84
| definition_path = Path(self._build_context.base_dir).joinpath(definition_file) | ||
| if not self._build_context.use_base_dir: | ||
| child_stack = Stack.get_stack_by_full_path(ResourceIdentifier(api_identifier).stack_path, self._stacks) | ||
| if child_stack: | ||
| definition_path = Path(child_stack.location).parent.joinpath(definition_file) |
Contributor
There was a problem hiding this comment.
This seems duplicated lines with SFN flow. Can we move this one into a common function so that we can re-use it in sfn sync flow as well?
Can we also add some debug logs if we need to investigate an issue in the future?
mndeveci
approved these changes
Jun 9, 2022
samcli/lib/sync/sync_flow.py
Outdated
Comment on lines
321
to
322
| # A helper method used by non-function sync flows to resolve definition file path | ||
| # that are relative to the child stack to absolute path for nested stacks |
Contributor
There was a problem hiding this comment.
nit: let's put this as method documentation rather than a comment here.
mildaniel
approved these changes
Jun 9, 2022
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.
Which issue(s) does this change fix?
N.A.
Why is this change necessary?
Since currently we are implementing code sync support for nested stack, this will make Api and StepFunction resources within child stacks also syncable through sam sync --code.
How does it address the issue?
It resolves the definition files from path relative to child template, to path relative to root template. For base_dir use cases, this will still be base_dir based.
What side effects does this change have?
Not known.
Mandatory Checklist
PRs will only be reviewed after checklist is complete
make prpassesmake update-reproducible-reqsif dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.