mcp-souschef 2.5.3__py3-none-any.whl → 2.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mcp_souschef-2.5.3.dist-info → mcp_souschef-2.8.0.dist-info}/METADATA +56 -21
- mcp_souschef-2.8.0.dist-info/RECORD +42 -0
- souschef/__init__.py +10 -2
- souschef/assessment.py +14 -14
- souschef/ci/github_actions.py +5 -5
- souschef/ci/gitlab_ci.py +4 -4
- souschef/ci/jenkins_pipeline.py +4 -4
- souschef/cli.py +12 -12
- souschef/converters/__init__.py +2 -2
- souschef/converters/cookbook_specific.py +125 -0
- souschef/converters/cookbook_specific.py.backup +109 -0
- souschef/converters/playbook.py +853 -15
- souschef/converters/resource.py +103 -1
- souschef/core/constants.py +13 -0
- souschef/core/path_utils.py +12 -9
- souschef/deployment.py +24 -24
- souschef/parsers/attributes.py +397 -32
- souschef/parsers/recipe.py +48 -10
- souschef/server.py +35 -37
- souschef/ui/app.py +1413 -252
- souschef/ui/health_check.py +36 -0
- souschef/ui/pages/ai_settings.py +497 -0
- souschef/ui/pages/cookbook_analysis.py +1010 -75
- mcp_souschef-2.5.3.dist-info/RECORD +0 -38
- {mcp_souschef-2.5.3.dist-info → mcp_souschef-2.8.0.dist-info}/WHEEL +0 -0
- {mcp_souschef-2.5.3.dist-info → mcp_souschef-2.8.0.dist-info}/entry_points.txt +0 -0
- {mcp_souschef-2.5.3.dist-info → mcp_souschef-2.8.0.dist-info}/licenses/LICENSE +0 -0
souschef/server.py
CHANGED
|
@@ -10,7 +10,7 @@ from mcp.server.fastmcp import FastMCP
|
|
|
10
10
|
|
|
11
11
|
# Import assessment functions with aliases to avoid name conflicts
|
|
12
12
|
from souschef.assessment import (
|
|
13
|
-
|
|
13
|
+
analyse_cookbook_dependencies as _analyse_cookbook_dependencies,
|
|
14
14
|
)
|
|
15
15
|
from souschef.assessment import (
|
|
16
16
|
assess_chef_migration_complexity as _assess_chef_migration_complexity,
|
|
@@ -79,7 +79,7 @@ from souschef.converters.playbook import ( # noqa: F401
|
|
|
79
79
|
|
|
80
80
|
# Import playbook converter functions
|
|
81
81
|
from souschef.converters.playbook import (
|
|
82
|
-
|
|
82
|
+
analyse_chef_search_patterns as _analyse_chef_search_patterns,
|
|
83
83
|
)
|
|
84
84
|
from souschef.converters.playbook import (
|
|
85
85
|
convert_chef_search_to_inventory as _convert_chef_search_to_inventory,
|
|
@@ -139,8 +139,8 @@ from souschef.core.validation import ( # noqa: F401
|
|
|
139
139
|
# Note: MCP tool wrappers exist for some of these, but tests import directly
|
|
140
140
|
# codeql[py/unused-import]: Backward compatibility exports for test suite
|
|
141
141
|
from souschef.deployment import ( # noqa: F401
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
_analyse_cookbook_for_awx,
|
|
143
|
+
_analyse_cookbooks_directory,
|
|
144
144
|
_detect_deployment_patterns_in_recipe,
|
|
145
145
|
_extract_cookbook_attributes,
|
|
146
146
|
_extract_cookbook_dependencies,
|
|
@@ -151,7 +151,7 @@ from souschef.deployment import ( # noqa: F401
|
|
|
151
151
|
_generate_survey_fields_from_attributes,
|
|
152
152
|
_parse_chef_runlist,
|
|
153
153
|
_recommend_ansible_strategies,
|
|
154
|
-
|
|
154
|
+
analyse_chef_application_patterns,
|
|
155
155
|
convert_chef_deployment_to_ansible_strategy,
|
|
156
156
|
generate_awx_inventory_source_from_chef,
|
|
157
157
|
generate_awx_job_template_from_cookbook,
|
|
@@ -163,9 +163,6 @@ from souschef.deployment import ( # noqa: F401
|
|
|
163
163
|
|
|
164
164
|
# Re-exports for backward compatibility (used by tests)
|
|
165
165
|
# These are imported and re-exported intentionally
|
|
166
|
-
from souschef.deployment import (
|
|
167
|
-
analyze_chef_application_patterns as _analyze_chef_application_patterns,
|
|
168
|
-
)
|
|
169
166
|
from souschef.deployment import (
|
|
170
167
|
convert_chef_deployment_to_ansible_strategy as _convert_chef_deployment_to_ansible_strategy,
|
|
171
168
|
)
|
|
@@ -903,9 +900,9 @@ def generate_ansible_vault_from_databags(
|
|
|
903
900
|
|
|
904
901
|
|
|
905
902
|
@mcp.tool()
|
|
906
|
-
def
|
|
903
|
+
def analyse_chef_databag_usage(cookbook_path: str, databags_path: str = "") -> str:
|
|
907
904
|
"""
|
|
908
|
-
|
|
905
|
+
Analyse Chef cookbook for data bag usage and provide migration recommendations.
|
|
909
906
|
|
|
910
907
|
Args:
|
|
911
908
|
cookbook_path: Path to Chef cookbook
|
|
@@ -928,7 +925,7 @@ def analyze_chef_databag_usage(cookbook_path: str, databags_path: str = "") -> s
|
|
|
928
925
|
if databags_path:
|
|
929
926
|
databags = _normalize_path(databags_path)
|
|
930
927
|
if databags.exists():
|
|
931
|
-
databag_structure =
|
|
928
|
+
databag_structure = _analyse_databag_structure(databags)
|
|
932
929
|
|
|
933
930
|
# Generate recommendations
|
|
934
931
|
recommendations = _generate_databag_migration_recommendations(
|
|
@@ -1064,11 +1061,11 @@ def generate_inventory_from_chef_environments(
|
|
|
1064
1061
|
|
|
1065
1062
|
|
|
1066
1063
|
@mcp.tool()
|
|
1067
|
-
def
|
|
1064
|
+
def analyse_chef_environment_usage(
|
|
1068
1065
|
cookbook_path: str, environments_path: str = ""
|
|
1069
1066
|
) -> str:
|
|
1070
1067
|
"""
|
|
1071
|
-
|
|
1068
|
+
Analyse Chef cookbook for environment usage.
|
|
1072
1069
|
|
|
1073
1070
|
Provides migration recommendations.
|
|
1074
1071
|
|
|
@@ -1093,7 +1090,7 @@ def analyze_chef_environment_usage(
|
|
|
1093
1090
|
if environments_path:
|
|
1094
1091
|
environments = _normalize_path(environments_path)
|
|
1095
1092
|
if environments.exists():
|
|
1096
|
-
environment_structure =
|
|
1093
|
+
environment_structure = _analyse_environments_structure(environments)
|
|
1097
1094
|
|
|
1098
1095
|
# Generate recommendations
|
|
1099
1096
|
recommendations = _generate_environment_migration_recommendations(
|
|
@@ -1646,8 +1643,8 @@ def _find_environment_patterns_in_content(content: str, file_path: str) -> list:
|
|
|
1646
1643
|
return patterns
|
|
1647
1644
|
|
|
1648
1645
|
|
|
1649
|
-
def
|
|
1650
|
-
"""
|
|
1646
|
+
def _analyse_environments_structure(environments_path) -> dict:
|
|
1647
|
+
"""Analyse the structure of Chef environments directory."""
|
|
1651
1648
|
structure: dict[str, Any] = {"total_environments": 0, "environments": {}}
|
|
1652
1649
|
|
|
1653
1650
|
for env_file in environments_path.glob("*.rb"):
|
|
@@ -1679,8 +1676,8 @@ def _analyze_environments_structure(environments_path) -> dict:
|
|
|
1679
1676
|
return structure
|
|
1680
1677
|
|
|
1681
1678
|
|
|
1682
|
-
def
|
|
1683
|
-
"""
|
|
1679
|
+
def _analyse_usage_pattern_recommendations(usage_patterns: list) -> list[str]:
|
|
1680
|
+
"""Analyse usage patterns and generate recommendations."""
|
|
1684
1681
|
if not usage_patterns:
|
|
1685
1682
|
return []
|
|
1686
1683
|
|
|
@@ -1711,8 +1708,8 @@ def _analyze_usage_pattern_recommendations(usage_patterns: list) -> list[str]:
|
|
|
1711
1708
|
return recommendations
|
|
1712
1709
|
|
|
1713
1710
|
|
|
1714
|
-
def
|
|
1715
|
-
"""
|
|
1711
|
+
def _analyse_structure_recommendations(env_structure: dict) -> list[str]:
|
|
1712
|
+
"""Analyse environment structure and generate recommendations."""
|
|
1716
1713
|
if not env_structure:
|
|
1717
1714
|
return []
|
|
1718
1715
|
|
|
@@ -1760,8 +1757,8 @@ def _generate_environment_migration_recommendations(
|
|
|
1760
1757
|
) -> str:
|
|
1761
1758
|
"""Generate migration recommendations based on environment usage analysis."""
|
|
1762
1759
|
recommendations = []
|
|
1763
|
-
recommendations.extend(
|
|
1764
|
-
recommendations.extend(
|
|
1760
|
+
recommendations.extend(_analyse_usage_pattern_recommendations(usage_patterns))
|
|
1761
|
+
recommendations.extend(_analyse_structure_recommendations(env_structure))
|
|
1765
1762
|
recommendations.extend(_get_general_migration_recommendations())
|
|
1766
1763
|
|
|
1767
1764
|
return "\n".join(recommendations)
|
|
@@ -2090,8 +2087,8 @@ def _find_databag_patterns_in_content(content: str, file_path: str) -> list:
|
|
|
2090
2087
|
return patterns
|
|
2091
2088
|
|
|
2092
2089
|
|
|
2093
|
-
def
|
|
2094
|
-
"""
|
|
2090
|
+
def _analyse_databag_structure(databags_path) -> dict:
|
|
2091
|
+
"""Analyse the structure of Chef data bags directory."""
|
|
2095
2092
|
structure: dict[str, Any] = {
|
|
2096
2093
|
"total_databags": 0,
|
|
2097
2094
|
"total_items": 0,
|
|
@@ -2135,9 +2132,9 @@ def _analyze_databag_structure(databags_path) -> dict:
|
|
|
2135
2132
|
return structure
|
|
2136
2133
|
|
|
2137
2134
|
|
|
2138
|
-
def
|
|
2135
|
+
def _analyse_usage_patterns(usage_patterns: list) -> list[str]:
|
|
2139
2136
|
"""
|
|
2140
|
-
|
|
2137
|
+
Analyse databag usage patterns and generate recommendations.
|
|
2141
2138
|
|
|
2142
2139
|
Args:
|
|
2143
2140
|
usage_patterns: List of usage pattern dicts
|
|
@@ -2178,9 +2175,9 @@ def _analyze_usage_patterns(usage_patterns: list) -> list[str]:
|
|
|
2178
2175
|
return recommendations
|
|
2179
2176
|
|
|
2180
2177
|
|
|
2181
|
-
def
|
|
2178
|
+
def _analyse_databag_structure_recommendations(databag_structure: dict) -> list[str]:
|
|
2182
2179
|
"""
|
|
2183
|
-
|
|
2180
|
+
Analyse databag structure and generate recommendations.
|
|
2184
2181
|
|
|
2185
2182
|
Args:
|
|
2186
2183
|
databag_structure: Dict with structure analysis
|
|
@@ -2245,11 +2242,11 @@ def _generate_databag_migration_recommendations(
|
|
|
2245
2242
|
recommendations = []
|
|
2246
2243
|
|
|
2247
2244
|
# Analyze usage patterns
|
|
2248
|
-
recommendations.extend(
|
|
2245
|
+
recommendations.extend(_analyse_usage_patterns(usage_patterns))
|
|
2249
2246
|
|
|
2250
2247
|
# Analyze structure
|
|
2251
2248
|
recommendations.extend(
|
|
2252
|
-
|
|
2249
|
+
_analyse_databag_structure_recommendations(databag_structure)
|
|
2253
2250
|
)
|
|
2254
2251
|
|
|
2255
2252
|
# Add variable scope best practices
|
|
@@ -2329,7 +2326,7 @@ mcp.tool()(_generate_awx_inventory_source_from_chef)
|
|
|
2329
2326
|
mcp.tool()(_convert_chef_deployment_to_ansible_strategy)
|
|
2330
2327
|
mcp.tool()(_generate_blue_green_deployment_playbook)
|
|
2331
2328
|
mcp.tool()(_generate_canary_deployment_strategy)
|
|
2332
|
-
mcp.tool()(
|
|
2329
|
+
mcp.tool()(analyse_chef_application_patterns)
|
|
2333
2330
|
|
|
2334
2331
|
|
|
2335
2332
|
# ============================================================================
|
|
@@ -2389,9 +2386,9 @@ def generate_migration_plan(
|
|
|
2389
2386
|
|
|
2390
2387
|
|
|
2391
2388
|
@mcp.tool()
|
|
2392
|
-
def
|
|
2389
|
+
def analyse_cookbook_dependencies(cookbook_paths: str) -> str:
|
|
2393
2390
|
"""
|
|
2394
|
-
|
|
2391
|
+
Analyse dependencies between Chef cookbooks.
|
|
2395
2392
|
|
|
2396
2393
|
Maps cookbook dependencies, identifies circular dependencies, and
|
|
2397
2394
|
recommends migration order.
|
|
@@ -2403,7 +2400,7 @@ def analyze_cookbook_dependencies(cookbook_paths: str) -> str:
|
|
|
2403
2400
|
Dependency analysis report in markdown format.
|
|
2404
2401
|
|
|
2405
2402
|
"""
|
|
2406
|
-
return
|
|
2403
|
+
return _analyse_cookbook_dependencies(cookbook_paths)
|
|
2407
2404
|
|
|
2408
2405
|
|
|
2409
2406
|
@mcp.tool()
|
|
@@ -2559,9 +2556,10 @@ def generate_dynamic_inventory_script(search_queries: str) -> str:
|
|
|
2559
2556
|
return _generate_dynamic_inventory_script(search_queries)
|
|
2560
2557
|
|
|
2561
2558
|
|
|
2562
|
-
|
|
2559
|
+
@mcp.tool()
|
|
2560
|
+
def analyse_chef_search_patterns(recipe_or_cookbook_path: str) -> str:
|
|
2563
2561
|
"""
|
|
2564
|
-
|
|
2562
|
+
Analyse Chef search patterns in recipe or cookbook.
|
|
2565
2563
|
|
|
2566
2564
|
Args:
|
|
2567
2565
|
recipe_or_cookbook_path: Path to recipe or cookbook.
|
|
@@ -2570,7 +2568,7 @@ def analyze_chef_search_patterns(recipe_or_cookbook_path: str) -> str:
|
|
|
2570
2568
|
Analysis of search patterns found.
|
|
2571
2569
|
|
|
2572
2570
|
"""
|
|
2573
|
-
return
|
|
2571
|
+
return _analyse_chef_search_patterns(recipe_or_cookbook_path)
|
|
2574
2572
|
|
|
2575
2573
|
|
|
2576
2574
|
@mcp.tool()
|