You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a configured task/tree such as invocation.docs
Some other 'vanilla' task in the tree specifies one of those configured tasks in its pre-tasks list (e.g. @task('docs'))
Expected: the pre-task is able to find its configuration parameters, just as if it had been called by itself on the CLI
Instead: the pre-task is unable to find any config parameters.
Digging:
Config lookup is done based on the "name" of the task being executed
Right now that is always the actual task specified on the CLI; that may not be entirely accurate and should probably change to be the actual task being called (this is within the loop across "all tasks", aka post-expansion of pre/post tasks.
Further confusing things is that in my specific use case, I am calling a 'default' task and its name gets expanded at CLI parse time (probably due to use of aliases/Lexicons) when it's called directly, but this does not occur when it's used as a pre-task.
So e.g. $ inv docs has a "name" at execution time of docs.build, but when used as a pre-task it comes out as just build
Config lookup uses the "directory" or "package" level of a task name, so e.g. in the direct case, we see configuration('docs') called, but in the indirect case, it's configuration('').
I haven't gone past this yet but suspect this is the key, the config options are likely stored on the docs namespace and so any configuration() call not using docs won't load them.
So perhaps we need to do more seeking back up the object ref chain so a task knows where it is currently living/stored & thus which config to load?
Needs to not break existing config overriding patterns...
Feels like another way of saying "parser seeing docs and turning up docs.build needs to match the pre-task machinery seeing docs and ensure it also turns up docs.build"?
Scenario:
invocation.docs@task('docs'))Digging:
$ inv docshas a "name" at execution time ofdocs.build, but when used as a pre-task it comes out as justbuildconfiguration('docs')called, but in the indirect case, it'sconfiguration('').docsnamespace and so anyconfiguration()call not usingdocswon't load them.docsand turning updocs.buildneeds to match the pre-task machinery seeingdocsand ensure it also turns updocs.build"?