You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(enum-updater): support adding manual static enum mappings (#34441)
### Issue # (if applicable)
Closes #<issue number here>.
### Reason for this change
Manual changes to the `static-enum-mapping.json` would be overwritten the next time the workflow was run.
### Description of changes
Add a new file `manual-enum-mapping.json` that allows maintainers to add manual mappings that will be used over any matching mapping that the script calculates.
Manual mappings should be added in the form:
```
{
"serviceName": {
"CdkEnumName": {
"cdk_path": "path/to/cdkEnum",
"sdk_service": "serviceName",
"sdk_enum_name": "AwsEnumThatWeWantThisToMapTo",
"match_percentage": 1.0,
"manual": true
}
}
}
```
For example:
```
{
"ec2": {
"VpcEndpointIpAddressType": {
"cdk_path": "aws-cdk/packages/aws-cdk-lib/aws-ec2/lib/vpc-endpoint.ts",
"sdk_service": "ec2",
"sdk_enum_name": "IpAddressType",
"match_percentage": 1.0,
"manual": true
}
}
}
```
### Description of how you validated changes
Manual + unit testing
### 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*
Copy file name to clipboardExpand all lines: tools/@aws-cdk/enum-updater/README.md
+49-1Lines changed: 49 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# CDK Enum Updater
2
2
3
-
This tool updates CDK enums with missing enum values on a weekly basis.
3
+
This tool updates CDK enums with missing enum values on a weekly basis. It is triggered by the following two Github workflows:
4
+
*[Update Enum Static Mapping](../../../.github/workflows/enum-static-mapping-updater.yml) - Runs every week on Monday 12am
5
+
*[Update Missing Enum Values](../../../.github/workflows/enum-auto-updater.yml) - Runs every week on Monday 1pm
4
6
5
7
To run the tool locally, run the following commands to install dependencies and build:
6
8
@@ -101,4 +103,50 @@ All exclusions for a module should be listed together. For example if you want t
101
103
}
102
104
}
103
105
}
106
+
```
107
+
108
+
### Manual Static Mapping Overrides
109
+
Sometimes the script will calculate the wrong static enum mapping. You can override this value by adding an entry to the `lib/manual-enum-mapping.json` file.
0 commit comments