-
Notifications
You must be signed in to change notification settings - Fork 384
Closed
Description
Scenario:
- 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 docshas a "name" at execution time ofdocs.build, but when used as a pre-task it comes out as justbuild
- So e.g.
- 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'sconfiguration(''). - I haven't gone past this yet but suspect this is the key, the config options are likely stored on the
docsnamespace and so anyconfiguration()call not usingdocswon'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
docsand turning updocs.buildneeds to match the pre-task machinery seeingdocsand ensure it also turns updocs.build"?
Metadata
Metadata
Assignees
Labels
No labels