In the organization I work with we're kickstarting a large refactor of our pipelines to use Dagger as the backbone. I'm looking for some tips and experience on how to organize large projects and maybe some pros/cons of different approaches.
Context: we've different kinds of projects (i.e. different technologies / deployment strategies). We're using Go for these.
As of now, the only real option I see is to have separate module for each kind of project (i.e. Go, Maven, Yarn, Python, etc.). There's not really any major drawback with this, except the developer experience for people maintaining these modules because of Go Workspaces and having to call dagger develop on every module to work on them. Has anyone experienced this to be a drawback in the long term?
Other approach that I'd prefer is to have a single Dagger module (let's say MyModule) that has functions for sub-modules that are normal internal Go packages, for example:
package main
import (
"github.com/my-org/dagger/internal/go"
"github.com/my-org/dagger/internal/maven"
)
type MyModule struct{}
func (m *MyModule) Maven() *maven.Maven {
return new(maven.Maven)
}
func (m *MyModule) Go() *go.Go {
return new(go.Go)
}
Unfortunately this approach doesn't work since Dagger cannot code-generate for foreign type <IMPORTED MODULE>. Yes, we can just define all the types we need in the same Go package, I just fear that it grows too large and becomes harder to understand and maintain.
So, any tips and advices or just general experiences on how you've done it in your own projects?
Thank you so much in advance for any help!