-
Notifications
You must be signed in to change notification settings - Fork 14
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
grunt checkout-shas should npm prune and npm update #542
Comments
This would have to be done in a way that doesn't disrupt perennial. |
@pixelzoom any thoughts on this before I investigate? |
Agreed that this would be nice to have in As for what specifically
|
Also as noted in the other issue:
|
I have no plans to work on this in the near future. I'll put it up for grabs at the next developer meeting (or we can shelve it for now). |
I can look into this. |
I did a first pass at this, and it seems to work pretty well, would someone mind giving it a small review, perhaps @jonathanolson as I haven't bothered him nearly as much as I have @pixelzoom and @samreid recently? One thing I found while doing this was that |
I ran checkout shas today and was happy to see the npm prune and update automatically happening, thanks! I'll assign to @jonathanolson to see if he has time for a closer review. |
From reading the code, it looks like chipper would be pruned/updated 10 times if there are 10 repos included in dependencies.json? Can this be changed so chipper is only pruned/updated 1 time? (Also, presumably chipper is included in all dependencies.jsons?) |
I'm unsure what you mean, the prune and update command is called only when all repos have been checked out: if ( numToCheckOut === numCheckedOut ) {
pruneAndUpdate();
} Also I have noticed while running it that npm prune/update are only happening at the end, once for chipper and once for the simRepo. @jonathanolson could you be more specific about the problem you are seeing? |
Sorry, I was incorrectly thinking multiple repos would need npm update. That looks good to me. Some general notes: numCheckedOut++; is generally easier to read than numCheckedOut = numCheckedOut + 1; Iteration over 'properties' is done multiple times by filtering out comments and self. At the top: var dependenciesToCheckOut = Object.keys( dependencies ).filter( function( repository ) {
return repository !== repositoryName && repository !== 'comment';
} ); The hasOwnProperty check is not needed, since it's from loaded JSON (no prototype funkiness). Then, a name like 'dependencyName' would be much more readable than 'property'. assert( typeof( dependencies[ property ].branch !== 'undefined' ) && typeof( dependencies[ property ].sha !== 'undefined' ) ); could be somewhat simplified to assert( dependencies[ dependencyName ].branch && dependencies[ dependencyName ].sha ); since valid branch/head names and SHAs should be truthy. I also see error1, stdout1 and stderr1, but no error2, etc. Can these be renamed to error, stdout and stderr? |
@jonathanolson thanks for the recommendations, closing. |
npm prune and npm update are called explicitly in build-server. Do we need to improve this process? |
I think that's fine in fact I think it's better.This means that there is a disconnect between chipper and perennial here in the grunt rule ( one conducts npm prune/update and the other does not), but I think that this is much more explicit and easier to maintain for the build-server application. Closing. |
If our grunt builds always had this feature, then it would have simplified perennial. Since legacy maintenance builds don't have auto-prune and update, perennial needs this functionality. Once 100% of our published sims are using new grunt, we could simplify perennial, but this may not happen for a long long time. |
The instructions to prepare codebase for RC or to restore codebase are currently invasive, it would be better if
grunt checkout-shas
automatically didnpm prune
andnpm update
in chipper andnpm prune
andnpm update
.grunt checkout-master
should do the same.Bonus points if we can do this for the simulation directory as well (in addition to chipper).
The text was updated successfully, but these errors were encountered: