-
Notifications
You must be signed in to change notification settings - Fork 57
Child shifter runs should only use the arguments provided #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We noticed this when doing a walk on a module which specifies lint: false in it's build.json. |
Looks like the travis build is broken downloading dependencies. Builds and tests fine locally on 0.10 for me though (and on 0.8 at travis-ci.org) |
The issue with the build in nodejs 0.8 is due to this bug in travis: travis-ci/travis-ci#2076 |
Ah - thanks. That explains it. I think I've seen that issue elsewhere too. |
Any thoughts on this issue @caridy? |
key; | ||
|
||
// Get any supplied arguments if not specified. | ||
if (args === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testing for falsy value should be just fine.
I wonder if we could avoid changing the regular arguments initialization ( |
I will look into it later this week. |
When spawning a child Shifter run, we should not pass the child all of the default arguments as these will override any specified in the build.json.
I've changed the test to check for a falsy value, and reverted the setDefaults bit. The reason I opted originally to modify setDefaults was to ensure that all of the basic options are at least defined reliably and consistently defined, whichever way you call Shifter. I was in two minds as to whether to include that change or not and I've now removed it. |
In writing this, I also discovered that it's possible to pass arguments to shifter which are not listed in the list of known arguments, and for shifter to use those somewhere. I do wonder whether we should address that too in another issue. |
@andrewnicols this looks cleaner. thanks for making the changes, I will do a final pass on monday. as for the not listed arguments, I'm reluctant to add more restrictions, or to make this a whitelisting process, I think it should continue to be a simple default set of attributes and basic validation. |
@andrewnicols I have to revert this one too. Shifter thru yogi reports issue with the arguments. The repro case is very easy:
|
Darn - I even tried this with Yogi, but I'd forgotten to link shifter on my yogi branch. Will take a peek. Thanks! |
Hmm @caridy, can I ask what you're seeing? It's working perfectly for me with your replication instructions: 2011 nicols@loganberry:~/git/yui> cd yogi/
2012 yogi:master> npm link
npm WARN package.json [email protected] 'repositories' (plural) Not supported. Please pick one as the 'repository' field
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
/usr/local/bin/yogi -> /usr/local/lib/node_modules/yogi/bin/yogi.js
/usr/local/lib/node_modules/yogi -> /Users/nicols/git/yui/yogi
2013 yogi:master> cd ../shifter/
2014 shifter:walk_options> npm link
npm WARN package.json [email protected] 'repositories' (plural) Not supported. Please pick one as the 'repository' field
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
/usr/local/bin/shifter -> /usr/local/lib/node_modules/shifter/bin/shifter
/usr/local/lib/node_modules/shifter -> /Users/nicols/git/yui/shifter
2015 shifter:walk_options> cd ../yogi/
2016 yogi:master> npm link shifter
unbuild [email protected]
/Users/nicols/git/yui/yogi/node_modules/shifter -> /usr/local/lib/node_modules/shifter -> /Users/nicols/git/yui/shifter
2017 yogi:master> cd ../yui3
n2018 yui3:dev-3.x> npm link yogi
unbuild [email protected]
npm WARN prefer global [email protected] should be installed with -g
/Users/nicols/git/yui/yui3/node_modules/yogi -> /usr/local/lib/node_modules/yogi -> /Users/nicols/git/yui/yogi
2019 yui3:dev-3.x> npm link shifter
unbuild [email protected]
npm WARN prefer global [email protected] should be installed with -g
/Users/nicols/git/yui/yui3/node_modules/shifter -> /usr/local/lib/node_modules/shifter -> /Users/nicols/git/yui/shifter
2020 yui3:dev-3.x> yogi build
yogi [info] using [email protected] on [email protected]
yogi [info] running with shifter
shifter [info] racing to find the closest .shifter.json file
shifter [info] revving up
shifter [info] racing the directories
shifter [info] using --no-lint
shifter [info] found 102 modules to race, let's do this
shifter [warn] this will be quiet, only status will be emitted for speed. failed builds will print after
......................................................................................................
shifter [info] done racing, the gears are toast
shifter [info] finished in 1 minute, 26 seconds, pretty fast huh?
yogi [info] build complete |
Ok, can you issue a new PR so I can properly test it? maybe I messed up with the merges. |
@andrewnicols it might be PR #115, this is what I'm getting with the current master branch:
ideally, you, @ianstigator and @unkillbob can help me out here because I honestly don't have too much time these days. Master is currently stable, tests are passing, but when trying with the steps I described above, I see that weird error. If you can issue a PR with the fix, I will be happy to merge it and release the new version of shifter. otherwise it might take me a while to revisit this. |
Okay, I'm seeing these issues coming from the
@ianstigator @unkillbob |
I've just pulled a clean copy of v0.4.6 and applied #118 and #120 - yogi builds are fine. The output ( The problems seem to start in https://github.com/orionhealth/shifter/commit/6f2e135e5cbab1be55695bedee807da094785b59 but it could be that it's highlighting a pre-existing issue. Indeed, I think it may be. I've printed out the two objects in the err (array), along with a stacktrace:
Both of the input files there are empty. As a result, the task checker reports that the output files are empty too and bails. Fair enough... Commenting out the zero length test stops the yogi build from failing. So I'm seeing two issues we need to resolve here:
|
@caridy, you mentioned that you needed me to supply a new merge branch as you'd reverted my branch, but I'm not seeing that in the history. There is a revert commit 92dd95a, and the comment suggests that you're reverting #120 and #118, but from what I can see, that's #115 and #118. |
@andrewnicols I only reverted PR #118 based on your comments and your previous investigation. Your branch and this branch are in as in master today. |
When spawning a child Shifter run, we should not pass the child all of the
default arguments as these will override any specified in the build.json.