From 549958822b248e4f98163e5d734cd2ef5ff4e6a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 28 Nov 2026 00:24:13 +0000 Subject: [PATCH 1/6] Build(deps): Bump the python-minor-patch group across 2 directories with 4 updates Bumps the python-minor-patch group with 4 updates in the /services/converter-api directory: [fastapi](https://github.com/fastapi/fastapi), [pyyaml](https://github.com/yaml/pyyaml), [pydantic](https://github.com/pydantic/pydantic) and [ruff](https://github.com/astral-sh/ruff). Bumps the python-minor-patch group with 2 updates in the /services/web directory: [fastapi](https://github.com/fastapi/fastapi) and [ruff](https://github.com/astral-sh/ruff). Updates `fastapi` from 0.163.2 to 0.165.0 - [Release notes](https://github.com/fastapi/fastapi/releases) - [Commits](https://github.com/fastapi/fastapi/compare/0.163.2...0.165.0) Updates `pyyaml` from 6.0.3 to 6.0.4 - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/6.0.4/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/6.0.3...6.0.4) Updates `pydantic` from 2.14.3 to 2.14.4 - [Release notes](https://github.com/pydantic/pydantic/releases) - [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md) - [Commits](https://github.com/pydantic/pydantic/compare/v2.14.3...v2.14.4) Updates `ruff` from 0.17.5 to 0.17.6 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.17.5...0.17.6) Updates `fastapi` from 0.163.2 to 0.165.0 - [Release notes](https://github.com/fastapi/fastapi/releases) - [Commits](https://github.com/fastapi/fastapi/compare/0.163.2...0.165.0) Updates `ruff` from 0.17.5 to 0.17.6 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.17.5...0.17.6) --- updated-dependencies: - dependency-name: fastapi dependency-version: 0.165.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python-minor-patch - dependency-name: pyyaml dependency-version: 6.0.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: python-minor-patch - dependency-name: pydantic dependency-version: 2.14.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: python-minor-patch - dependency-name: ruff dependency-version: 0.17.6 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-minor-patch - dependency-name: fastapi dependency-version: 0.165.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python-minor-patch - dependency-name: ruff dependency-version: 0.17.6 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-minor-patch ... Signed-off-by: dependabot[bot] --- services/converter-api/requirements-dev.txt | 2 +- services/converter-api/requirements.txt | 6 +++--- services/web/requirements-dev.txt | 2 +- services/web/requirements.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/converter-api/requirements-dev.txt b/services/converter-api/requirements-dev.txt index c907310..d3949e6 100644 --- a/services/converter-api/requirements-dev.txt +++ b/services/converter-api/requirements-dev.txt @@ -2,4 +2,4 @@ pytest==9.2.0 pytest-cov==7.1.0 httpx==0.28.1 -ruff==0.17.5 +ruff==0.17.6 diff --git a/services/converter-api/requirements.txt b/services/converter-api/requirements.txt index 640fec2..8a0a007 100644 --- a/services/converter-api/requirements.txt +++ b/services/converter-api/requirements.txt @@ -1,4 +1,4 @@ -fastapi==0.163.2 +fastapi==0.165.0 uvicorn[standard]==0.54.0 -pyyaml==6.0.3 -pydantic==2.14.3 +pyyaml==6.0.4 +pydantic==2.14.4 diff --git a/services/web/requirements-dev.txt b/services/web/requirements-dev.txt index d163402..bf592dd 100644 --- a/services/web/requirements-dev.txt +++ b/services/web/requirements-dev.txt @@ -1,4 +1,4 @@ -r requirements.txt pytest==9.2.0 pytest-cov==7.1.0 -ruff==0.17.5 +ruff==0.17.6 diff --git a/services/web/requirements.txt b/services/web/requirements.txt index 87fc84e..e251262 100644 --- a/services/web/requirements.txt +++ b/services/web/requirements.txt @@ -1,4 +1,4 @@ -fastapi==0.163.2 +fastapi==0.165.0 uvicorn[standard]==0.54.0 jinja2==3.1.6 httpx==0.28.1 From 284495c6f39b3742285d166e0ed44ab1d489a2f2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 08:43:12 +0000 Subject: [PATCH 2/6] Report libyaml's nesting limit as the nesting error PyYAML 6.0.4 ships a libyaml that stops at 1,000 levels of [ or { while scanning ahead, so deeply nested flow YAML now raises a ScannerError before check_yaml_limits counts past MAX_DEPTH. Turn that error into the same YamlLimitError, so the API and the web page still say the YAML is nested too deeply and how many levels are allowed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NiU6fqjhsX4M1WeyaXZcb1 --- .../converter-api/converters/yaml_safety.py | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/services/converter-api/converters/yaml_safety.py b/services/converter-api/converters/yaml_safety.py index 23c74c1..923d322 100644 --- a/services/converter-api/converters/yaml_safety.py +++ b/services/converter-api/converters/yaml_safety.py @@ -118,25 +118,32 @@ def check_yaml_limits(text: str, max_depth: int = MAX_DEPTH, max_nodes: int = MA Raises yaml.YAMLError for syntax errors, so callers can report them as usual. """ + too_deep = YamlLimitError( + f"The YAML is nested too deeply. Use at most {max_depth} levels of lists and mappings." + ) depth = 0 nodes = 0 - for event in yaml.parse(text, Loader=FAST_LOADER): - if isinstance(event, yaml.NodeEvent): - nodes += 1 - if nodes > max_nodes: - raise YamlLimitError( - f"The YAML is too large: it has more than {max_nodes:,} values. " - "Make it smaller and try again." - ) - if isinstance(event, yaml.CollectionStartEvent): - depth += 1 - if depth > max_depth: - raise YamlLimitError( - f"The YAML is nested too deeply. Use at most {max_depth} levels of lists " - "and mappings." - ) - elif isinstance(event, yaml.CollectionEndEvent): - depth -= 1 + try: + for event in yaml.parse(text, Loader=FAST_LOADER): + if isinstance(event, yaml.NodeEvent): + nodes += 1 + if nodes > max_nodes: + raise YamlLimitError( + f"The YAML is too large: it has more than {max_nodes:,} values. " + "Make it smaller and try again." + ) + if isinstance(event, yaml.CollectionStartEvent): + depth += 1 + if depth > max_depth: + raise too_deep + elif isinstance(event, yaml.CollectionEndEvent): + depth -= 1 + except yaml.scanner.ScannerError as err: + # libyaml from PyYAML 6.0.4 stops at 1,000 levels of [ or { while scanning ahead, + # before the events above reach max_depth. Report it the same way. + if err.problem == "exceeded maximum nesting depth": + raise too_deep from err + raise def check_node_count(data: Any, limit: int = MAX_NODES) -> None: From a0a31104d5211e8d000fea2f153c69398a144261 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 09:55:54 +0000 Subject: [PATCH 3/6] Rewrite the libyaml nesting comment in plain words Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NiU6fqjhsX4M1WeyaXZcb1 --- services/converter-api/converters/yaml_safety.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/converter-api/converters/yaml_safety.py b/services/converter-api/converters/yaml_safety.py index 923d322..d20ec53 100644 --- a/services/converter-api/converters/yaml_safety.py +++ b/services/converter-api/converters/yaml_safety.py @@ -139,8 +139,9 @@ def check_yaml_limits(text: str, max_depth: int = MAX_DEPTH, max_nodes: int = MA elif isinstance(event, yaml.CollectionEndEvent): depth -= 1 except yaml.scanner.ScannerError as err: - # libyaml from PyYAML 6.0.4 stops at 1,000 levels of [ or { while scanning ahead, - # before the events above reach max_depth. Report it the same way. + # From PyYAML 6.0.4, libyaml rejects more than 1,000 nested [ or { with its own + # ScannerError. It reads that far ahead before the loop above sees 100 levels, so + # its error comes first. Give the user our message, not libyaml's. if err.problem == "exceeded maximum nesting depth": raise too_deep from err raise From 184a560983184801807d05fde432c607cf923366 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 09:59:32 +0000 Subject: [PATCH 4/6] Shorten the YAML nesting error Say what the limit is in one line: YAML nested more than 100 levels deep is not supported. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NiU6fqjhsX4M1WeyaXZcb1 --- services/converter-api/converters/yaml_safety.py | 4 +--- services/converter-api/tests/test_api.py | 2 +- services/converter-api/tests/test_cfn_core.py | 2 +- services/converter-api/tests/test_converter.py | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/services/converter-api/converters/yaml_safety.py b/services/converter-api/converters/yaml_safety.py index d20ec53..2bea4c6 100644 --- a/services/converter-api/converters/yaml_safety.py +++ b/services/converter-api/converters/yaml_safety.py @@ -118,9 +118,7 @@ def check_yaml_limits(text: str, max_depth: int = MAX_DEPTH, max_nodes: int = MA Raises yaml.YAMLError for syntax errors, so callers can report them as usual. """ - too_deep = YamlLimitError( - f"The YAML is nested too deeply. Use at most {max_depth} levels of lists and mappings." - ) + too_deep = YamlLimitError(f"YAML nested more than {max_depth} levels deep is not supported.") depth = 0 nodes = 0 try: diff --git a/services/converter-api/tests/test_api.py b/services/converter-api/tests/test_api.py index c85ec9d..98d8367 100644 --- a/services/converter-api/tests/test_api.py +++ b/services/converter-api/tests/test_api.py @@ -99,7 +99,7 @@ def test_deep_nesting_is_not_a_server_error(): assert response.status_code == 200 assert response.json() == { "valid": False, - "error": "The YAML is nested too deeply. Use at most 100 levels of lists and mappings.", + "error": "YAML nested more than 100 levels deep is not supported.", } diff --git a/services/converter-api/tests/test_cfn_core.py b/services/converter-api/tests/test_cfn_core.py index cfd356e..75cc93b 100644 --- a/services/converter-api/tests/test_cfn_core.py +++ b/services/converter-api/tests/test_cfn_core.py @@ -151,7 +151,7 @@ def test_invalid_templates(text, message, line): def test_size_and_depth_limits(): with pytest.raises(CfnError, match="longer than"): load_template("a" * (MAX_TEMPLATE_CHARS + 1)) - with pytest.raises(CfnError, match="too deeply"): + with pytest.raises(CfnError, match="levels deep is not supported"): load_template("Resources: " + "[" * 150 + "]" * 150) with pytest.raises(CfnError, match="too deeply"): load_template('{"Resources": ' + "[" * 150 + "]" * 150 + "}") diff --git a/services/converter-api/tests/test_converter.py b/services/converter-api/tests/test_converter.py index 59d6c52..c87f99e 100644 --- a/services/converter-api/tests/test_converter.py +++ b/services/converter-api/tests/test_converter.py @@ -421,7 +421,7 @@ def test_normal_anchors_and_merge_keys_still_work(): ["[" * 5000 + "]" * 5000, "- " * 5000 + "x", "a:\n" + "- " * 200 + "x"], ) def test_deeply_nested_yaml_rejected(text): - with pytest.raises(ComposeError, match="nested too deeply"): + with pytest.raises(ComposeError, match="more than 100 levels deep is not supported"): parse_compose(text) From aa1193c88aaaea13f6e1ba546f26d873c9b0edc2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 10:10:49 +0000 Subject: [PATCH 5/6] Shorten the libyaml nesting comment Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NiU6fqjhsX4M1WeyaXZcb1 --- services/converter-api/converters/yaml_safety.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/services/converter-api/converters/yaml_safety.py b/services/converter-api/converters/yaml_safety.py index 2bea4c6..df476e3 100644 --- a/services/converter-api/converters/yaml_safety.py +++ b/services/converter-api/converters/yaml_safety.py @@ -137,9 +137,8 @@ def check_yaml_limits(text: str, max_depth: int = MAX_DEPTH, max_nodes: int = MA elif isinstance(event, yaml.CollectionEndEvent): depth -= 1 except yaml.scanner.ScannerError as err: - # From PyYAML 6.0.4, libyaml rejects more than 1,000 nested [ or { with its own - # ScannerError. It reads that far ahead before the loop above sees 100 levels, so - # its error comes first. Give the user our message, not libyaml's. + # PyYAML 6.0.4 stops at 1,000 nested [ or { before this loop counts 100. + # Report that as the same nesting error. if err.problem == "exceeded maximum nesting depth": raise too_deep from err raise From 8e91dc05d95697d6bbc42c731a0c246906d95346 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 10:11:43 +0000 Subject: [PATCH 6/6] Drop the libyaml nesting comment Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NiU6fqjhsX4M1WeyaXZcb1 --- services/converter-api/converters/yaml_safety.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/converter-api/converters/yaml_safety.py b/services/converter-api/converters/yaml_safety.py index df476e3..ef80d48 100644 --- a/services/converter-api/converters/yaml_safety.py +++ b/services/converter-api/converters/yaml_safety.py @@ -137,8 +137,6 @@ def check_yaml_limits(text: str, max_depth: int = MAX_DEPTH, max_nodes: int = MA elif isinstance(event, yaml.CollectionEndEvent): depth -= 1 except yaml.scanner.ScannerError as err: - # PyYAML 6.0.4 stops at 1,000 nested [ or { before this loop counts 100. - # Report that as the same nesting error. if err.problem == "exceeded maximum nesting depth": raise too_deep from err raise