Closed yorinasub17 closed 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:
Directly passing in a --template-url
:
%~> boilerplate --template-url https://github.com/yorinasub17/i-dont-exist//templates/additional-apps\?ref\=v0.4.2 --output-folder ./out
[boilerplate] 2022/08/02 12:37:47 Downloading templates from https://github.com/yorinasub17/i-dont-exist//templates/additional-apps?ref=v0.4.2 to /var/folders/36/ljcx66pj73zd3sq1r1tsr_300000gn/T/boilerplate-cache2375334331
[boilerplate] 2022/08/02 12:37:48 Cleaning up working directory.
ERROR: bad response code: 404
Passing a template that has a dependency that is a 404
%~> boilerplate --template-url ./examples/test --output-folder out
[boilerplate] 2022/08/02 12:39:05 Loading boilerplate config from examples/test/boilerplate.yml
[boilerplate] 2022/08/02 12:39:05 Loading boilerplate config from examples/test/boilerplate.yml
This boilerplate template has a dependency! Run boilerplate on dependency docs with template folder https://github.com/yorinasub17/i-dont-exist//templates/additional-apps?ref=v0.5.2 and output folder ./docs? (y/n) : y
[boilerplate] 2022/08/02 12:39:09 Processing dependency docs, with template folder and output folder out/docs
[boilerplate] 2022/08/02 12:39:09 Downloading templates from https://github.com/yorinasub17/i-dont-exist//templates/additional-apps?ref=v0.5.2 to /var/folders/36/ljcx66pj73zd3sq1r1tsr_300000gn/T/boilerplate-cache359587952
[boilerplate] 2022/08/02 12:39:09 Cleaning up working directory.
ERROR: bad response code: 404
That said, the 404 error message can probably be improved.
@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
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!
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: