serverless / compose

Orchestrate Serverless Framework in monorepos
https://serverless.com/framework/docs/guides/compose
MIT License
111 stars 15 forks source link

Duplicate stage option being passed to 'sls package' #97

Closed mdial89f closed 2 years ago

mdial89f commented 2 years ago

I've made a hello-world repo of the issue with error logs and explanation here: https://github.com/mdial89f/double-stage-issue

What's broken?

When calling sls service-a:package --stage mystage from the compose level, an error is thrown due to a duplicate stage parameter being passed to service-a.

xxxxx@xxxxxxxxx double-stage-issue % serverless service-a:package --stage mystage --verbose
service-a › Invoking "package" on service "service-a"
service-a › Running "serverless package --stage=mystage --verbose --stage mystage"
Environment: darwin, node 14.18.3, framework 3.15.2 (local), plugin 6.2.2, SDK 4.3.2
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Unexpected multiple "--stage"
Error:

Verbose logs are available in ".serverless/compose.log"

Note the invoked command above contains both "--stage mystage" and "--stage=mystage".

Please see README here for folder structure and error.

What's the impact of this bug?

You can't run 'sls package' against a particular service from the compose level.
I hit this while trying to get my custom plugin command to work. I see that passing cli options to a plugin's command is still TODO, but I felt this falls outside that TODO, as it's the 'package' command and it's not failing from lack of passed options.

Steps to Reproduce?

Please see README here for exact reproduction steps.

in short:

sls service-a:package --stage mystage

Assorted Notes/Considerations

pgrzesik commented 2 years ago

Hello @mdial89f, thanks a lot for reporting and sorry you've run into trouble. I've managed to reproduce your problem and we will work on a fix shortly. 👍