Skip to content

Fix E3677 false positive when Code is a string (aws-cli pattern)#4399

Merged
kddejong merged 1 commit intoaws-cloudformation:mainfrom
kddejong:fix/issue/4397
Mar 23, 2026
Merged

Fix E3677 false positive when Code is a string (aws-cli pattern)#4399
kddejong merged 1 commit intoaws-cloudformation:mainfrom
kddejong:fix/issue/4397

Conversation

@kddejong
Copy link
Copy Markdown
Contributor

E3012 has an exception for TEMPLATED_PROPERTY_CFN_PATHS that allows Code to be a string for aws-cli deployment patterns. This exception leaked into CfnLintJsonSchema if/then evaluation, causing the ZipFile runtime check to incorrectly fire.

Reset the type validator to base cfn_type in CfnLintJsonSchema to prevent E3012 exceptions from affecting schema-based rule evaluation.

Fixes #4397

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

E3012 has an exception for TEMPLATED_PROPERTY_CFN_PATHS that allows
Code to be a string for aws-cli deployment patterns. This exception
leaked into CfnLintJsonSchema if/then evaluation, causing the ZipFile
runtime check to incorrectly fire.

Reset the type validator to base cfn_type in CfnLintJsonSchema to
prevent E3012 exceptions from affecting schema-based rule evaluation.

Fixes aws-cloudformation#4397
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.44%. Comparing base (0bbabc9) to head (1999118).
⚠️ Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4399      +/-   ##
==========================================
- Coverage   93.54%   93.44%   -0.10%     
==========================================
  Files         418      422       +4     
  Lines       14145    14318     +173     
  Branches     2817     2858      +41     
==========================================
+ Hits        13232    13380     +148     
- Misses        567      581      +14     
- Partials      346      357      +11     
Flag Coverage Δ
unittests 93.44% <100.00%> (-0.09%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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 merged commit 4aafe3a into aws-cloudformation:main Mar 23, 2026
18 checks passed
@kddejong kddejong deleted the fix/issue/4397 branch March 23, 2026 18:07
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.

E3677 'java25' does not match '^(nodejs.*|python.*)$'

1 participant