Skip to content
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

feat: only clone init templates when required #4817

Merged
merged 14 commits into from
Mar 7, 2023

Conversation

mildaniel
Copy link
Contributor

@mildaniel mildaniel commented Mar 4, 2023

Which issue(s) does this change fix?

N/A

Why is this change necessary?

AWS SAM CLI stores the cloned app templates in a local directory, but doesn't use it as a cache. The app templates repository doesn't need to be cloned every time if it is already up-to-date.

How does it address the issue?

Checks if the app templates repository needs to be cloned before cloning based on latest commit hash.

What side effects does this change have?

The .git directory in the app templates folder will now be copied to the cache directory whereas before it was excluded.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

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

Copy link
Contributor

@sriram-mv sriram-mv left a comment

Choose a reason for hiding this comment

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

I like where this is going and have been thinking of doing this same improvement for a while.

It should improve perf on sam init especially on not so great internet connections.

@mildaniel mildaniel marked this pull request as ready for review March 6, 2023 23:45
@mildaniel mildaniel requested a review from a team as a code owner March 6, 2023 23:45
@mildaniel mildaniel requested review from hnnasit and torresxb1 March 6, 2023 23:45
@mildaniel mildaniel enabled auto-merge (squash) March 7, 2023 17:36
@mildaniel mildaniel merged commit b55caf7 into aws:develop Mar 7, 2023
@mildaniel mildaniel deleted the clone-when-required branch March 7, 2023 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants