church-api/.serena/memories/task_completion_workflow.md
Benjamin Slingo 0c06e159bb Initial commit: Church API Rust implementation
Complete church management system with bulletin management, media processing, live streaming integration, and web interface. Includes authentication, email notifications, database migrations, and comprehensive test suite.
2025-08-19 20:56:41 -04:00

2.5 KiB

Task Completion Workflow

When a coding task is completed, follow these steps:

1. Code Quality Checks

# Format the code
cargo fmt

# Run linter
cargo clippy

# Check for compilation errors
cargo check

2. Build & Test

# Build the project
cargo build

# Run tests
cargo test

# Run specific tests if relevant
cargo test module_name -- --nocapture

3. Media System Testing (if relevant)

# Test media processing
./test_media_system.sh

# Test image processing (if modified)
./test_images.sh

# Run comprehensive tests
./comprehensive_test.sh

4. Service Integration Testing

# Restart the service
sudo systemctl restart church-api

# Check service status
sudo systemctl status church-api

# View logs for errors
journalctl -fu church-api --lines=50

5. API Testing (if relevant)

# Test authentication
curl -X POST https://api.rockvilletollandsda.church/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "..."}'

# Test relevant endpoints with JWT token
# (Check fix_routes.sh for examples)

6. Performance Validation (for media changes)

  • Check hardware acceleration is working:
    vainfo
    intel_gpu_top  # During transcoding
    
  • Monitor memory usage and CPU utilization
  • Verify transcoding times are reasonable
  • Check for memory leaks in long-running operations

7. Documentation Updates

  • Update inline comments for complex changes
  • Add tracing logs for new operations
  • Update memory files if architecture changes

8. Final Checklist

  • Code compiles without warnings
  • Tests pass
  • Service restarts successfully
  • No memory leaks or resource exhaustion
  • Hardware acceleration functional (if applicable)
  • Logging provides adequate debugging information
  • Error handling is comprehensive

Critical Notes

For Media/Streaming Changes:

  • Always test with actual video files
  • Verify both AV1 and H.264 codecs work
  • Check HLS playlist generation
  • Test with different client user agents
  • Monitor segment caching behavior

For GStreamer Integration:

  • Ensure GStreamer initialization succeeds
  • Test pipeline cleanup (no resource leaks)
  • Verify hardware acceleration paths
  • Check error handling for missing plugins
  • Test with various input formats

Performance Requirements:

  • Transcoding should complete faster than real-time
  • Memory usage should remain stable
  • No blocking of other requests during transcoding
  • Proper cleanup of temporary files and resources