Commit 869b109
chore(cli): allow valid enum values in telemetry data (#711)
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
---------
Signed-off-by: github-actions <[email protected]>
Co-authored-by: github-actions <[email protected]>1 parent d40bf52 commit 869b109
File tree
2 files changed
+35
-3
lines changed- packages/aws-cdk
- lib/cli/telemetry
- test/cli/telemetry
2 files changed
+35
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
111 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
112 | 135 | | |
113 | 136 | | |
114 | 137 | | |
0 commit comments