Skip to content

Commit

Permalink
Deleted property checking and patch
Browse files Browse the repository at this point in the history
  • Loading branch information
rix0rrr committed Jul 3, 2023
1 parent b0e5c6f commit e66c57b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/@aws-cdk/cfnspec/build-tools/validate-evolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ function validatePropertyTypeNameConsistency(oldSpec: any, newSpec: any) {
// Might have disappeared, but no one should have been using this
continue;
}
if (newSpec.DeletedPropertyTypes?.[key]) {
// Marked as deleted on purpose
continue;
}

operations.push({
$comment: `If ${cfnResource}.${typeName} was renamed, use this and the 'replace's below. Remove this comment.`,
op: 'move',
from: `/PropertyTypes/${cfnResource}.<NEW_TYPE_NAME_HERE>`,
path: `/PropertyTypes/${cfnResource}.${typeName}`,
Expand All @@ -86,6 +91,13 @@ function validatePropertyTypeNameConsistency(oldSpec: any, newSpec: any) {
path,
value: typeName,
})));

operations.push({
$comment: `If ${cfnResource}.${typeName} was deleted on purpose, use this. Remove this comment.`,
op: 'add',
path: `/DeletedPropertyTypes/${cfnResource}.${typeName}`,
value: true,
});
}

const exampleJsonPatch = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"DeletedPropertyTypes": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"patch": {
"description": "Undoing upstream property type renames introduced in 129.0.0",
"operations": [
{
"op": "add",
"path": "/DeletedPropertyTypes/AWS::LakeFormation::DataLakeSettings.Permissions",
"value": true
},
{
"op": "add",
"path": "/DeletedPropertyTypes/AWS::QuickSight::Analysis.ColorsConfiguration",
"value": true
},
{
"op": "add",
"path": "/DeletedPropertyTypes/AWS::QuickSight::Analysis.CustomColor",
"value": true
},
{
"op": "add",
"path": "/DeletedPropertyTypes/AWS::QuickSight::Dashboard.ColorsConfiguration",
"value": true
},
{
"op": "add",
"path": "/DeletedPropertyTypes/AWS::QuickSight::Dashboard.CustomColor",
"value": true
},
{
"op": "add",
"path": "/DeletedPropertyTypes/AWS::QuickSight::Template.ColorsConfiguration",
"value": true
},
{
"op": "add",
"path": "/DeletedPropertyTypes/AWS::QuickSight::Template.CustomColor",
"value": true
},
{
"op": "add",
"path": "/DeletedPropertyTypes/AWS::SageMaker::ModelPackage.UserContext",
"value": true
}
]
}
}

0 comments on commit e66c57b

Please sign in to comment.