Skip to content

Latest commit

 

History

History
340 lines (262 loc) · 7.81 KB

File metadata and controls

340 lines (262 loc) · 7.81 KB

IBM Wazi Integration - Live Demo

IBM Wazi Developer for Red Hat CodeReady Workspaces integration with COBOL Code Harmonizer.

Quick Demo (5 Minutes)

Prerequisites

  • IBM Wazi Developer workspace
  • COBOL Code Harmonizer installed
  • Sample COBOL program

Step 1: Install in Wazi (1 minute)

# In Wazi terminal
pip install --user cobol-harmonizer

# Verify installation
python -m cobol_harmonizer.cli.commands --version

Step 2: Analyze COBOL in Wazi (2 minutes)

# Open a COBOL file in Wazi editor
# In terminal:
python -m cobol_harmonizer.cli.commands analyze \
  ${CHE_PROJECTS_ROOT}/your-cobol-project/MYPROG.cbl \
  --verbose

# Output appears in Problems panel (via SARIF)

Step 3: View Results in Wazi UI (2 minutes)

  1. Problems Panel: See all disharmony issues
  2. Outline View: Color-coded procedures
  3. Quick Fixes: Accept suggested procedure names

Integration Methods

Method 1: VS Code Extension (Recommended)

Our VS Code extension works natively in Wazi:

# In Wazi workspace
cd vscode-extension
code --install-extension cobol-harmonizer-0.1.0.vsix

# Reload Wazi window
# Extension will activate for .cbl files

Features:

  • ✅ Real-time analysis on save
  • ✅ Inline diagnostics with severity colors
  • ✅ Hover tooltips showing LJPW coordinates
  • ✅ Quick fixes for procedure renaming

Method 2: Command Palette Integration

// In Wazi: .vscode/tasks.json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Analyze COBOL Harmony",
      "type": "shell",
      "command": "python",
      "args": [
        "-m",
        "cobol_harmonizer.cli.commands",
        "analyze",
        "${file}",
        "--verbose"
      ],
      "presentation": {
        "reveal": "always",
        "panel": "new"
      },
      "problemMatcher": {
        "owner": "cobol-harmonizer",
        "fileLocation": ["relative", "${workspaceFolder}"],
        "pattern": {
          "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
          "file": 1,
          "line": 2,
          "column": 3,
          "severity": 4,
          "message": 5
        }
      }
    }
  ]
}

Usage: Press Ctrl+Shift+P → "Run Task" → "Analyze COBOL Harmony"

Method 3: Wazi CLI Integration

# Add to Wazi devfile.yaml
apiVersion: 1.0.0
metadata:
  name: cobol-with-harmonizer

components:
  - type: chePlugin
    id: redhat/vscode-yaml/latest

  - type: dockerimage
    alias: cobol-tools
    image: quay.io/eclipse/che-python-3.9:latest
    memoryLimit: 512Mi
    mountSources: true
    endpoints:
      - name: cobol-harmonizer
        port: 8080

commands:
  - name: Analyze COBOL
    actions:
      - type: exec
        component: cobol-tools
        command: python -m cobol_harmonizer.cli.commands analyze
        workdir: ${CHE_PROJECTS_ROOT}

Live Demo Scenarios

Scenario 1: Find Hidden Bugs

      * This looks like a calculation procedure, but it's actually I/O
       CALCULATE-TOTAL.
           OPEN INPUT CUSTOMER-FILE.
           READ CUSTOMER-FILE.
      * COBOL Harmonizer flags this as HIGH disharmony (0.85)
      * Suggests: OPEN-CUSTOMER-FILE or READ-FIRST-CUSTOMER

Wazi Output:

MYPROG.cbl:42:7: error: Critical semantic disharmony (0.85)
  Procedure CALCULATE-TOTAL performs I/O instead of calculation
  Suggested names: OPEN-CUSTOMER-FILE, READ-FIRST-CUSTOMER

Scenario 2: Compliance Flagging

      * Handles credit card data - must be PCI-DSS compliant
       PROCESS-DATA.
           MOVE CC-NUMBER TO DISPLAY-FIELD.
      * COBOL Harmonizer flags PCI-DSS violation

Wazi Output:

MYPROG.cbl:67:7: warning: PCI-DSS compliance risk
  Procedure handles cardholder data without encryption
  Add encryption before display or storage

