gruntwork-io / boilerplate

A tool for generating files and folders ("boilerplate") from a set of templates
https://www.gruntwork.io
Mozilla Public License 2.0
157 stars 12 forks source link

Surface error messages from underlying git commands #120

Closed yorinasub17 closed 1 year ago

yorinasub17 commented 1 year ago

Describe the bug Boilerplate doesn't surface git errors to the user, making it difficult to understand some error messages.

To Reproduce Run boilerplate targeting a remote template without any git credentials loaded. In this scenario, the error message reported by boilerplate looks like the following:

ERROR: Could not find boilerplate.yml in https:/github.com:<org>/<repo>/templates/additional-apps?ref=v0.4.2/boilerplate.yml and the missing-config-action flag is set to exit
yorinasub17 commented 1 year ago

After some testing, I was not able to reproduce this error. As far as I can tell, we are bubbling up the underlying git error code.

I tried a few things:

That said, the 404 error message can probably be improved.

mansoshaik-deloitte commented 1 year ago

@yorinasub17 I'm using boilerplate version v0.4.3

dependencies:
  - name: guestbook
    output-folder: './guestbook'
    template-url: git@github.com/JDoe/guestbook.git//nginx?ref=v0.1.0

The above configuration failed due to malformed Git SSH Url where the separator between the domain name and the organization should be : but the error thrown by boilerplate is misleading.

boilerplate] 2022/08/08 13:53:05 Processing dependency guestbook, with template folder git@github.com/JDoe/guestbook.git//nginx?ref=v0.1.0 and output folder guestbook
[boilerplate] 2022/08/08 13:53:05 Loading boilerplate config from boilerplate.yml
ERROR: Could not find boilerplate.yml in git@github.com/JDoe/guestbook.git//nginx?ref=v0.1.0/boilerplate.yml and the missing-config-action flag is set to exit
yorinasub17 commented 1 year ago

Thank you for the reproducible case. That makes more sense as to what you were seeing. I'll work on adding some better checks for this case!