Skip to content

Cap resolve_value permutations to prevent exponential blowup#4394

Merged
kddejong merged 1 commit intoaws-cloudformation:mainfrom
kddejong:fix/node-level-resolve-caching
Mar 23, 2026
Merged

Cap resolve_value permutations to prevent exponential blowup#4394
kddejong merged 1 commit intoaws-cloudformation:mainfrom
kddejong:fix/node-level-resolve-caching

Conversation

@kddejong
Copy link
Copy Markdown
Contributor

When deeply nested functions (Fn::If, Fn::Select, etc.) are resolved against schemas with value constraints, the number of condition permutations can grow exponentially. Cap at 512 yields per resolve_value call as a safety valve — best effort validation beyond that point.

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4394      +/-   ##
==========================================
- Coverage   93.54%   93.44%   -0.10%     
==========================================
  Files         418      422       +4     
  Lines       14145    14319     +174     
  Branches     2817     2858      +41     
==========================================
+ Hits        13232    13381     +149     
- 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.

When deeply nested functions (Fn::If, Fn::Select, etc.) are resolved
against schemas with value constraints, the number of condition
permutations can grow exponentially. Cap at 512 yields per
resolve_value call as a safety valve — best effort validation
beyond that point.
@kddejong kddejong force-pushed the fix/node-level-resolve-caching branch from 5afc88d to 76c7330 Compare March 20, 2026 20:58
@kddejong kddejong merged commit bb96eb3 into aws-cloudformation:main Mar 23, 2026
18 checks passed
@kddejong kddejong deleted the fix/node-level-resolve-caching branch March 23, 2026 18:22
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.

1 participant