#ahhh yes, this is tricky ๐Ÿ˜„ i've tended

1 messages ยท Page 1 of 1 (latest)

main apex
#

I am not sure I understand, are you recommending to put everything in a single module (GoLang App + dagger code) ?

hollow snow
#

oh i see! no i'd keep those separate

main apex
#

I think the initial mental model I had was the following:

  • One module with multiple packages for the app
  • One module for Dagger automation
hollow snow
#

by default, we have a ./dagger directory at the top-level - but other options exist, you can put your dagger code wherever you like

main apex
#

now the problem is, what if the module for Dagger automation needs features that are in the app (i.e. configuration of containers to be used for testing?)

hollow snow
#

aha, we do this ๐ŸŽ‰ it's a pain, sorry

#

so, you can have a dependency - but it can only be a one-way direction. i'd recommend having your dagger module depend on your app instead of the other way round if you can

main apex
#

Yes, makes sense. Though I believe that it can't depend on anything that is _test in GoLang

hollow snow
#

yup, i think that's right

main apex
#

that's why I have a problem

#

so now I either move the helper code from the test package into the main package, or I create a separate module for common code that I needs both in Dagger and in my app

hollow snow
#

we have this for consts - our solution is just to split out the consts into a separate file/package, and then it's very easy to do the dep

main apex
#

Can you share a link maybe?

hollow snow
main apex
#

so here there are only two packages, the dagger code and the app. Do you have an example of three packages? app code, common utilities, dagger code?

hollow snow
#

hm, so for those common utilities, we just have a common package in the top-level module

#

we have 2 modules, but each module has multiple packages

main apex
#

Oh i see. You have a top level module, the dagger code that depends on the top level module, and then you have another module that depends on the top level module?

hollow snow
#

we just have two modules - a module is defined by the go.mod, while a package is just any old directory
so i think internal/distconsts is the shared package between them

#

but that package is part of the top-level module

main apex
#

got it, thanks