Skip to content

Add Mermaid workflow diagram generation and GitHub integration testing#68

Closed
johnrwatson wants to merge 17 commits into
mainfrom
add-mermaid-workflow-integration
Closed

Add Mermaid workflow diagram generation and GitHub integration testing#68
johnrwatson wants to merge 17 commits into
mainfrom
add-mermaid-workflow-integration

Conversation

@johnrwatson
Copy link
Copy Markdown
Contributor

Summary

  • Add new mermaid/workflow-diagram model for generating visual workflow diagrams
  • Create comprehensive GitHub workflow for integration testing
  • Test artifact passing, dependencies, and cross-model references

What's Added

  • New Mermaid Model: Converts workflow execution data into Mermaid diagram format with color-coded status indicators
  • Integration Test Workflow: End-to-end GitHub workflow that tests shell command dependencies, expression evaluation, and cross-model references
  • Artifact Upload: Automatically uploads generated Mermaid diagrams and workflow execution artifacts

Test Coverage

  • ✅ Shell command execution with dependencies
  • ✅ Artifact passing between workflow steps
  • ✅ Self-references using ${{ self.name }}
  • ✅ Cross-model references using ${{ model.other-model.* }}
  • ✅ Error handling and failure scenarios
  • ✅ Mermaid diagram generation from workflow execution data

Test Plan

The new integration test workflow will:

  1. Compile swamp binary and verify basic functionality
  2. Create 5 models with interdependencies (download → process → summarize → final-report → diagram)
  3. Execute a complex workflow testing all dependency patterns
  4. Generate visual Mermaid diagrams of the workflow execution
  5. Upload all artifacts for inspection
  6. Validate error handling works correctly

🤖 Generated with Claude Code

johnrwatson and others added 17 commits January 30, 2026 17:07
…testing

- Add new mermaid/workflow-diagram model for generating visual workflow diagrams
- Create comprehensive GitHub workflow for integration testing
- Test artifact passing, dependencies, and cross-model references
- Generate Mermaid diagrams from workflow execution data with color-coded status
- Upload workflow artifacts and diagrams to GitHub Actions
- Validate shell command dependencies, expression evaluation, and error handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The existing CI workflow already handles linting and formatting checks.
The integration test workflow should focus on end-to-end functionality testing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Escape swamp expressions to prevent GitHub Actions parser conflicts
- Add descriptive job name for better workflow visibility
- Fix ${{ self.name }} and ${{ model.* }} expression syntax in YAML

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix ZodDefault type error by providing proper default values
- Simplify workflow job name to 'Integration Test'
- Ensure deno check passes without errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The swamp repo init command does not accept a --models-dir option.
Models directory is configured via .swamp.yaml or defaults to extensions/models.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace unreliable grep with jq for JSON parsing
- Fix YAML indentation and structure for model files
- Remove optional resourceId field to avoid validation errors
- Simplify swamp expression syntax in model attributes
- Test locally confirmed model validation passes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove extra spaces in heredoc delimiters
- Fix indentation in workflow YAML structure
- Ensure proper YAML formatting throughout
- Resolve GitHub Actions YAML validation errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create comprehensive workflow validation for all .github/workflows files
- Validate YAML syntax using yq
- Check GitHub Actions workflow structure and required fields
- Detect common workflow issues and security risks
- Validate trigger configurations and events
- Generate detailed validation summary
- Triggers on workflow file changes to catch issues early

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace problematic heredoc syntax with printf statements
- Use quoted heredoc for workflow creation with sed replacement
- Properly escape quotes and special characters in printf
- Ensure GitHub Actions YAML parser compatibility
- Resolve line 57 syntax error and similar issues

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace problematic heredoc workflow creation with printf approach
to avoid YAML parsing conflicts in GitHub Actions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace double quotes with single quotes to prevent GitHub Actions
expression parsing conflicts in grep commands

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace problematic heredoc sections with printf approaches
- Fix GitHub Actions expression parsing conflicts by using variables
- Escape swamp expressions (${{ self.* }} and ${{ model.* }}) properly
- Both workflows now pass actionlint validation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The workflow validation was failing because dependsOn conditions
require both type and ref fields for proper job dependency resolution

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Use model.<name>.input.attributes.<property> instead of
model.<name>.data.attributes.<property> as required by swamp expression validation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Swamp returns success when executing models even if the model's shell
command fails. The failure is captured in the model's exitCode attribute.
Updated test to check model.data.attributes.exitCode instead of expecting
the swamp command itself to fail.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add test-repo/ to .gitignore to prevent local integration test
repositories from being committed

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changed from 'Integration Test' to 'System Test' to better reflect
that this workflow performs comprehensive end-to-end system testing
of the swamp CLI, beyond what's covered by unit tests in CI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
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