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

Fix: Use Internal CLI templates #3590

Merged
merged 3 commits into from
Jan 19, 2022
Merged

Conversation

jonife
Copy link
Contributor

@jonife jonife commented Jan 17, 2022

Which issue(s) does this change fix?

#3576

Why is this change necessary?

Customers are currently experience issues when they can't clone

How does it address the issue?

Allow customers without internet or who can't clone the git repo access internal template without breaking

What side effects does this change have?

None

Checklist

  • Add input/output type hints to new functions/methods
  • Write design document (Do I need to write a design document?)
  • Write unit tests
  • Write/update functional tests
  • Write/update integration tests
  • 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.

@jonife jonife changed the title bug fix for sunning samcli when cloning fails Fix: Use Internal CLI templates Jan 17, 2022
@@ -70,6 +70,10 @@
}


def get_local_manifest_path():
return os.path.join(_init_path, "lib", "init", "local_manifest.json")
Copy link
Contributor

@mildaniel mildaniel Jan 17, 2022

Choose a reason for hiding this comment

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

Can we use pathlib here for consistency?

@@ -0,0 +1,176 @@
{
"dotnetcore3.1": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we get rid of the runtimes no longer supported by lambda from this manifest? @mndeveci

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, we are working on to remove them from app template repo, let's don't include them here at all.

@@ -124,7 +128,9 @@ def get_app_template_location(self, template_directory):
return os.path.normpath(os.path.join(self._git_repo.local_path, template_directory))

def get_manifest_path(self):
return Path(self._git_repo.local_path, self.manifest_file_name)
if self._git_repo.local_path and os.path.exists(Path(self._git_repo.local_path, self.manifest_file_name)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of os.path.exists could we use Path(..).exists() for pathlib consistency moving forward?

file_name_path = "local_manifest.json"
self.assertIn(file_name_path, manifest_path)

# @patch("samcli.commands.init.init_templates.InitTemplates.get_preprocessed_manifest")
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these commented lines okay to remove if unused?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove commented lines if we don't need them anymore

@jonife jonife requested review from mndeveci and mildaniel January 18, 2022 01:26
@mndeveci mndeveci merged commit cc8de72 into aws:develop Jan 19, 2022
mndeveci pushed a commit to mndeveci/aws-sam-cli that referenced this pull request Apr 5, 2022
* bug fix for sunning samcli when cloning fails

* fixed failing test in Appveyor

* change os.path to pathlib.Path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants