Hi, I have a monorepo in go, and I would like to use dagger to accomplish 2 things:
- have a single entrypoint for running the whole monorepo in a CI/CD
- have a dagger module for each app/feature inside the monorepo, for devs to run locally
In order to achieve this, the approach is:
- Have a single dagger module in the root of the monorepo, which invokes every app/feature dagger module
- Have one dagger module for each app/feature
- Have a standard dagger module to be used by 2. in order to avoid writting one million times a method to (e.g.) lint go
The general code for 2. would look like
package main
import "dagger/app-ci/internal/dagger"
const (
workDir = "/app/apps/app"
)
type AppCi struct {
dagger.StackStandarCi
}
func New() *AppCi {
stackStandarCi := dag.StackStandarCi(dagger.StackStandarCiOpts{WorkDir: workDir})
return &AppCi{*stackStandarCi}
}
However, when I run dagger call lint-go (available on my standard ci), it fails with failed to serve module: input: module.withSource.initialize resolve: failed to initialize module: failed to add object to module "app-ci": failed to validate type def: object "AppCi" field "StackStandardCi" cannot reference external type from dependency module "stack-standard-ci". It looks like an issue with dagger, since the go code seems fine, and I would achieve having all available methods in dagger.StackStandarCi .
Any experience on how this could be achieved?