Closed potash closed 6 years ago
I can see where it looks like someone meant to implement this but never actually did: in call-or-include-helper, the file-path
state variable is getting set for the subordinate workflow file, but is never actually read. It would be simple enough to change this behavior to match the documentation, but I'm a little concerned that this will impact people who are depending on it working the way it currently works. Thoughts, @dirtyvagabond?
One way we can handle this is keep the current behavior for %include (which I've always understand to act as an inline), and add this behavior for the upcoming %context directive, which is intended to be the inclusion directive that takes on the CWD of the included file.
Right now this only applies to shell cmds and steps run, but it would be cohesive and common sensical to extend this CWD change behavior to nested includes within a %context-ed file.
On Wed, Oct 21, 2015 at 10:17 AM, Alan Malloy notifications@github.com wrote:
I can see where it looks like someone meant to implement this but never actually did: in call-or-include-helper https://github.com/Factual/drake/blob/develop/src/drake/parser.clj#L660, the file-path state variable is getting set for the subordinate workflow file, but is never actually read. It would be simple enough to change this behavior to match the documentation, but I'm a little concerned that this will impact people who are depending on it working the way it currently works. Thoughts, @dirtyvagabond https://github.com/dirtyvagabond?
— Reply to this email directly or view it on GitHub https://github.com/Factual/drake/issues/204#issuecomment-149966832.
Factual Confidential Information This email contains Factual confidential information and is only for use by the intended recipient under the terms of a non-disclosure agreement or other binding confidentiality terms. If you've gotten this email in error, please let the sender know of the mistake and delete the email immediately.
Since the %context directive has been merged, should I incorporate this nested include feature with that? I.e. when you %include a file, the included file's includes will reference the original directory, whereas when you %context a file, the included file's includes will reference the included file's directory.
@chen-factual Could you add a description of %context
to the google doc? I think it would be useful for me but I don't know exactly what it does. Thanks.
@potash Yeah good idea. I'll take care of that tomorrow.
@amalloy @dirtyvagabond I added %context documentation to the Drake Google doc (plus a table of contents link). Can you please review this?
If this is good and clear, then we can discuss the matter of getting this behavior of relative referencing nested includes in %context-ed sub-workflows only.
Current behavior of %includes within %context-ed files is the same as base behavior, the include path is relative to the parent.
thanks @chen-factual and apologies for the slow response. LGTM. let's get @amalloy's blessing as well... Alan, this ok with you?
Did you intend to assign to Alan instead of me?
intended to assign to you @chen-factual . you're the owner here ... like it or not! ;-)
Ah I see. So the edit i made to the Drake doc is still listed as a "recommendation". I assume you're the owner, can you push that through?
I'll start working on making extending %context path behavior to %include paths sometime this week.
done. thanks @chen-factual
I'll start working on making extending %context path behavior to %include paths sometime this week.
So one week became 4 months, but had some down time today to get this done. PR #211 submitted.
According to the docs when using the %include directive
But that doesn't seem to be true (currently or in previous versions). E.g.
Drakefile:
dir/Drakefile1:
and let dir/Drakefile2 be anything (e.g. empty). Then drake throws
According to the docs it should have been looking for dir/Drakefile2, no? For what it's worth, I also think it makes more sense.