Skip to content

Fix issue of syncing CF template when all LambdaFunctions are removed. #1258

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

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

normj
Copy link
Member

@normj normj commented Jul 31, 2022

Description of changes:
Fix an issue when all of the remaining LambdaFunction are removed from the project the CF template is not synced leaving the Lambda functions defined in the template.

The fix has the following changes:

  • Move the computation of the project directory. It used to be computed from the first LambdaFunction but since there might not be any LambdaFunction it was moved to the syntax visitor and where it can be computed on the first class that was found.
  • Change the Generator's short circuit from there being no LambdaFunction which caused the bug to only short circuit if the project directory was not calculated. That would happen if there are no classes in the project.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@normj normj force-pushed the normj/annotations-fix-delete branch from 9687ead to ac8d502 Compare July 31, 2022 07:58
public bool DoesCloudFormationTemplateExist(string projectRootDirectory)
{
var templateAbsolutePath = DetermineCloudFormationTemplatePath(projectRootDirectory);
return File.Exists(templateAbsolutePath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use IFileManager wrapper here.

Suggested change
return File.Exists(templateAbsolutePath);
return _fileManager.Exists(templateAbsolutePath);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@normj normj force-pushed the normj/annotations-fix-delete branch from ac8d502 to 2218656 Compare August 1, 2022 20:17
@normj normj merged commit e78caae into dev Aug 2, 2022
@normj normj deleted the normj/annotations-fix-delete branch May 3, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants