-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variables: Recognize only defined CLI options #9151
Conversation
As it's crucial to resolve .env which we consider a provider agnostic concept
Against command schemas which we know are supported in given context
Codecov Report
@@ Coverage Diff @@
## master #9151 +/- ##
==========================================
- Coverage 87.01% 86.92% -0.10%
==========================================
Files 293 302 +9
Lines 11285 11360 +75
==========================================
+ Hits 9820 9875 +55
- Misses 1465 1485 +20
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a general comment with commands-schema/aws-service
- there's a few of commands defined such as deploy
, invoke
or invoke local
that are not specific to AWS but are also supported e.g. by https://github.com/serverless/serverless-azure-functions. Is that breaking anything for these plugins?
|
||
const commands = (module.exports = new Map()); | ||
|
||
commands.set('deploy', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be only available for aws-service
? What about support for e.g. https://github.com/serverless/serverless-azure-functions ?
That's a good point, still let me explain reasoning for such separation. Commands as configured in They of course may work in other providers, but given provider is expected to configure some functionality for them, otherwise they will just do nothing. e.g. in case of Azure, there's a logic configured for but e.g. Azure does not have any logic defined for This PR is first step to make that experience better. All commands configured in Also I plan then to show help for those commands with AWS options stripped (as Currently this PR doesn't change anything in how help is displayed (it's just internal organization of command schemas that was improved) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for extensive clarification - looks great 👍
Not documented part of #8364
With this update only recognized (by CLI command schema) options are resolved out of variables. It's an intended behavior of a new resolver from a beginning. It's a step towards direction, where we abort request if user passes unrecognized options (it's to avoid eventual errors, due to command not being used as intended)
Additionally:
false
CLI param values (resolver returnednull
)--stage
as any (not just AWS) service option. As it's crucial to load.env
files, a functionality that's provider agnostic--version
on each command, and defininghelp
command schemaresolveInput
result objectprovider.name
at early stage.