Skip to content

feat(serverless): validate IgnoreGlobals keys in E3724 - #4615

Open
kddejong wants to merge 1 commit into
aws-cloudformation:mainfrom
kddejong:fix/issue/4610
Open

feat(serverless): validate IgnoreGlobals keys in E3724#4615
kddejong wants to merge 1 commit into
aws-cloudformation:mainfrom
kddejong:fix/issue/4610

Conversation

@kddejong

@kddejong kddejong commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Extends E3724 to validate that each IgnoreGlobals entry names a real property in the matching Globals section for that resource type (e.g. catches IgnoreGlobals: [Timeot]). Previously the silent pop(key, None) merged the global anyway with no warning.

Fixes #4610
Tracking: #4607

Extends rule E3724 to cross-reference IgnoreGlobals list entries against
the property names declared in the matching Globals section for that
resource type. This catches typos like IgnoreGlobals: [Timeot] (should
be Timeout) that would otherwise silently fail to exclude the global,
causing the value to still merge.

Changes:
- Add match() method to GlobalsTransform to validate IgnoreGlobals
- Map resource types to their corresponding Globals section keys
- Report findings at the exact IgnoreGlobals entry path
- Guard against missing/non-dict/intrinsic values
- IgnoreGlobals: "*" remains always valid (ignore all)

Test fixtures:
- bad: ignore_globals_typo.yaml - template with invalid entries
- good: ignore_globals_valid.yaml - template with valid entries

Closes aws-cloudformation#4610
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.38%. Comparing base (f76cd1d) to head (78afd2e).

Files with missing lines Patch % Lines
src/cfnlint/rules/resources/GlobalsTransform.py 76.92% 6 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4615      +/-   ##
==========================================
- Coverage   94.44%   94.38%   -0.07%     
==========================================
  Files         432      432              
  Lines       15214    15264      +50     
  Branches     2929     2945      +16     
==========================================
+ Hits        14369    14407      +38     
- Misses        463      469       +6     
- Partials      382      388       +6     
Flag Coverage Δ
unittests 94.38% <76.92%> (-0.07%) ⬇️

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.

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.

E3724: validate IgnoreGlobals keys against the Globals section

1 participant