ScriptAutomate / aws-cfn-resource-specs

A Completely Tracked and Versioned Collection Store of CloudFormationResource.json Resource Specification Files
MIT License
29 stars 1 forks source link

cfn-changelogger.py needs fix: "Since" value incorrect #29

Closed ScriptAutomate closed 4 years ago

ScriptAutomate commented 4 years ago

Expected Behavior

cfn-changelogger.py needs to read the previous missing types, from the last changelog json, in order to know what version of the specification file a property has been missing since.

Current Behavior

cfn-changelogger.py generates changelog JSON files that do not properly track what version of the specification file that a type has been missing from us-east-1. Instead, if it was missing in the last version, it uses that version for the Since value. This gives an incorrect snapshot of how long a property / resource type has been missing from the us-east-1 file.

Example

Here is one of the types that first appeared in v8.0.0 of the CFN spec file provided by AWS: AWS::ApiGatewayV2::Api.BodyS3Location

"TypesNotInUSEAST1": {
  "PropertyTypes": {
    "AWS::ApiGatewayV2::Api.BodyS3Location": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-api-bodys3location.html",
      "Fixed": false,
      "Regions": [
        "us-west-1"
      ],
      "Since": "8.0.0"
    }
}

This type is still not present, missing in v8.1.0 and v9.0.0 (the current latest version, as of this issue). It appears as follows:

"TypesNotInUSEAST1": {
  "PropertyTypes": {
    "AWS::ApiGatewayV2::Api.BodyS3Location": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-api-bodys3location.html",
      "Fixed": false,
      "Regions": [
        "us-west-1"
      ],
      "Since": "8.1.0"
    }
}

The Since value should read as 8.0.0 here, but does not. This is because the current code only checks if a type was missing in the previous version, then uses the ResourceSpecificationVersion value of the previous version instead of the previous Since value of that particular type.

ScriptAutomate commented 4 years ago

Fixed in 3101d44