-
Notifications
You must be signed in to change notification settings - Fork 4k
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
cli: plugin option set in cdk.json is ignored #32814
Comments
In case this helps, looks like it was introduced here -> https://github.com/aws/aws-cdk/pull/32596/files#r1896971697 When the settings are merged due to the order of operations the default value https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/settings.ts#L146-L151 |
Hi @wiget , thanks for reaching out. Looks like this has already been added to the core team's backlog and team should be working on it. |
### Issue # (if applicable) Closes #32814 ### Reason for this change yargs treats arrays weirdly. setting `default: undefined` results in the default array as `['undefined']`. So instead, I set the default to be `default: []`. However, this triggers an issue with the order of combining all arguments, and the CLI default was overriding any values in `cdk.json` for array types. So instead, we must omit the `default` property entirely for arrays, in order to achieve the desired behavior of `undefined` as default. ### Description of changes Updated code generation to generate NO default property for array types ### Description of how you validated changes tests in `user-input-gen` and the diff of `parse-command-line-arguments.ts` show that unless already defined, we are omitting defaults for arrays ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
The
plugin
option in the project'scdk.json
file is ignored.Regression Issue
Last Known Working CDK Version
2.173.4
Expected Behavior
The
plugin
option in the project'scdk.json
file is honoured and defined plugins are used to obtain credentials.Current Behavior
The
plugin
option in the project'scdk.json
file is ignored.Reproduction Steps
In the output, there will be
merged settings
section. Look forplugin
. If it's[]
then the bug is present.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.174.0
Framework Version
No response
Node.js Version
22.11.0
OS
Ubuntu 24.04
Language
TypeScript
Language Version
Typescript (5.7.2)
Other information
No response
The text was updated successfully, but these errors were encountered: