Skip to content

๐Ÿค Contributing to Sloth Runner

Thank you for your interest in contributing to Sloth Runner!

We welcome contributions from developers of all skill levels. Whether you're fixing bugs, adding features, improving documentation, or creating plugins, your help makes Sloth Runner better for everyone.

๐Ÿš€ Quick Start

Prerequisites

  • Go 1.21+ for core development
  • Node.js 18+ for UI development
  • Lua 5.4+ for DSL development
  • Git for version control

Development Setup

# Clone the repository
git clone https://github.com/chalkan3-sloth/sloth-runner.git
cd sloth-runner

# Install dependencies
go mod download
npm install  # for UI components

# Run tests
make test

# Build the project
make build

๐Ÿ“‹ Ways to Contribute

๐Ÿ› Bug Reports

Found a bug? Please help us fix it:

  1. Search existing issues to avoid duplicates
  2. Use our bug report template with:
  3. Sloth Runner version
  4. Operating system
  5. Steps to reproduce
  6. Expected vs actual behavior
  7. Error logs (if any)

๐Ÿ’ก Feature Requests

Have an idea for improvement?

  1. Check the roadmap for planned features
  2. Open a feature request with:
  3. Clear description of the feature
  4. Use cases and benefits
  5. Possible implementation approach

๐Ÿ”ง Code Contributions

Ready to code? Here's how:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes following our coding standards
  4. Add tests for new functionality
  5. Update documentation if needed
  6. Commit with clear messages
  7. Push and create a Pull Request

๐Ÿ“š Documentation

Help improve our docs:

  • Fix typos and unclear explanations
  • Add examples and tutorials
  • Translate content to other languages
  • Update API documentation

๐Ÿ”Œ Plugin Development

Create plugins for the community:

๐Ÿ“ Development Guidelines

Code Style

Go Code

Follow standard Go conventions:

// Good: Clear function names and comments
func ProcessWorkflowTasks(ctx context.Context, workflow *Workflow) error {
    if workflow == nil {
        return fmt.Errorf("workflow cannot be nil")
    }

    for _, task := range workflow.Tasks {
        if err := processTask(ctx, task); err != nil {
            return fmt.Errorf("failed to process task %s: %w", task.ID, err)
        }
    }

    return nil
}

Lua DSL

Keep DSL code clean and readable:

-- Good: Clear task definition with proper chaining
local deploy_task = task("deploy_application")
    :description("Deploy the application to production")
    :command(function(params, deps)
        local result = exec.run("kubectl apply -f deployment.yaml")
        if not result.success then
            log.error("Deployment failed: " .. result.stderr)
            return false
        end
        return true
    end)
    :timeout(300)
    :retries(3)
    :build()

TypeScript/JavaScript

For UI components:

// Good: Proper typing and error handling
interface TaskResult {
  id: string;
  status: 'success' | 'failed' | 'running';
  duration: number;
}

export const TaskStatusCard: React.FC<{ result: TaskResult }> = ({ result }) => {
  const statusColor = result.status === 'success' ? 'green' : 
                     result.status === 'failed' ? 'red' : 'blue';

  return (
    <div className={`task-card status-${result.status}`}>
      <h3>{result.id}</h3>
      <span style={{ color: statusColor }}>{result.status}</span>
      <small>{result.duration}ms</small>
    </div>
  );
};

Testing Standards

Unit Tests

Write tests for all new functionality:

func TestProcessWorkflowTasks(t *testing.T) {
    tests := []struct {
        name     string
        workflow *Workflow
        wantErr  bool
    }{
        {
            name:     "nil workflow should return error",
            workflow: nil,
            wantErr:  true,
        },
        {
            name: "valid workflow should process successfully",
            workflow: &Workflow{
                Tasks: []*Task{{ID: "test-task"}},
            },
            wantErr: false,
        },
    }

    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            err := ProcessWorkflowTasks(context.Background(), tt.workflow)
            if (err != nil) != tt.wantErr {
                t.Errorf("ProcessWorkflowTasks() error = %v, wantErr %v", err, tt.wantErr)
            }
        })
    }
}

Integration Tests

Test real-world scenarios:

# Run integration tests
make test-integration

# Test with different configurations
make test-configs

Documentation Standards

  • Keep it simple - Use clear, concise language
  • Include examples - Show don't just tell
  • Update with changes - Keep docs in sync with code
  • Test examples - Ensure all code examples work

๐Ÿ”„ Pull Request Process

Before Submitting

  • Run tests - make test
  • Run linting - make lint
  • Update docs - If adding/changing features
  • Add changelog entry - In CHANGELOG.md
  • Check compatibility - With existing features

PR Template

Use our pull request template:

## Description
Brief description of changes

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update

## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests pass
- [ ] Manual testing completed

## Checklist
- [ ] Code follows style guidelines
- [ ] Documentation updated
- [ ] Changelog updated

Review Process

  1. Automated checks run on all PRs
  2. Maintainer review for code quality and design
  3. Community feedback welcomed on all PRs
  4. Approval and merge by maintainers

๐Ÿ—๏ธ Project Structure

Understanding the codebase:

sloth-runner/
โ”œโ”€โ”€ cmd/                    # CLI commands
โ”œโ”€โ”€ internal/              # Internal packages
โ”‚   โ”œโ”€โ”€ core/             # Core business logic
โ”‚   โ”œโ”€โ”€ dsl/              # DSL implementation
โ”‚   โ”œโ”€โ”€ execution/        # Task execution engine
โ”‚   โ””โ”€โ”€ plugins/          # Plugin system
โ”œโ”€โ”€ pkg/                   # Public packages
โ”œโ”€โ”€ plugins/              # Built-in plugins
โ”œโ”€โ”€ docs/                 # Documentation
โ”œโ”€โ”€ web/                  # Web UI components
โ””โ”€โ”€ examples/             # Example workflows

๐ŸŽฏ Contribution Areas

High Priority

  • ๐Ÿ› Bug fixes - Always welcome
  • ๐Ÿ“ˆ Performance improvements - Optimization opportunities
  • ๐Ÿงช Test coverage - Increase test coverage
  • ๐Ÿ“š Documentation - Keep docs comprehensive

Medium Priority

  • โœจ New features - Following roadmap priorities
  • ๐Ÿ”Œ Plugin ecosystem - More plugins and integrations
  • ๐ŸŽจ UI improvements - Better user experience

Future Areas

  • ๐Ÿค– AI enhancements - Advanced ML capabilities
  • โ˜๏ธ Cloud integrations - More cloud provider support
  • ๐Ÿ“Š Analytics - Better insights and reporting

๐Ÿ† Recognition

Contributors are recognized in:

  • CONTRIBUTORS.md - All contributors listed
  • Release notes - Major contributions highlighted
  • Community showcase - Featured contributions
  • Contributor badges - GitHub profile recognition

๐Ÿ“ž Getting Help

Development Questions

  • ๐Ÿ’ฌ Discord - #development channel
  • ๐Ÿ“ง Mailing List - dev@sloth-runner.io
  • ๐Ÿ“– Wiki - Development guides and FAQs

Mentorship

New to open source? We offer mentorship:

  • ๐Ÿ‘ฅ Mentor matching - Paired with experienced contributors
  • ๐Ÿ“š Learning resources - Curated learning materials
  • ๐ŸŽฏ Guided contributions - Starter-friendly issues

๐Ÿ“œ Code of Conduct

We are committed to providing a welcoming and inclusive environment. Please read our Code of Conduct.

Our Standards

  • ๐Ÿค Be respectful - Treat everyone with respect
  • ๐Ÿ’ก Be constructive - Provide helpful feedback
  • ๐ŸŒ Be inclusive - Welcome diverse perspectives
  • ๐Ÿ“š Be patient - Help others learn and grow

๐Ÿš€ Release Process

Understanding our releases:

  • ๐Ÿ”„ Continuous Integration - Automated testing and building
  • ๐Ÿ“… Regular Releases - Monthly feature releases
  • ๐Ÿšจ Hotfixes - Critical bugs fixed immediately
  • ๐Ÿ“Š Semantic Versioning - Clear version numbering

๐Ÿ“ˆ Roadmap Participation

Help shape the future:

  • ๐Ÿ“‹ Feature Planning - Participate in roadmap discussions
  • ๐Ÿ—ณ๏ธ Voting - Vote on feature priorities
  • ๐Ÿ’ญ RFC Process - Propose major changes through RFCs

Ready to contribute?

Start by exploring our Good First Issues or join our Discord community to introduce yourself!

Thank you for helping make Sloth Runner better! ๐Ÿฆฅโœจ