Repository navigation
Shorter load time & updated git to 2.13.5 - #13
marcelobern wants to merge 2 commits into
Conversation
- Updated git from 2.4.3 to 2.13.5
pimterry
left a comment
There was a problem hiding this comment.
Awesome work! A few things I'd like to look at to simplify this first. I haven't dug into the finer details of this yet, I will try to find some details this week, but these are the main points that jumped out at me, which it'd be good to start with.
| } | ||
| }, error => { | ||
| reject(new Error(`lambda-git failed to load: ${error}`)); | ||
| }); |
There was a problem hiding this comment.
We shouldn't need to wrap a promise to manually call resolve/reject when we've already got a promise coming back from lambdaBinRuntime.applyMinPack. I think you can change this to something like:
function installGit(options) {
options = options || {}; // (skip the new Promise)
...
return lambdaBinRuntime.applyMinPack(targetDirectory).then(() => {
...
// Now normal returns work fine, no resolve():
return {
binPath: binPath
...
};
});
// no error => reject() needed - promise errors propagate automaticallyThere was a problem hiding this comment.
Will push this change once I hear back from you on the other items.
|
|
||
| const GIT_FILENAME = 'git-2.13.5.tar'; | ||
|
|
||
| gulp.task('default', async (done) => { |
There was a problem hiding this comment.
Why do we need gulp here? Could we make this a simple node script instead? Seems a little like overkill.
There was a problem hiding this comment.
We could migrate it to its own script. That might require some work around error handling, which gulp is handling for us now.
As this is being invoked by npm (see package.json -> scripts -> prepublishOnly) error handling would need to work nicely there as well, so npm publish does not happen when prepublishOnly fails.
I am willing to give it a try or we could leave it as a future enhancement and release the current version sooner rather than later. Thoughts?
There was a problem hiding this comment.
I do think it would be better to do this as a standalone script, and drop all those deps. If it's a lot of work it's ok, but it would be better if you've got time.
I'd be surprised if gulp is actually giving you much error handling here, and it shouldn't be necessary anyway - any stream that fires an error event without a specific handler will already crash the node process with a failing exit code immediately, and that should be sufficient to block publishing.
There was a problem hiding this comment.
done, stageGit.js worked from within npm run prepublishOnly
There was a problem hiding this comment.
And now I remember why I was using gulp...
It was to bypass issues around filecompare running on Node 6 & 7...
I do not know what gulp is doing that fixes it but without it Travis CI Node 6 & 7 tests fail with error:
/home/node/app/node_modules/filecompare/lib/index.js:3
const fsread = require('util').promisify(fs.read);
^
TypeError: require(...).promisify is not a function
I am open to suggestions here but if we do not find a quick fix I vote for keeping gulp and moving on...
|
|
||
| const GIT_FILENAME = 'git-2.13.5.tar'; | ||
|
|
||
| gulp.task('default', async (done) => { |
There was a problem hiding this comment.
I do think it would be better to do this as a standalone script, and drop all those deps. If it's a lot of work it's ok, but it would be better if you've got time.
I'd be surprised if gulp is actually giving you much error handling here, and it shouldn't be necessary anyway - any stream that fires an error event without a specific handler will already crash the node process with a failing exit code immediately, and that should be sufficient to block publishing.
- cleanup unnecessary Promise - removed ./bin from git - replaced gulp with stageGit.js
|
@pimterry could you please let me know if you are ok with using I would like to close this PR and cross this off my to do list ;-) |
|
Closing this PR as it is no longer needed with the release of git-lambda-layer |
|
Sorry for the delay @marcelobern, I've been away. Totally agree that layers are a nicer more general solution to this, great to see that! I'll update the readme to link there, and deprecate this package. |
Now that lambda layers are available, they provide a more general solution to this problem. See #13 for some context.
|
Any plans to continue this PR? |
|
@rarkins seems like not, but it needs a reboot anyway. I'm well overdue to take a look at this, especially with Node 10 hitting Lambda this week (which breaks this package). Gonna close. |
Implemented
bin-minify&lambda-bin.stageGit.jsto untar git and satge it withbin-minify.config.jsto ensure path consistency betweenstageGit.jsandindex.jswhile preventing API breaks and keeping run-time footprint as small as possible.Testing
eslintconfig file with rules from existing code, and fixed current code to adhere to this configuration.coveralls.CI
coveralls.filessection topackage.jsonto avoid publishing the git tar file (and reduce module size).prepublishOnlyscript topackage.jsonto automate the staging of git binaries prior tonpm publish.Documentation
HOWTO.mdwith details for maintainers on how to update to new git versions and changing the code files.CHANGELOG.md.README.mdto format sample code and add NPM, Travis CI, and Coveralls badges.