feat(serverless): validate IgnoreGlobals keys in E3724 - #4615
Open
kddejong wants to merge 1 commit into
Open
Conversation
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 Report❌ Patch coverage is
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
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.
Extends E3724 to validate that each
IgnoreGlobalsentry names a real property in the matchingGlobalssection for that resource type (e.g. catchesIgnoreGlobals: [Timeot]). Previously the silentpop(key, None)merged the global anyway with no warning.Fixes #4610
Tracking: #4607