turbot / pipe-fittings

Shared components for use across pipe projects.

Home Page:https://github.com/turbot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refer to a local directory for mod dependencies?

e-gineer opened this issue · comments

While doing development of mods in flowpipe or powerpipe it's common to have mod dependencies. Unfortunately right now those dependencies must be from a github repo or similar, which makes local development more difficult than I'd like.

Suggestion, can we just accept a local directory in the version attribute of the mod block? For example:

mod "aws_compliance" {
  title = "flowpipe-mod-foo"
  require {
    # local variation of a mod that often lives in github
    mod "github.com/turbot/flowpipe-mod-bar" {
      # support full paths
      version = "file:///full/path/to/local/flowpipe-mod-bar"
    }
    # purely local mod, no git ever pushed
    mod "baz" {
      # support relative paths
      version = "file:../relative/path/to/my/baz"
    }
  }
}

In this case we're allowing a "rootless path" variation of the file: scheme, which is common practice (even if not technically RFC compliant?). See https://stackoverflow.com/a/53082960

When using file based mod location I should be able to just hack away on my mod on the local machine always seeing the latest changes.

Note that mod names don't need to be in github.com/identity/repo format either - no need for that when working with local files.

Note that this format avoids the complexity of golang style replace directives, at the expense of requiring you to modify the actual install version and location of the mod.

fixed by 11eed7e