Repository navigation
Conversation
PR aws-cloudformation#4922 closed issue aws-cloudformation#4766 by adding Description to the resource configuration schema, which also made a resource-level Description on an AWS::Serverless::* resource silent instead of W3001. That is correct -- CloudFormation accepts, type-checks and discards the attribute on every resource type, so the discard is not the SAM transform's doing -- but aws-cloudformation#4922 made the change by swapping Description out of the existing tests for other stray keys, so nothing pinned the new behavior. Add a test asserting AWS::Serverless::Function with a string resource-level Description produces neither W3001 nor E3001.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4923 +/- ##
=======================================
Coverage 94.68% 94.68%
=======================================
Files 439 439
Lines 16016 16016
Branches 3111 3111
=======================================
Hits 15165 15165
Misses 468 468
Partials 383 383
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#4922 closed #4766 by adding
Descriptiontoother/resources/configuration.json, which as a side effect also made a resource-levelDescriptionon anAWS::Serverless::*resource silent instead of reporting W3001. That is the right outcome — CloudFormation itself accepts, type-checks and then discards a resource-levelDescriptionon every resource type, so the discard is plain CloudFormation behavior rather than the SAM transform stripping an unsupported key — but #4922 made the change by swappingDescriptionout of six existing tests for other stray keys (Handler/Name/Timeout/Comment), so nothing in the suite pins the new behavior and a future change could reintroduce the warning with the tests still green. This adds one test assertingAWS::Serverless::Functionwith a string resource-levelDescriptionproduces neither W3001 nor E3001. No rule, schema, or message changes.Verified with
python -m pytest test/unit/rules/resources/test_configurations.py(11 passed),python -m pytest test/unit/rules(2082 passed), andpre-commit run --all-files(all hooks pass). Also confirmed the test is load-bearing: removingDescriptionfrom the resource configuration schema brings W3001 back and fails it.