Skip to content
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

ENSURE_PROPERTY_TYPE_NOT_CHANGED false negative #31

Open
jlhood opened this issue Jun 30, 2023 · 1 comment
Open

ENSURE_PROPERTY_TYPE_NOT_CHANGED false negative #31

jlhood opened this issue Jun 30, 2023 · 1 comment

Comments

@jlhood
Copy link
Contributor

jlhood commented Jun 30, 2023

Running --stateful check on schema change, I have a situation where a property is going from accepting only type object to accepting type object or string. This seems like it should be considered backwards-compatible, but guard-rail is currently flagging it as a type change.

Repro steps:

  1. Pull current IAM Role schema: aws cloudformation describe-type --type RESOURCE --type-name AWS::IAM::Role | jq -r .Schema > iam-role-schema.json
  2. cp iam-role-schema.json iam-role-schema-modified.json
  3. Manually modify iam-role-schema-modified.json so PolicyDocument property has "type": "object".
  4. Run guard-rail --schema file:///path/to/iam-role-schema-modified.json --schema file:///path/to/iam-role-schema.json --stateful --format

Expected result

  1. Schema passes stateful checks.
  2. Actual result:
[FAILED]:

ENSURE_PROPERTY_TYPE_NOT_CHANGED:
    check-id: TP003
    message: cannot change TYPE of a property
@ammokhov
Copy link
Contributor

ammokhov commented Jul 5, 2023

That is indeed not a breaking change according to CloudFormation definition of a backward compatibility. However, CDK team insisted on having this marked as a breaking change

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

No branches or pull requests

2 participants