Right now, the Template component only supports local paths relative to the runbook directory. It'd be useful to also support remote boilerplate template URLs (e.g. git URLs like github.com/org/repo//path/to/template), since boilerplate already has built-in support for this via TemplateURL.
What needs to change
The current flow in HandleBoilerplateRender does a filepath.Join with the runbook directory and then an os.Stat check, which obviously won't work for remote URLs.
We'd need to:
- Detect whether templatePath is a local path or a remote URL
- For remote URLs, skip the local path resolution and existence check
- Pass the URL through to boilerplate's TemplateURL option and let it handle the cloning/fetching
- For local paths, keep the existing behavior
Things to consider
- Boilerplate clones remote templates to a temp directory. We should make sure cleanup happens properly on both success and failure.
- Network errors will need clear error messages so users aren't confused when a URL is unreachable.
Right now, the Template component only supports local paths relative to the runbook directory. It'd be useful to also support remote boilerplate template URLs (e.g. git URLs like github.com/org/repo//path/to/template), since boilerplate already has built-in support for this via TemplateURL.
What needs to change
The current flow in HandleBoilerplateRender does a filepath.Join with the runbook directory and then an os.Stat check, which obviously won't work for remote URLs.
We'd need to:
Things to consider