Skip to content

chore(cli): allow valid enum values in telemetry data #711

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

Open
wants to merge 2 commits into
base: conroy/list
Choose a base branch
from

Conversation

kaizencc
Copy link
Contributor

Enum values are defined as choices in the cli-type-registry.json file. If the choices array exists, and if the value we get is included as a choice, then we allow that raw value to be recorded in telemetry because it is not free text. Invalid values passed in an enum property are not recorded. In practice, the CLI fails before telemetry starts with

Invalid values:
  Argument: require-approval, Given: "neveasdfr", Choices: "never", "any-change", "broadening"

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team July 11, 2025 19:41
@github-actions github-actions bot added the p2 label Jul 11, 2025
Signed-off-by: github-actions <github-actions@github.com>
['build-exclude']: ['something'],
};
expect(sanitizeCommandLineArguments(argv)).toEqual({
path: ['deploy', '$STACK1'],
parameters: { 'require-approval': '<redacted>', 'build-exclude': '<redacted>' },
parameters: { 'build-exclude': '<redacted>' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i removed require-approval from the test 'non-boolean options are redacted' and added it as a separate test called 'enum options are allowed'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants