{"action":"created","issue":{"url":"https://api.github.com/repos/serverless/serverless/issues/2681","repository_url":"https://api.github.com/repos/serverless/serverless","labels_url":"https://api.github.com/repos/serverless/serverless/issues/2681/labels{/name}","comments_url":"https://api.github.com/repos/serverless/serverless/issues/2681/comments","events_url":"https://api.github.com/repos/serverless/serverless/issues/2681/events","html_url":"https://github.com/serverless/serverless/pull/2681","id":188246596,"number":2681,"title":"Bring back include configuration for an easier packaging control","user":{"login":"pmuens","id":1606004,"avatar_url":"https://avatars.githubusercontent.com/u/1606004?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuens","html_url":"https://github.com/pmuens","followers_url":"https://api.github.com/users/pmuens/followers","following_url":"https://api.github.com/users/pmuens/following{/other_user}","gists_url":"https://api.github.com/users/pmuens/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuens/subscriptions","organizations_url":"https://api.github.com/users/pmuens/orgs","repos_url":"https://api.github.com/users/pmuens/repos","events_url":"https://api.github.com/users/pmuens/events{/privacy}","received_events_url":"https://api.github.com/users/pmuens/received_events","type":"User","site_admin":false},"labels":[{"id":374982417,"url":"https://api.github.com/repos/serverless/serverless/labels/area/dev-productivity","name":"area/dev-productivity","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-11-09T13:24:15Z","updated_at":"2016-11-16T07:20:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/serverless/serverless/pulls/2681","html_url":"https://github.com/serverless/serverless/pull/2681","diff_url":"https://github.com/serverless/serverless/pull/2681.diff","patch_url":"https://github.com/serverless/serverless/pull/2681.patch"},"body":"## What did you implement:\r\n\r\nCloses #2460\r\n\r\nBrings back the `include` configuration on a per-service and per-function level.\r\n\r\n## How did you implement it:\r\n\r\nAdded the include configuration and updated the zipping and packaging configuration so that the `include` definitions (globs) are appended to the `exclude` array. This way `globs.sync` will re-add the files (see https://github.com/jpillora/node-glob-all#usage).\r\n\r\n## How can we verify it:\r\n\r\nCreate the following directory structure:\r\n\r\n![bildschirmfoto 2016-11-09 um 14 22 54](https://cloud.githubusercontent.com/assets/1606004/20139767/0c0dcadc-a688-11e6-967e-557a30a11817.png)\r\n\r\nWith this `serverless.yml`\r\n\r\n```yml\r\nservice: reword-include-exclude\r\n\r\nprovider:\r\n  name: aws\r\n  runtime: nodejs4.3\r\n\r\n#### NOT INDIVIDUALLY\r\n\r\npackage:\r\n  exclude:\r\n    - excluded-by-default.json\r\n    - excluded-directory/**\r\n  include:\r\n    - excluded-directory/should-be-included.js\r\n    - excluded-directory/include-directory/**\r\n\r\nfunctions:\r\n  hello:\r\n    handler: handler.hello\r\n\r\n#### INDIVIDUALLY\r\n\r\n#package:\r\n#  individually: true\r\n#  exclude:\r\n#    - excluded-by-default.json\r\n\r\n#functions:\r\n#  hello:\r\n#    handler: handler.hello\r\n#    package:\r\n#      include:\r\n#        - excluded-by-default.json\r\n#  world:\r\n#    handler: handler.hello\r\n#    package:\r\n#      exclude:\r\n#        - event.json\r\n```\r\n\r\nComment out the stuff you want to test and run `serverless deploy --noDeploy`. After that inspect the `.zip` file.\r\n\r\n## Todos:\r\n\r\n- [x] Write tests\r\n- [x] Write documentation\r\n- [x] Fix linting errors\r\n- [x] Make sure code coverage hasn't dropped\r\n- [x] Provide verification config/commands/resources\r\n- [x] Change ready for review message below\r\n\r\n\r\n***Is this ready for review?:*** YES"},"comment":{"url":"https://api.github.com/repos/serverless/serverless/issues/comments/260872570","html_url":"https://github.com/serverless/serverless/pull/2681#issuecomment-260872570","issue_url":"https://api.github.com/repos/serverless/serverless/issues/2681","id":260872570,"user":{"login":"pmuens","id":1606004,"avatar_url":"https://avatars.githubusercontent.com/u/1606004?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuens","html_url":"https://github.com/pmuens","followers_url":"https://api.github.com/users/pmuens/followers","following_url":"https://api.github.com/users/pmuens/following{/other_user}","gists_url":"https://api.github.com/users/pmuens/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuens/subscriptions","organizations_url":"https://api.github.com/users/pmuens/orgs","repos_url":"https://api.github.com/users/pmuens/repos","events_url":"https://api.github.com/users/pmuens/events{/privacy}","received_events_url":"https://api.github.com/users/pmuens/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T07:20:42Z","updated_at":"2016-11-16T07:20:42Z","body":"Hey @rowanu thanks for the update about this! 👍 \r\nI agree. `individually` is not strictly necessary here as the outcome is obvious if I specify the exclude and include on a function level.\r\nMaybe we can open up a separate issue for this and continue the discussion there!\r\n\r\nCould not exactly reproduce the case that packaging differs when I run it for a service wide packaging and a per-function packaging. Maybe @nikgraf could open up an issue to describe how this can be reproduced.\r\n\r\nI think we should fix this in a separate PR as this one targets the `include / exclude`."}}
{"actor":{"display_login":"pmuens"}}