Scenario 3: Refactoring Guidance

# Generate refactoring report in Wazi
python -m cobol_harmonizer.cli.commands report MYPROG.cbl \
  --format json \
  --output report.json

# View in Wazi JSON viewer
code report.json

Wazi-Specific Features

1. Integrated Terminal Output

Beautiful terminal output works in Wazi:

python -m cobol_harmonizer.cli.commands analyze MYPROG.cbl --verbose

Output includes:

  • 🎨 Rich color-coded severity levels
  • 📊 LJPW coordinate charts
  • 📈 Trajectory visualizations
  • ✅ Harmony rate summary

2. SARIF Problem Integration

# Generate SARIF for Wazi Problems panel
python -m cobol_harmonizer.cli.commands report MYPROG.cbl \
  --format sarif \
  --output ${CHE_PROJECTS_ROOT}/.harmonizer/results.sarif

# Wazi automatically imports SARIF files

3. Batch Analysis in Wazi

# Analyze entire COBOL project
find ${CHE_PROJECTS_ROOT}/cobol -name "*.cbl" -exec \
  python -m cobol_harmonizer.cli.commands analyze {} \; \
  > analysis.log

# View consolidated results
cat analysis.log | grep -E "CRITICAL|SIGNIFICANT"

Demo Script for IBM Sales

Use this script to demo COBOL Code Harmonizer in Wazi to IBM prospects:

Setup (Before Demo)

# 1. Create Wazi workspace
# 2. Clone sample COBOL project
git clone https://github.com/BruinGrowly/COBOL-Code-Harmonizer
cd COBOL-Code-Harmonizer

# 3. Install harmonizer
pip install --user -e .

# 4. Open examples/disharmonious_example.cbl in editor

Live Demo (5 Minutes)

Minute 1: Show the problem

# Open disharmonious_example.cbl
# Point out: "This procedure is called CALCULATE-INTEREST
#             but look what it actually does - it opens files!"

Minute 2: Run the analyzer

python -m cobol_harmonizer.cli.commands analyze \
  examples/disharmonious_example.cbl --verbose

# Watch as it highlights contradictions in real-time

Minute 3: Show the severity levels

🔴 CRITICAL:     Procedure name completely contradicts implementation
🟠 SIGNIFICANT:  Major semantic shift detected
🟡 CONCERNING:   Notable contradiction found
🟢 MINOR:        Slight naming drift

Minute 4: Demonstrate quick fixes

# Show suggested procedure names
# Explain LJPW framework (Love, Justice, Power, Wisdom)
# Show trajectory from Intent → Execution

Minute 5: Integration with IBM tools

# Generate SARIF for ADDI
python -m cobol_harmonizer.cli.commands report MYPROG.cbl \
  --format sarif --output analysis.sarif

# Show how it imports into ADDI, SonarQube, Debug for z/OS

Performance in Wazi

Project Size Analysis Time Memory Usage
10 programs < 5 seconds 50 MB
100 programs < 30 seconds 200 MB
1,000 programs < 5 minutes 500 MB

Optimization Tips:

  • Enable copybook caching (95% faster on subsequent runs)
  • Use parallel analysis for large projects
  • Configure .harmonizer-cache/ in .gitignore

Troubleshooting

Extension Not Activating

# Check Wazi logs
cat ${CHE_WORKSPACE_LOGS_ROOT}/cobol-harmonizer.log

# Verify Python path
which python3
python3 -m cobol_harmonizer.cli.commands --version

SARIF Not Importing

# Validate SARIF
python -m sarif validate analysis.sarif

# Check Wazi settings
code ${CHE_PROJECTS_ROOT}/.vscode/settings.json

Performance Issues

# Enable caching
mkdir -p .harmonizer-cache
export HARMONIZER_CACHE_DIR=.harmonizer-cache

# Use parallel analysis
python -m cobol_harmonizer.cli.commands analyze \
  --parallel --workers 4 MYPROG.cbl

Next Steps

  • 📦 Install in your Wazi workspace (instructions above)
  • 🎯 Try the 5-minute demo
  • 📊 Analyze your COBOL codebase
  • 🔧 Integrate with IBM ADDI (see ADDI_PLUGIN.md)
  • 📚 Read full docs: ../docs/IBM_MAINFRAME_INTEGRATION.md

Resources