metabase-api-rs 0.1.0-beta.3

A simplified Rust client for the Metabase API (Beta release - feature complete)
Documentation
# Taskfile.yml - metabase-api-rs
# https://taskfile.dev

version: '3'

vars:
  PROJECT_NAME: metabase-api-rs
  RUST_LOG: info
  CARGO_TERM_COLOR: always

env:
  RUST_BACKTRACE: 1

tasks:
  # ========== Primary Commands ==========
  
  default:
    desc: Show available tasks
    cmds:
      - task --list

  dev:
    desc: Development cycle (fmt → build → test)
    cmds:
      - task: fmt
      - task: build
      - task: test:unit

  check:
    desc: Run all checks (fmt, lint, test, audit)
    cmds:
      - task: fmt:check
      - task: lint
      - task: test
      - task: audit
      - echo "✅ All checks passed!"

  check:full:
    desc: Full check with integration tests and feature validation
    cmds:
      - task: check
      - task: test:features
      - task: integration:run
      - echo "✅ Full check complete with all features validated!"

  check:commit:
    desc: Pre-commit validation (format, lint, tests, features)
    cmds:
      - task: fmt:check
      - task: lint
      - task: test:features
      - echo "✅ Pre-commit checks passed!"

  watch:
    desc: Watch for changes and run tests
    cmds:
      - cargo watch -x test

  # ========== Build ==========
  
  build:
    desc: Build project
    cmds:
      - cargo build

  build:release:
    desc: Build for release
    cmds:
      - cargo build --release

  clean:
    desc: Clean artifacts
    cmds:
      - cargo clean

  # ========== Code Quality ==========
  
  fmt:
    desc: Format code
    cmds:
      - cargo fmt --all

  fmt:check:
    desc: Check formatting
    cmds:
      - cargo fmt --all -- --check

  lint:
    desc: Run clippy
    cmds:
      - cargo clippy -- -D warnings

  lint:fix:
    desc: Fix clippy issues
    cmds:
      - cargo clippy --fix --allow-dirty --allow-staged

  audit:
    desc: Security check
    cmds:
      - cargo audit

  # ========== Testing ==========
  
  test:
    desc: Run all tests
    cmds:
      - cargo test

  test:unit:
    desc: Unit tests only
    cmds:
      - cargo test --lib

  test:single:
    desc: "Run single test (usage: task test:single -- test_name)"
    cmds:
      - cargo test {{.CLI_ARGS}}

  test:features:
    desc: Test all feature combinations
    cmds:
      - echo "🧪 Testing all feature combinations..."
      - echo "1/6 Default features"
      - cargo test --no-default-features
      - echo "2/6 Cache feature"
      - cargo test --features cache
      - echo "3/6 Performance feature" 
      - cargo test --features performance
      - echo "4/6 Query-builder feature"
      - cargo test --features query-builder
      - echo "5/6 All features"
      - cargo test --all-features
      - echo "6/6 Benchmark compilation check"
      - cargo bench --no-run
      - echo "✅ All feature combinations tested successfully!"

  test:comprehensive:
    desc: Comprehensive testing with all combinations
    cmds:
      - task: test:features
      - echo "✅ Comprehensive testing completed!"

  coverage:
    desc: Generate coverage report
    cmds:
      - cargo tarpaulin --out Html --output-dir target/coverage

  # ========== Integration Testing ==========
  
  integration:run:
    desc: Run E2E tests with Docker Metabase instance
    cmds:
      - ./scripts/cleanup-docker.sh
      - ./scripts/setup-integration-env.sh
      - RUN_E2E_TESTS=true cargo test --test e2e_tests -- --nocapture
      - ./scripts/cleanup-docker.sh

  integration:quick:
    desc: Run E2E tests (assumes Docker is running)
    cmds:
      - RUN_E2E_TESTS=true cargo test --test e2e_tests -- --nocapture

  # ========== TDD Workflow ==========
  
  tdd:red:
    desc: TDD Red phase
    cmds:
      - cargo test {{.CLI_ARGS}} || true
      - echo "❌ Tests failing as expected"

  tdd:green:
    desc: TDD Green phase
    cmds:
      - cargo test {{.CLI_ARGS}}
      - echo "✅ Tests passing!"

  tdd:refactor:
    desc: TDD Refactor phase
    cmds:
      - task: fmt
      - task: lint:fix
      - cargo test {{.CLI_ARGS}}
      - echo "✅ Refactoring complete!"

  # ========== Documentation ==========
  
  doc:
    desc: Generate docs
    cmds:
      - cargo doc --no-deps --open

  # ========== Utilities ==========
  
  deps:
    desc: Show dependencies
    cmds:
      - cargo tree

  update:
    desc: Update dependencies
    cmds:
      - cargo update

  # ========== Project Management ==========
  
  status:
    desc: Project status
    cmds:
      - 'cargo check 2>/dev/null && echo "✅ Build: OK" || echo "❌ Build: Failed"'
      - 'cargo fmt --check 2>/dev/null && echo "✅ Format: OK" || echo "❌ Format: Needs formatting"'
      - 'cargo clippy 2>/dev/null && echo "✅ Lint: OK" || echo "❌ Lint: Has warnings"'
      - 'cargo test 2>/dev/null && echo "✅ Tests: Passing" || echo "❌ Tests: Failing"'

  ci:
    desc: CI simulation
    cmds:
      - task: clean
      - task: build
      - task: check
      - echo "✅ CI passed!"

  # ========== Docker Helpers ==========
  
  docker:up:
    desc: Start Docker services
    cmds:
      - ./scripts/cleanup-docker.sh
      - ./scripts/setup-integration-env.sh

  docker:down:
    desc: Stop Docker services
    cmds:
      - ./scripts/cleanup-docker.sh

  docker:logs:
    desc: Show Docker logs
    cmds:
      - docker-compose logs -f

  docker:clean:
    desc: Complete Docker cleanup (removes all containers, volumes, networks)
    cmds:
      - ./scripts/cleanup-docker.sh

  # ========== Benchmark Tests ==========

  bench:
    desc: Run all benchmark tests
    cmds:
      - echo "🚀 Running all benchmarks..."
      - cargo bench
      - echo "✅ All benchmarks completed!"

  bench:quick:
    desc: Run all benchmarks in quick mode
    cmds:
      - echo "🚀 Running all benchmarks (quick mode)..."
      - cargo bench -- --quick
      - echo "✅ Quick benchmarks completed!"

  bench:performance:
    desc: Run performance benchmarks
    cmds:
      - echo "🚀 Running performance benchmarks..."
      - cargo bench --bench performance
      - echo "✅ Performance benchmarks completed!"

  bench:api:
    desc: Run API endpoint benchmarks
    cmds:
      - echo "🚀 Running API endpoint benchmarks..."
      - cargo bench --bench api_endpoint_benchmarks
      - echo "✅ API endpoint benchmarks completed!"

  bench:load:
    desc: Run load testing benchmarks
    cmds:
      - echo "🚀 Running load testing benchmarks..."
      - cargo bench --bench load_testing
      - echo "✅ Load testing benchmarks completed!"

  bench:report:
    desc: Open benchmark report in browser
    cmds:
      - echo "📊 Opening benchmark report..."
      - open target/criterion/report/index.html || echo "Report not found. Run 'task bench' first."