Repository navigation
Move packaging to framework level - #3496
Conversation
|
@pmuens Could you do a check if this PR still works with the AWS deploy? |
|
@HyperBrain Just did a quick deploy to AWS. Everything fine for the AWS plugin. Also biiiiig +1 for moving it to the Framework level since packaging is not AWS related. This change was also on my todo list, so happy to see that you're already working on it here 👍 . |
|
Quick test with the OpenWhisk Node.js template and... it works again! I'll do a more comprehensive test tomorrow to ensure everything else is working. |
|
Just did a quick test with the Google Cloud Functions plugin. Works great. Thanks for the fix @HyperBrain 👍 |
3rd party plugins now can access it and trigger a single function package which was restricted to AWS before.
|
@jthomas @pmuens @eahefnawy From my side the PR is finalized now. Feel free to merge after you did the remaining tests (especially with the provider plugins). |
| const zipFileName = `${this.serverless.service.service}.zip`; | ||
|
|
||
| return this.zipDirectory(exclude, include, zipFileName); | ||
| return this.zipDirectory(exclude, include, zipFileName).then(filePath => { |
There was a problem hiding this comment.
if your promises are bluebird, you can use .tap
There was a problem hiding this comment.
Just did another test today.
Deployment with the Google Cloud Functions provider plugin works great!
Deployment and packaging (with service and provider level packaging) also works great!
This PR is GTM from my side ![]()
Just added some comments about outsourcing the naming. Not sure if changing it is worth the trouble.
/cc @eahefnawy @jthomas
| const exclude = this.getExcludes(); | ||
| const include = this.getIncludes(); | ||
| const zipFileName = this.provider.naming.getServiceArtifactName(); | ||
| const zipFileName = `${this.serverless.service.service}.zip`; |
There was a problem hiding this comment.
Maybe overkill but should we move this into a provider.naming function as well?
There was a problem hiding this comment.
This was in the naming namespace. But the problem is, that the topmost package command does not have knowledge nor access to the current provider. That's why we changed it here.
A possible improvement would be to create a provider-independent naming module that can be accessed here - but that will only increase debt as long as only one value/function is stored in there.
There was a problem hiding this comment.
Thanks for the explanation. Yes, I agree. A provider independent naming module would increase tech-debt and might be a little bit overkill for now. But something we should keep in mind if we see other patterns where we could utilize this again.
| const include = this.getIncludes(funcPackageConfig.include); | ||
| const zipFileName = this.provider.naming.getFunctionArtifactName(functionName); | ||
| return this.zipDirectory(exclude, include, zipFileName); | ||
| const zipFileName = `${functionName}.zip`; |
There was a problem hiding this comment.
Same here. Overkill, but maybe a provider.naming is a good place to store this value.
|
@jthomas Could you comment here as soon as you did your final tests? |
|
Gonna merge this since it fixes the issue. Any further issues reported by @jthomas would be fixed in later PRs (if any). @jthomas please let us know whenever you have updates 🙌 As always, thanks a lot @HyperBrain 😊 |
|
No more issues encountered. 🥇 |
What did you implement:
Restores compatibility with provider plugins. See #3344
How did you implement it:
The packaging is now moved to the framework level. The global package plugin overwrites the
package:createDeploymentArtifacts.How can we verify it:
Use "serverless deploy" with different plugins (including AWS). The command should work as before.
Additionally check if deploy and package still work for the AWS plugin with a given package option.
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO