Skip to content

Support remote boilerplate URLs in Template blocks #101

@odgrim

Description

@odgrim

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:

  1. Detect whether templatePath is a local path or a remote URL
  2. For remote URLs, skip the local path resolution and existence check
  3. Pass the URL through to boilerplate's TemplateURL option and let it handle the cloning/fetching
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions