Skip to content

Avoid maxProperties warnings for single-property schemas - #4686

Merged
kddejong merged 1 commit into
aws-cloudformation:mainfrom
0xTaoZ:agent/fix-transformerconfig-i3010
Sep 9, 2026
Merged

kddejong merged 1 commit into
aws-cloudformation:mainfrom
0xTaoZ:agent/fix-transformerconfig-i3010

Conversation

@0xTaoZ

@0xTaoZ 0xTaoZ commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

What

Suppress the I3010 approaching-limit child rule when a schema has maxProperties: 1.

Why

A schema with a one-property maximum has no useful "approaching the limit" state: any valid one-property object is already at 100% of the limit. That causes noisy I3010 matches for one-of style schemas such as AWS::Logs::Transformer processors, where each processor object intentionally has exactly one key.

The real E3010 overflow behavior is unchanged: objects with more than the allowed number of properties still fail before this guard.

Fixes #4684.

Validation

  • .venv/bin/python -m pytest test/unit/rules/jsonschema/test_max_properties.py -q
  • .venv/bin/python -m pytest test/unit/rules/jsonschema -q
  • .venv/bin/ruff check src/cfnlint/rules/jsonschema/MaxProperties.py test/unit/rules/jsonschema/test_max_properties.py
  • .venv/bin/ruff format --check src/cfnlint/rules/jsonschema/MaxProperties.py test/unit/rules/jsonschema/test_max_properties.py
  • git diff --check

Note: I attempted a CLI smoke test with the issue's AWS::Logs::Transformer template, but my local schema cache did not include that resource and enhanced schema refresh failed on local SSL certificate verification. The focused jsonschema tests cover the rule path directly.

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.63%. Comparing base (00c36e3) to head (48d980f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4686      +/-   ##
==========================================
- Coverage   94.64%   94.63%   -0.02%     
==========================================
  Files         433      433              
  Lines       15512    15514       +2     
  Branches     3011     3012       +1     
==========================================
  Hits        14682    14682              
- Misses        453      454       +1     
- Partials      377      378       +1     
Flag Coverage Δ
unittests 94.63% <100.00%> (-0.02%) ⬇️

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 merged commit 73c89e1 into aws-cloudformation:main Sep 9, 2026
21 checks passed
@0xTaoZ
0xTaoZ deleted the agent/fix-transformerconfig-i3010 branch September 29, 2026 12:17
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.

I3010 False Positive for AWS::Logs::Transformer Properties.TransformerConfig

2 participants