Skip to content

Allow Inclusion after Exclusion using ! Globs - #2266

Merged
pmuens merged 8 commits into
serverless:masterfrom
craftship:issue-2264-glob-include
Oct 31, 2016
Merged

pmuens merged 8 commits into
serverless:masterfrom
craftship:issue-2264-glob-include

Conversation

@jonsharratt

@jonsharratt jonsharratt commented Oct 5, 2016 •

Copy link
Copy Markdown
Contributor

What did you implement:

_Implementing Issue:_ #2264 and #2472

How did you implement it:

  • Switched out glob to use glob-all that supports ! patterns and arrays of patterns being passed for globbing.

How can we verify it:

  • Added spec demoing re-inclusion glob patterns

Example of re-including node-fetch module after excluding all node_modules

package:
  exclude:
    node_modules
    !node_modules/node-fetch

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config/commands/resources
  • Change ready for review message below

_Is this ready for review?:_ YES

@jonsharratt

Copy link
Copy Markdown
Contributor Author

Ready for review 🚀

@pmuens

pmuens commented Oct 5, 2016

Copy link
Copy Markdown
Contributor

Great! Thank you very much @jonsharratt for jumping right into it! 👍 🌮 🎉

Could you maybe add a small doc snippet so that users can see how they can include files.

Furthermore does this also support symlinks?

@pmuens pmuens self-assigned this Oct 5, 2016
@pmuens pmuens added this to the v1.0-ideas milestone Oct 5, 2016
@pmuens

pmuens commented Oct 5, 2016 •

Copy link
Copy Markdown
Contributor

Great. Thanks for the updates! 👍

Will review this PR next up.

@jonsharratt

Copy link
Copy Markdown
Contributor Author

Just testing with my project before it is ready for re-review to make sure it is all good

@jonsharratt

Copy link
Copy Markdown
Contributor Author

Ready for review 🚀

Integration tested it on my npm registry project looks all good now 👍

@jonsharratt

Copy link
Copy Markdown
Contributor Author

Rebased master into branch to ensure it can be merged once reviewed.

Comment thread docs/01-guide/10-packaging.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be wrapped in quotes so that we don't get a YAML exception

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot indeed 👍

Comment thread lib/plugins/package/README.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be wrapped in quotes so that we don't get a YAML exception

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot indeed 👍

Comment thread lib/plugins/package/tests/zipService.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rename this to include-me.js so that it's more explicit what it should do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, changed - Think at the time I read it as do not exclude me 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yep. That makes sense...

@pmuens

pmuens commented Oct 10, 2016 •

Copy link
Copy Markdown
Contributor

@jonsharratt love this one! Really great job! 👯

Just a few minor things and then it's good to go! Tested it locally and it works really great 👍

@jonsharratt

Copy link
Copy Markdown
Contributor Author

Ready for re-review 🚀

@pmuens pmuens mentioned this pull request Oct 12, 2016
6 tasks done
@jonsharratt

Copy link
Copy Markdown
Contributor Author

Going to sort the conflicts for this now 👍

@pmuens

pmuens commented Oct 12, 2016

Copy link
Copy Markdown
Contributor

@jonsharratt thanks for getting back and updating the PR! 🎉

(The preparation for the v1 release produced some PR conflicts 😿 )

@jonsharratt

jonsharratt commented Oct 12, 2016 •

Copy link
Copy Markdown
Contributor Author

Ah no worries, always up for fixing a conflict sandwich, means progress!!

Rebased, solved conflicts and pushed ready for another look!

@jonsharratt

Copy link
Copy Markdown
Contributor Author

Right sorting this last conflict again hehe 👯‍♂️

@pmuens

pmuens commented Oct 13, 2016

Copy link
Copy Markdown
Contributor

Just reviewed it again. Love it!

Thank you very much @jonsharratt (love your gifs. Made my day 😹 )!

@flomotlik Ready to be merged. This is a follow-up PR of #2194

@pmuens pmuens assigned flomotlik and unassigned pmuens Oct 14, 2016
@demetriusnunes

demetriusnunes commented Oct 14, 2016 •

Copy link
Copy Markdown

Guys (@jonsharratt), just saw an important flaw that can be easily fixed. The order in which the default, service and function excludes are concatenated in packageService.js:21 is critical. Function excludes should come last as they are more specific and therefore more relevant. So it should be:

return _.union(this.defaultExcludes, packageExcludes, exclude);

Right now, is reversed, so a typical use-case in which I exclude everything at the top with ** and include only the needed parts in the function definition is not working.

@demetriusnunes

Copy link
Copy Markdown

@jonsharratt, please fix the order of the excludes array as stated above, thanks!

@jonsharratt

jonsharratt commented Oct 17, 2016 •

Copy link
Copy Markdown
Contributor Author

@demetriusnunes Will take a look this evening, thanks for the feedback.

@demetriusnunes

Copy link
Copy Markdown

Please, merge this. Thanks!

@5inline

5inline commented Oct 27, 2016

Copy link
Copy Markdown

Please, please let me deploy my symlinks again!

@jonsharratt

Copy link
Copy Markdown
Contributor Author

Think there is further discussions around this perhaps happening, all good if it goes in another direction. Just keeping it up to date so it can be merged if deemed an appropriate method for doing this 💃

If you are at http://serverlessconf.io/ maybe ask @flomotlik to merge it in hehe 🙈 !

@pmuens

pmuens commented Oct 31, 2016

Copy link
Copy Markdown
Contributor

Awesome @jonsharratt 👍 💯

Thanks for updating and rebasing. Will merge it now. Great addition to the current globs support!

@pmuens
pmuens merged commit fdabea4 into serverless:master Oct 31, 2016
@jonsharratt
jonsharratt deleted the issue-2264-glob-include branch October 31, 2016 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants