mcp-souschef 2.2.0__py3-none-any.whl → 2.5.3__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.2.0.dist-info → mcp_souschef-2.5.3.dist-info}/METADATA +174 -21
- mcp_souschef-2.5.3.dist-info/RECORD +38 -0
- mcp_souschef-2.5.3.dist-info/entry_points.txt +4 -0
- souschef/assessment.py +100 -17
- souschef/ci/__init__.py +11 -0
- souschef/ci/github_actions.py +379 -0
- souschef/ci/gitlab_ci.py +299 -0
- souschef/ci/jenkins_pipeline.py +343 -0
- souschef/cli.py +601 -1
- souschef/core/validation.py +35 -2
- souschef/deployment.py +5 -3
- souschef/filesystem/operations.py +0 -7
- souschef/parsers/__init__.py +6 -1
- souschef/parsers/inspec.py +343 -18
- souschef/parsers/metadata.py +30 -0
- souschef/server.py +394 -141
- souschef/ui/__init__.py +8 -0
- souschef/ui/app.py +1837 -0
- souschef/ui/pages/cookbook_analysis.py +425 -0
- mcp_souschef-2.2.0.dist-info/RECORD +0 -31
- mcp_souschef-2.2.0.dist-info/entry_points.txt +0 -4
- {mcp_souschef-2.2.0.dist-info → mcp_souschef-2.5.3.dist-info}/WHEEL +0 -0
- {mcp_souschef-2.2.0.dist-info → mcp_souschef-2.5.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-souschef
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5.3
|
|
4
4
|
Summary: AI-powered MCP server for Chef to Ansible conversion
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -9,10 +9,15 @@ Requires-Python: >=3.14,<4.0
|
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.14
|
|
12
|
+
Provides-Extra: ui
|
|
12
13
|
Requires-Dist: anthropic (>=0.75.0)
|
|
13
14
|
Requires-Dist: click (>=8.1.0)
|
|
14
15
|
Requires-Dist: mcp (>=1.25.0)
|
|
16
|
+
Requires-Dist: pandas (>=2.0.0) ; extra == "ui"
|
|
17
|
+
Requires-Dist: plotly (>=5.0.0)
|
|
15
18
|
Requires-Dist: python-dotenv (>=1.2.1)
|
|
19
|
+
Requires-Dist: pyyaml (>=6.0.0)
|
|
20
|
+
Requires-Dist: streamlit (>=1.28.0)
|
|
16
21
|
Requires-Dist: zod (>=0.8.0)
|
|
17
22
|
Description-Content-Type: text/markdown
|
|
18
23
|
|
|
@@ -23,7 +28,7 @@ An AI-powered MCP (Model Context Protocol) server that provides comprehensive Ch
|
|
|
23
28
|
[](https://pypi.org/project/mcp-souschef/)
|
|
24
29
|
[](https://www.python.org/downloads/)
|
|
25
30
|
[](https://opensource.org/licenses/MIT)
|
|
26
|
-
[](htmlcov/index.html)
|
|
27
32
|
[](https://github.com/astral-sh/ruff)
|
|
28
33
|
[](http://mypy-lang.org/)
|
|
29
34
|
[](https://sonarcloud.io/summary/new_code?id=kpeacocke_souschef)
|
|
@@ -32,7 +37,17 @@ An AI-powered MCP (Model Context Protocol) server that provides comprehensive Ch
|
|
|
32
37
|
|
|
33
38
|
## Overview - Chef to Ansible features
|
|
34
39
|
|
|
35
|
-
SousChef is a complete enterprise-grade migration platform with
|
|
40
|
+
SousChef is a complete enterprise-grade migration platform with **27 primary MCP tools** organised across **9 major capability areas** to facilitate Chef-to-Ansible AWX/AAP migrations. From cookbook analysis to deployment pattern conversion, including Chef Habitat to containerised deployments and CI/CD pipeline generation, SousChef provides everything needed for a successful infrastructure automation migration.
|
|
41
|
+
|
|
42
|
+
### About Tool Counts
|
|
43
|
+
|
|
44
|
+
**Why 27 tools in the documentation but more in the server?**
|
|
45
|
+
|
|
46
|
+
The MCP server provides **37 total tools** (35 public + 2 internal). This documentation focuses on the **27 primary user-facing tools** that cover the main migration capabilities. The remaining 10 tools are low-level filesystem operations and helper utilities used internally by the main tools.
|
|
47
|
+
|
|
48
|
+
As a user, you'll primarily interact with the 27 documented tools. Your AI assistant may use the additional tools automatically when needed, but you don't need to know about them for successful migrations.
|
|
49
|
+
|
|
50
|
+
> 💡 **For developers:** See `souschef/server.py` for the complete list of all 37 registered tools.
|
|
36
51
|
|
|
37
52
|
## Model Agnostic - Works with Any AI Model
|
|
38
53
|
|
|
@@ -45,10 +60,17 @@ SousChef is a complete enterprise-grade migration platform with 38 MCP tools org
|
|
|
45
60
|
- **Local Models** (Ollama, llama.cpp, etc.)
|
|
46
61
|
- **Custom Enterprise Models**
|
|
47
62
|
|
|
48
|
-
**How it works:** You choose your AI model provider in your MCP client. SousChef provides the Chef/Ansible expertise through
|
|
63
|
+
**How it works:** You choose your AI model provider in your MCP client. SousChef provides the Chef/Ansible expertise through 27 specialized tools. The model calls these tools to help with your migration.
|
|
49
64
|
|
|
50
65
|
> See [config/CONFIGURATION.md](config/CONFIGURATION.md) for configuration examples with different model providers.
|
|
51
66
|
|
|
67
|
+
## Quick Links
|
|
68
|
+
|
|
69
|
+
- **[Terraform Provider](terraform-provider/README.md)** - Manage migrations with infrastructure-as-code
|
|
70
|
+
- **[User Guide](docs/user-guide/)** - Complete documentation
|
|
71
|
+
- **[API Reference](docs/api-reference/)** - Detailed tool documentation
|
|
72
|
+
- **[Migration Guide](docs/migration-guide/)** - Step-by-step migration process
|
|
73
|
+
|
|
52
74
|
## Installation
|
|
53
75
|
|
|
54
76
|
```bash
|
|
@@ -139,7 +161,67 @@ Modern deployment strategies and migration planning:
|
|
|
139
161
|
- **generate_blue_green_deployment_playbook** - Create blue/green deployment playbooks
|
|
140
162
|
- **generate_canary_deployment_strategy** - Generate canary deployment configurations
|
|
141
163
|
|
|
142
|
-
### 10.
|
|
164
|
+
### 10. CI/CD Pipeline Generation
|
|
165
|
+
Generate Jenkins, GitLab CI, and GitHub Actions workflows from Chef cookbook CI patterns:
|
|
166
|
+
|
|
167
|
+
- **generate_jenkinsfile_from_chef** - Generate Jenkinsfile (Declarative or Scripted) from Chef cookbook CI/CD patterns
|
|
168
|
+
- **generate_gitlab_ci_from_chef** - Generate .gitlab-ci.yml from Chef cookbook testing tools
|
|
169
|
+
- **generate_github_workflow_from_chef** - Generate GitHub Actions workflow from Chef cookbook CI/CD patterns
|
|
170
|
+
|
|
171
|
+
Automatically detects and converts:
|
|
172
|
+
- **Test Kitchen** configurations (.kitchen.yml) → Integration test stages
|
|
173
|
+
- **ChefSpec** tests (spec/) → Unit test stages
|
|
174
|
+
- **Cookstyle/Foodcritic** → Lint stages
|
|
175
|
+
- Multiple test suites → Parallel execution strategies
|
|
176
|
+
|
|
177
|
+
#### Example Usage
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Generate Jenkins Declarative pipeline
|
|
181
|
+
souschef generate-jenkinsfile ./mycookbook
|
|
182
|
+
|
|
183
|
+
# Generate Jenkins Scripted pipeline
|
|
184
|
+
souschef generate-jenkinsfile ./mycookbook --pipeline-type scripted
|
|
185
|
+
|
|
186
|
+
# Generate GitLab CI configuration
|
|
187
|
+
souschef generate-gitlab-ci ./mycookbook
|
|
188
|
+
|
|
189
|
+
# Generate GitHub Actions workflow
|
|
190
|
+
souschef generate-github-workflow ./mycookbook
|
|
191
|
+
|
|
192
|
+
# Customize with options
|
|
193
|
+
souschef generate-gitlab-ci ./mycookbook --no-cache --no-artifacts
|
|
194
|
+
souschef generate-github-workflow ./mycookbook --workflow-name "My CI" --no-cache
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**MCP Tool Usage:**
|
|
198
|
+
```python
|
|
199
|
+
# From an AI assistant with SousChef MCP
|
|
200
|
+
|
|
201
|
+
# Generate Jenkins pipeline
|
|
202
|
+
generate_jenkinsfile_from_chef(
|
|
203
|
+
cookbook_path="/path/to/cookbook",
|
|
204
|
+
pipeline_type="declarative", # or "scripted"
|
|
205
|
+
enable_parallel="yes" # or "no"
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
# Generate GitLab CI
|
|
209
|
+
generate_gitlab_ci_from_chef(
|
|
210
|
+
cookbook_path="/path/to/cookbook",
|
|
211
|
+
enable_cache="yes", # or "no"
|
|
212
|
+
enable_artifacts="yes" # or "no"
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
# Generate GitHub Actions workflow
|
|
216
|
+
generate_github_workflow_from_chef(
|
|
217
|
+
cookbook_path="/path/to/cookbook",
|
|
218
|
+
workflow_name="Chef Cookbook CI",
|
|
219
|
+
enable_cache="yes", # or "no"
|
|
220
|
+
enable_artifacts="yes" # or "no"
|
|
221
|
+
)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### 11. Conversion Validation Framework
|
|
143
225
|
Comprehensive validation of Chef-to-Ansible conversions:
|
|
144
226
|
|
|
145
227
|
- **validate_conversion** - Validate conversions across multiple dimensions
|
|
@@ -266,14 +348,61 @@ profile_cookbook_performance /path/to/large_cookbook
|
|
|
266
348
|
profile_parsing_operation recipe /path/to/recipe.rb --detailed
|
|
267
349
|
```
|
|
268
350
|
|
|
269
|
-
|
|
270
|
-
-
|
|
271
|
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
351
|
+
### 10. Visual Migration Planning Interface
|
|
352
|
+
Interactive web-based interface for Chef-to-Ansible migration planning and visualization:
|
|
353
|
+
|
|
354
|
+
- **Cookbook Analysis Dashboard**: Interactive directory scanning with metadata parsing and complexity assessment
|
|
355
|
+
- **Migration Planning Wizard**: Step-by-step migration planning with effort estimation and risk analysis
|
|
356
|
+
- **Dependency Mapping**: Visual dependency graphs showing cookbook relationships and migration ordering
|
|
357
|
+
- **Validation Reports**: Conversion validation results with syntax checking and best practice compliance
|
|
358
|
+
- **Progress Tracking**: Real-time migration progress with completion metrics and bottleneck identification
|
|
359
|
+
|
|
360
|
+
**Launch the UI:**
|
|
361
|
+
```bash
|
|
362
|
+
# Using Poetry (development)
|
|
363
|
+
poetry run souschef ui
|
|
275
364
|
|
|
276
|
-
|
|
365
|
+
# Using pip (installed)
|
|
366
|
+
souschef ui
|
|
367
|
+
|
|
368
|
+
# Custom port
|
|
369
|
+
souschef ui --port 8080
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
**Features:**
|
|
373
|
+
- Clean, professional design matching documentation standards
|
|
374
|
+
- Real-time cookbook analysis with progress indicators
|
|
375
|
+
- **Interactive dependency visualization** with Plotly graphs and NetworkX analysis
|
|
376
|
+
- **Static graph visualization** with matplotlib for reports and documentation
|
|
377
|
+
- **Real-time progress tracking** for all analysis operations
|
|
378
|
+
- Migration planning wizards with effort estimation
|
|
379
|
+
- Validation reporting dashboard with conversion quality metrics
|
|
380
|
+
- Cross-platform compatibility (Linux, macOS, Windows)
|
|
381
|
+
|
|
382
|
+
### Advanced UI Features
|
|
383
|
+
|
|
384
|
+
#### Interactive Dependency Visualization
|
|
385
|
+
The UI includes sophisticated dependency graph visualization powered by NetworkX and Plotly:
|
|
386
|
+
|
|
387
|
+
- **Graph Analysis**: Automatic detection of cookbook dependencies, circular references, and migration ordering
|
|
388
|
+
- **Interactive Exploration**: Zoom, pan, and hover over nodes to explore complex dependency relationships
|
|
389
|
+
- **Color Coding**: Visual distinction between cookbooks, dependencies, community cookbooks, and circular dependencies
|
|
390
|
+
- **Static Export**: Matplotlib-based static graphs for reports and documentation
|
|
391
|
+
- **Large Graph Support**: Optimized layouts for complex cookbook ecosystems
|
|
392
|
+
|
|
393
|
+
#### Real-Time Progress Tracking
|
|
394
|
+
All analysis operations include comprehensive progress feedback:
|
|
395
|
+
|
|
396
|
+
- **Progress Bars**: Visual progress indicators for long-running operations
|
|
397
|
+
- **Status Updates**: Real-time status messages during analysis phases
|
|
398
|
+
- **Operation Tracking**: Separate progress tracking for dependency analysis, validation, and migration planning
|
|
399
|
+
- **Error Handling**: Graceful error display with recovery suggestions
|
|
400
|
+
|
|
401
|
+
#### Enhanced User Experience
|
|
402
|
+
- **Responsive Design**: Clean, professional interface that works across different screen sizes
|
|
403
|
+
- **Export Options**: Download analysis results, graphs, and migration plans
|
|
404
|
+
- **Session Persistence**: Maintain analysis state across page refreshes
|
|
405
|
+
- **Quick Actions**: One-click access to common migration tasks
|
|
277
406
|
|
|
278
407
|
### Migration Assessment & Reporting
|
|
279
408
|
- **Complexity Analysis**: Automated assessment of migration effort and risk factors
|
|
@@ -299,7 +428,7 @@ profile_parsing_operation recipe /path/to/recipe.rb --detailed
|
|
|
299
428
|
### Prerequisites
|
|
300
429
|
- Python 3.14+
|
|
301
430
|
- [Poetry](https://python-poetry.org/) for dependency management
|
|
302
|
-
- MCP-compatible client (Claude Desktop, VS Code with
|
|
431
|
+
- MCP-compatible client (Claude Desktop, VS Code 1.102+ with GitHub Copilot, etc.)
|
|
303
432
|
|
|
304
433
|
### Quick Start
|
|
305
434
|
|
|
@@ -312,9 +441,21 @@ profile_parsing_operation recipe /path/to/recipe.rb --detailed
|
|
|
312
441
|
|
|
313
442
|
Use the pre-configured files in the `config/` directory for quick setup with Claude Desktop, VS Code Copilot, or other MCP clients.
|
|
314
443
|
|
|
444
|
+
**Claude Desktop** (macOS):
|
|
315
445
|
```bash
|
|
316
|
-
# Example: Claude Desktop (macOS)
|
|
317
446
|
cp config/claude-desktop.json ~/Library/Application\ Support/Claude/claude_desktop_config.json
|
|
447
|
+
# Restart Claude Desktop
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**VS Code + GitHub Copilot** (requires VS Code 1.102+):
|
|
451
|
+
```bash
|
|
452
|
+
# macOS/Linux
|
|
453
|
+
cp config/vscode-copilot.json ~/.config/Code/User/mcp.json
|
|
454
|
+
|
|
455
|
+
# Windows
|
|
456
|
+
copy config\vscode-copilot.json %APPDATA%\Code\User\mcp.json
|
|
457
|
+
|
|
458
|
+
# Reload VS Code window, then trust the server when prompted
|
|
318
459
|
```
|
|
319
460
|
|
|
320
461
|
** See [config/CONFIGURATION.md](config/CONFIGURATION.md) for:**
|
|
@@ -358,6 +499,7 @@ souschef-cli inspec-convert controls.rb --format testinfra
|
|
|
358
499
|
- `inspec-parse` - Parse InSpec profiles and controls
|
|
359
500
|
- `inspec-convert` - Convert InSpec to Testinfra/Ansible tests
|
|
360
501
|
- `inspec-generate` - Generate InSpec validation from recipes
|
|
502
|
+
- `ui` - Launch the Visual Migration Planning Interface
|
|
361
503
|
- `ls` / `cat` - File system operations
|
|
362
504
|
|
|
363
505
|
### Development Setup
|
|
@@ -485,16 +627,27 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
485
627
|
- Enhanced error handling with custom exceptions and actionable recovery suggestions
|
|
486
628
|
- Technical debt reduction - ALL PHASES COMPLETE: 16 functions refactored (15 C-grade eliminated, 70+ helpers extracted, average 77% complexity reduction, zero C-grade functions remaining)
|
|
487
629
|
- Performance profiling and optimization for large cookbooks (profiling module, CLI commands, MCP tools)
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
-
|
|
491
|
-
-
|
|
630
|
+
- Code duplication elimination (InSpec functions refactored: 55 duplicate lines removed, improved architecture)
|
|
631
|
+
- Documentation website with MkDocs + Material theme (charcoal + teal colour scheme, 16 pages)
|
|
632
|
+
- Comprehensive documentation content (Getting Started, Tool Reference, Migration Guide, API docs, Examples)
|
|
633
|
+
- Integration with additional test frameworks (ServerSpec, Goss) - InSpec conversion now supports 4 output formats
|
|
634
|
+
- Jenkins/GitLab CI pipeline generation from Chef cookbook CI patterns (Test Kitchen, ChefSpec, Cookstyle)
|
|
635
|
+
- Visual migration planning interface with Streamlit-based web UI for interactive cookbook analysis and migration planning
|
|
636
|
+
- **Interactive dependency mapping and visualization** with Plotly graphs and NetworkX analysis
|
|
637
|
+
- **Real-time progress tracking** for all analysis operations with Streamlit progress bars
|
|
638
|
+
- **Static graph visualization** with matplotlib for reports and documentation
|
|
492
639
|
|
|
493
640
|
### Planned 📅
|
|
494
|
-
- 📅
|
|
495
|
-
- 📅
|
|
641
|
+
- 📅 Enhanced graph layout algorithms for large dependency networks (force-directed, hierarchical)
|
|
642
|
+
- 📅 Export functionality for graphs (PNG, SVG, PDF formats)
|
|
643
|
+
- 📅 UI configuration options and themes
|
|
644
|
+
- 📅 Performance caching for expensive analysis operations
|
|
645
|
+
- 📅 Mobile-responsive design improvements
|
|
646
|
+
- 📅 Accessibility enhancements (ARIA labels, keyboard navigation)
|
|
647
|
+
- 📅 Integration testing for UI components
|
|
648
|
+
- 📅 Advanced filtering and search in dependency graphs
|
|
649
|
+
- 📅 Migration templates and presets
|
|
496
650
|
- 📅 Terraform provider for infrastructure state management
|
|
497
|
-
- 📅 Jenkins/GitLab CI pipeline generation
|
|
498
651
|
|
|
499
652
|
## 🙋♀️ Support & Community
|
|
500
653
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
souschef/__init__.py,sha256=Lkrvi2wu-OMRkdlwzxencm8QzBKc1FpK4y6SWhKqrqI,432
|
|
2
|
+
souschef/assessment.py,sha256=UH9vX9GZYKXrRkavk_Gue1chT2u4Hb8fSd0jtMzwHgk,53933
|
|
3
|
+
souschef/ci/__init__.py,sha256=GHaqDk4auB2kI7_fQtF2FRg5nP-iX6wJchj_uTlXcYg,411
|
|
4
|
+
souschef/ci/github_actions.py,sha256=62bkuD3YCKRCK1wgyo-3l-hASyYsinZB3FOTRqWc7Ag,11215
|
|
5
|
+
souschef/ci/gitlab_ci.py,sha256=jNyeeucg6TXS0l1BJHrPm_cNXe1XJEjWlaOLnQI3eZo,8373
|
|
6
|
+
souschef/ci/jenkins_pipeline.py,sha256=TlwyfirlUx01TnuinFHBSZVFmnxmSEdqln_71f6lWhs,9264
|
|
7
|
+
souschef/cli.py,sha256=DjVPJzzhIbbkf9l4vj68qA4aSBTetlwyiLSZeP3Ctsk,33772
|
|
8
|
+
souschef/converters/__init__.py,sha256=WHBBPH60_rPX1LVieimqIYlVzeV8ttG4Q7N1dMUMBb0,681
|
|
9
|
+
souschef/converters/habitat.py,sha256=4eVGAcX0576zLXW9yqYvuaRxOK2g6BOIJo_ws-PonHU,22516
|
|
10
|
+
souschef/converters/playbook.py,sha256=i8HKxoJPLzw47rsq3pXreYSqte5_lBozgbTdyzMnIwA,57336
|
|
11
|
+
souschef/converters/resource.py,sha256=9cuAeTxVwl7aejFxozW8nQXMvapnT1LKu77duuknZnc,9692
|
|
12
|
+
souschef/core/__init__.py,sha256=80a0G6wQGfh-Z7U1gsFaeC97bM4sp_3YGil-lN02Pl0,1894
|
|
13
|
+
souschef/core/constants.py,sha256=wJBKtDUpGUD02RZUT7RPclITJqkeJKe9ny6_G-qSCOw,4694
|
|
14
|
+
souschef/core/errors.py,sha256=zj_LHDRxUvHmcs-nZjOWu4B_MhY5WVq2okyZOxyycCI,8605
|
|
15
|
+
souschef/core/path_utils.py,sha256=zfhNDQtSgiO8nK_3-uOZuM28rn3AVuRZ81o-D9Mrt1E,1731
|
|
16
|
+
souschef/core/ruby_utils.py,sha256=vUeFZBdjbFFFJlwo4fIboR23rXmbcYL2Tztt4RYhps0,1043
|
|
17
|
+
souschef/core/validation.py,sha256=f37CFiJwPVaC0tN1nKlLFHIAdcZwT2CPNPnj2SHavss,17896
|
|
18
|
+
souschef/deployment.py,sha256=5Ug-GS1bWXHOgPb3pzfdGJb3IZGDMl_LyGxY9vf-pDc,60332
|
|
19
|
+
souschef/filesystem/__init__.py,sha256=2H7Pdeedz0MfmgpRlmii_vx61qr0jtxFndT0APPm6Qs,142
|
|
20
|
+
souschef/filesystem/operations.py,sha256=OMMozBfV_o70b47KioiZ2i6HViiUQPE5mVBeKcKFepo,1654
|
|
21
|
+
souschef/parsers/__init__.py,sha256=gF-vPslzs9iLxsaDzFnWDPpYFDAIwyAifjUwzYurPLg,1104
|
|
22
|
+
souschef/parsers/attributes.py,sha256=JrxBYUOdE1Uu7c7mlqdjmyvZhXvuQ2VFzC19JpVUZ5U,7919
|
|
23
|
+
souschef/parsers/habitat.py,sha256=CtVgLfmpo7SLp-ADyR-DXRYaRUur3bwJjlnpLyocMhc,10483
|
|
24
|
+
souschef/parsers/inspec.py,sha256=zhlIDZmE6A9qws5gnrLxhGGBfHOebNTLWpZZI-XXTkU,34209
|
|
25
|
+
souschef/parsers/metadata.py,sha256=laSxlsebsgTzRDM_B8eIXddeApbR4ATm-W4GAGucZpc,6324
|
|
26
|
+
souschef/parsers/recipe.py,sha256=6PuslWMc0R8HlMaS8FaMKc0FtfuPfH4jVEP29QiCezQ,5941
|
|
27
|
+
souschef/parsers/resource.py,sha256=EHxmojbQ7Hx5GsL5-x9mFBYk3FhGTpx-qw1uUVKQkRo,5348
|
|
28
|
+
souschef/parsers/template.py,sha256=iOHMoQH7KkPzigTyyoxav8rb2ENYmfxgcvKGqvoYkgU,10532
|
|
29
|
+
souschef/profiling.py,sha256=a6Pn57CZR3UPR1YIY8gfbuTPRuPkFrfIFBmctOcaZgY,17315
|
|
30
|
+
souschef/server.py,sha256=J7RidGw-EuqWx7-Qm3e5IeLWaVVgq7KxAZicgJRMqAI,87252
|
|
31
|
+
souschef/ui/__init__.py,sha256=U3W6X4ww7CxQVuetcocObWn5iY6lUFiNX7WoDBJeD34,195
|
|
32
|
+
souschef/ui/app.py,sha256=qOBKFuoZJOzncMWKc4U4u6QdYdgU9i2LV89aLanlWjU,60325
|
|
33
|
+
souschef/ui/pages/cookbook_analysis.py,sha256=VTL2dlH6AaXiSUycrzcqfCmN5xx9bJpsXK5MkrJFOGs,14014
|
|
34
|
+
mcp_souschef-2.5.3.dist-info/METADATA,sha256=wqHtXXN6x9I0QO3r-cq4VeHMcU4pMCpmX1wrui85kHg,50244
|
|
35
|
+
mcp_souschef-2.5.3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
36
|
+
mcp_souschef-2.5.3.dist-info/entry_points.txt,sha256=NVSk61tLG4W0xEkWGOMXAVCIUyodyZCY_j3Z_0m6rkQ,80
|
|
37
|
+
mcp_souschef-2.5.3.dist-info/licenses/LICENSE,sha256=t31dYSuvYYNw6trj-coWSsLK-Tg_Iyl8ObcolQcrUKM,1078
|
|
38
|
+
mcp_souschef-2.5.3.dist-info/RECORD,,
|
souschef/assessment.py
CHANGED
|
@@ -7,6 +7,7 @@ generating migration plans, analyzing dependencies, and validating conversions.
|
|
|
7
7
|
|
|
8
8
|
import json
|
|
9
9
|
import re
|
|
10
|
+
from pathlib import Path
|
|
10
11
|
from typing import Any
|
|
11
12
|
|
|
12
13
|
from souschef.core import METADATA_FILENAME, _normalize_path, _safe_join
|
|
@@ -36,13 +37,76 @@ def assess_chef_migration_complexity(
|
|
|
36
37
|
|
|
37
38
|
"""
|
|
38
39
|
try:
|
|
39
|
-
# Validate inputs
|
|
40
|
+
# Validate and parse inputs
|
|
40
41
|
error_msg = _validate_assessment_inputs(
|
|
41
42
|
cookbook_paths, migration_scope, target_platform
|
|
42
43
|
)
|
|
43
44
|
if error_msg:
|
|
44
45
|
return error_msg
|
|
45
46
|
|
|
47
|
+
# Process cookbook analysis
|
|
48
|
+
return _process_cookbook_assessment(
|
|
49
|
+
cookbook_paths, migration_scope, target_platform
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
except Exception as e:
|
|
53
|
+
return format_error_with_context(
|
|
54
|
+
e, "assessing Chef migration complexity", cookbook_paths
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _process_cookbook_assessment(
|
|
59
|
+
cookbook_paths: str, migration_scope: str, target_platform: str
|
|
60
|
+
) -> str:
|
|
61
|
+
"""Process the cookbook assessment workflow."""
|
|
62
|
+
# Parse cookbook paths (may be empty if none exist)
|
|
63
|
+
valid_paths = _parse_cookbook_paths(cookbook_paths)
|
|
64
|
+
|
|
65
|
+
# Analyze all cookbooks (handles empty list gracefully)
|
|
66
|
+
cookbook_assessments, overall_metrics = _analyze_cookbook_metrics(valid_paths)
|
|
67
|
+
|
|
68
|
+
# Generate recommendations and reports
|
|
69
|
+
recommendations = _generate_migration_recommendations_from_assessment(
|
|
70
|
+
cookbook_assessments, overall_metrics, target_platform
|
|
71
|
+
)
|
|
72
|
+
roadmap = _create_migration_roadmap(cookbook_assessments)
|
|
73
|
+
|
|
74
|
+
# Format final assessment report
|
|
75
|
+
return _format_assessment_report(
|
|
76
|
+
migration_scope,
|
|
77
|
+
target_platform,
|
|
78
|
+
overall_metrics,
|
|
79
|
+
cookbook_assessments,
|
|
80
|
+
recommendations,
|
|
81
|
+
roadmap,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def parse_chef_migration_assessment(
|
|
86
|
+
cookbook_paths: str,
|
|
87
|
+
migration_scope: str = "full",
|
|
88
|
+
target_platform: str = "ansible_awx",
|
|
89
|
+
) -> dict[str, Any]:
|
|
90
|
+
"""
|
|
91
|
+
Parse Chef cookbook migration assessment and return as dictionary.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
cookbook_paths: Comma-separated paths to Chef cookbooks or cookbook directory
|
|
95
|
+
migration_scope: Scope of migration (full, recipes_only, infrastructure_only)
|
|
96
|
+
target_platform: Target platform (ansible_awx, ansible_core, ansible_tower)
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
Dictionary containing assessment data with complexity, recommendations, etc.
|
|
100
|
+
|
|
101
|
+
"""
|
|
102
|
+
try:
|
|
103
|
+
# Validate inputs
|
|
104
|
+
error_msg = _validate_assessment_inputs(
|
|
105
|
+
cookbook_paths, migration_scope, target_platform
|
|
106
|
+
)
|
|
107
|
+
if error_msg:
|
|
108
|
+
return {"error": error_msg}
|
|
109
|
+
|
|
46
110
|
# Parse cookbook paths (may be empty if none exist)
|
|
47
111
|
valid_paths = _parse_cookbook_paths(cookbook_paths)
|
|
48
112
|
|
|
@@ -55,19 +119,35 @@ def assess_chef_migration_complexity(
|
|
|
55
119
|
)
|
|
56
120
|
roadmap = _create_migration_roadmap(cookbook_assessments)
|
|
57
121
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
122
|
+
return {
|
|
123
|
+
"migration_scope": migration_scope,
|
|
124
|
+
"target_platform": target_platform,
|
|
125
|
+
"overall_metrics": overall_metrics,
|
|
126
|
+
"cookbook_assessments": cookbook_assessments,
|
|
127
|
+
"recommendations": recommendations,
|
|
128
|
+
"roadmap": roadmap,
|
|
129
|
+
"complexity": _get_overall_complexity_level(overall_metrics),
|
|
130
|
+
"estimated_hours": overall_metrics.get("estimated_effort_days", 0)
|
|
131
|
+
* 8, # Convert days to hours
|
|
132
|
+
}
|
|
133
|
+
|
|
67
134
|
except Exception as e:
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
|
|
135
|
+
return {
|
|
136
|
+
"error": format_error_with_context(
|
|
137
|
+
e, "assessing Chef migration complexity", cookbook_paths
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def _get_overall_complexity_level(metrics: dict[str, int]) -> str:
|
|
143
|
+
"""Get overall complexity level based on metrics."""
|
|
144
|
+
avg_complexity = metrics.get("avg_complexity", 0)
|
|
145
|
+
if avg_complexity < 30:
|
|
146
|
+
return "Low"
|
|
147
|
+
elif avg_complexity < 70:
|
|
148
|
+
return "Medium"
|
|
149
|
+
else:
|
|
150
|
+
return "High"
|
|
71
151
|
|
|
72
152
|
|
|
73
153
|
def _validate_migration_plan_inputs(
|
|
@@ -654,9 +734,10 @@ def _determine_migration_priority(complexity_score: int) -> str:
|
|
|
654
734
|
return "medium"
|
|
655
735
|
|
|
656
736
|
|
|
657
|
-
def _assess_single_cookbook(cookbook_path) -> dict:
|
|
737
|
+
def _assess_single_cookbook(cookbook_path: Path) -> dict:
|
|
658
738
|
"""Assess complexity of a single cookbook."""
|
|
659
|
-
|
|
739
|
+
# cookbook_path is already normalized to a Path object
|
|
740
|
+
cookbook = cookbook_path
|
|
660
741
|
|
|
661
742
|
# Collect metrics
|
|
662
743
|
artifact_counts = _count_cookbook_artifacts(cookbook)
|
|
@@ -665,7 +746,9 @@ def _assess_single_cookbook(cookbook_path) -> dict:
|
|
|
665
746
|
|
|
666
747
|
# Calculate complexity and effort
|
|
667
748
|
complexity_score = _calculate_complexity_score(metrics)
|
|
668
|
-
|
|
749
|
+
# More realistic effort: 0.5-2 hours per recipe with AI assistance
|
|
750
|
+
# Base: 1 hour per recipe = 0.125 days (8-hour day)
|
|
751
|
+
base_effort = metrics["recipe_count"] * 0.125 # 0.125 days per recipe
|
|
669
752
|
complexity_multiplier = 1 + (complexity_score / 100)
|
|
670
753
|
estimated_effort = round(base_effort * complexity_multiplier, 1)
|
|
671
754
|
|
|
@@ -689,7 +772,7 @@ def _format_overall_metrics(metrics: dict) -> str:
|
|
|
689
772
|
• Total Resources: {metrics["total_resources"]}
|
|
690
773
|
• Average Complexity: {metrics.get("avg_complexity", 0):.1f}/100
|
|
691
774
|
• Estimated Total Effort: {metrics["estimated_effort_days"]:.1f} person-days
|
|
692
|
-
• Estimated Duration: {int(metrics["estimated_effort_days"] /
|
|
775
|
+
• Estimated Duration: {max(1, int(metrics["estimated_effort_days"] / 2))}-{max(2, int(metrics["estimated_effort_days"]))} weeks (with 2-4 parallel engineers)"""
|
|
693
776
|
|
|
694
777
|
|
|
695
778
|
def _format_cookbook_assessments(assessments: list) -> str:
|
souschef/ci/__init__.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""CI/CD pipeline generation from Chef patterns."""
|
|
2
|
+
|
|
3
|
+
from souschef.ci.github_actions import generate_github_workflow_from_chef_ci
|
|
4
|
+
from souschef.ci.gitlab_ci import generate_gitlab_ci_from_chef_ci
|
|
5
|
+
from souschef.ci.jenkins_pipeline import generate_jenkinsfile_from_chef_ci
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"generate_jenkinsfile_from_chef_ci",
|
|
9
|
+
"generate_gitlab_ci_from_chef_ci",
|
|
10
|
+
"generate_github_workflow_from_chef_ci",
|
|
11
|
+
]
|