Skip to content

test(W3001): pin that a resource-level Description does not warn - #4923

Merged
kddejong merged 1 commit into
aws-cloudformation:mainfrom
kddejong:test/w3001-resource-level-description
Oct 26, 2026
Merged

kddejong merged 1 commit into
aws-cloudformation:mainfrom
kddejong:test/w3001-resource-level-description

Conversation

@kddejong

Copy link
Copy Markdown
Contributor

#4922 closed #4766 by adding Description to other/resources/configuration.json, which as a side effect also made a resource-level Description on an AWS::Serverless::* resource silent instead of reporting W3001. That is the right outcome — CloudFormation itself accepts, type-checks and then discards a resource-level Description on 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 swapping Description out 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 asserting AWS::Serverless::Function with a string resource-level Description produces 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), and pre-commit run --all-files (all hooks pass). Also confirmed the test is load-bearing: removing Description from the resource configuration schema brings W3001 back and fails it.

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

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.68%. Comparing base (f2e3c87) to head (0c51fd9).
⚠️ Report is 2 commits behind head on main.

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           
Flag Coverage Δ
unittests 94.68% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kddejong
kddejong marked this pull request as ready for review October 26, 2026 17:36
@kddejong
kddejong merged commit b605013 into aws-cloudformation:main Oct 26, 2026
23 of 24 checks passed
@kddejong
kddejong deleted the test/w3001-resource-level-description branch October 26, 2026 17:36
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

Successfully merging this pull request may close these issues.

E3001: resource-level Description is reported as unexpected, but CloudFormation accepts it and aws-cdk-lib emits it

1 participant