#Directory argument configuration repetition

1 messages · Page 1 of 1 (latest)

wise valve
#

I'm getting up to speed with the changes made in Dagger this year; in particular the removal of the "views" feature replaced with @argument() decorators for defaultPath and ignore. I have my various functions like lint, test, build etc, and each needs my source code as an input parameter. In pre-0.16.0 versions, I defined a view for just the paths I wanted brought in to the workflow and used the dagger call my-func --dirparam=.:viewname syntax to call my functions. Now I can just do dagger call my-func and use @argument on the Directory parameter to define a default path and an ignore pattern, but my problem is I have to put this definition on every one of my dagger functions which take my source code as input. I don't like this because if I need to change the ignore pattern I need to do it on every function.

I am somewhat new to TypeScript decorators so I have tried the obvious (to me) ways of factoring out my @argument() configuration object, and have not found anything that works yet. Am I barking up the wrong tree with this pattern?

wise valve
#

I think I figured out a way to do this by specifying the Directory input as a class member, set in a constructor function

deep flint
wise valve
#

Thanks 😎

deep flint
#

also: welcome back!