-
Notifications
You must be signed in to change notification settings - Fork 598
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
extending CIDR validation to more types #1058
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1058 +/- ##
==========================================
- Coverage 86.91% 86.91% -0.01%
==========================================
Files 134 134
Lines 7934 7930 -4
Branches 1950 1952 +2
==========================================
- Hits 6896 6892 -4
Misses 641 641
Partials 397 397
Continue to review full report at Codecov.
|
@kddejong @fatbasstard should I raise the number of expected failures in the tests? The output difference from linting with these changes looks expected to me
|
@PatMyron yea just increase the numbers if the errors are expected as a result of your changes |
@kddejong I tested adding
I've forced the tests to pass because the output difference from linting those templates makes sense to me, but I am confused by the above and why the expected number of failures for vpc-management.json had to be increased by 4. |
#1000
grep'd the CloudFormationResourceSpecification to find unique CIDR strings to investigate adding
Added property type for existing CIDR string:
AWS::MediaLive::InputSecurityGroup.InputWhitelistRuleCidr
Added CIDR strings:
ClientCidrBlock
: AWS::EC2::ClientVpnEndpointDestinationCidrBlock
:AWS::EC2::Route
AWS::EC2::VPNConnectionRoute
AWS::EC2::TransitGatewayRoute
AWS::EC2::ClientVpnRoute
TargetNetworkCidr
: AWS::EC2::ClientVpnAuthorizationRuleTunnelInsideCidr
: AWS::EC2::VPNConnection.VpnTunnelOptionsSpecificationI wasn't sure if REGEX_CIDR supported IPv6 CIDR blocks, so I refrained from adding any of those strings for now
Correcting tags in one file should be the only difference between the diffs of the two files:
https://github.com/aws-cloudformation/cfn-python-lint/blob/df74703d78c371d08010f2d73279b6e45ffde0e5/src/cfnlint/rules/parameters/Cidr.py#L30
AssertionError: Expected 27 failures, got 28 on test/fixtures/templates/quickstart/nist_vpc_management.yaml
https://github.com/aws-cloudformation/cfn-python-lint/blob/5fb676c6039e00bbe3e9096bbbf8dac62e6f64ba/test/fixtures/templates/quickstart/nist_vpc_management.yaml#L267-L270
https://github.com/aws-cloudformation/cfn-python-lint/blob/5fb676c6039e00bbe3e9096bbbf8dac62e6f64ba/test/fixtures/templates/quickstart/nist_vpc_management.yaml#L628-L629
AssertionError: Expected 31 failures, got 35 on test/fixtures/templates/quickstart/vpc-management.json
https://github.com/aws-cloudformation/cfn-python-lint/blob/5fb676c6039e00bbe3e9096bbbf8dac62e6f64ba/test/fixtures/templates/quickstart/vpc-management.json#L65-L69
https://github.com/aws-cloudformation/cfn-python-lint/blob/5fb676c6039e00bbe3e9096bbbf8dac62e6f64ba/test/fixtures/templates/quickstart/vpc-management.json#L865-L867
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.