Contributing to Minimal Status Panel
Thank you for your interest in contributing! This document provides guidelines and information for contributors.
๐ Quick Start
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/yourusername/Minimal-Status-Panel.git cd Minimal-Status-Panel - Install dependencies:
npm install - Start development environment:
docker-compose up -d # Starts Grafana + Prometheus + Blackbox Exporter npm run dev # Starts development build with watch - Access Grafana at http://localhost:3001 (admin/admin)
๐ Development Workflow
1. Create a Feature Branch
git checkout -b feature/your-feature-name
2. Make Your Changes
- Write clean, readable code
- Follow existing code style and patterns
- Add comments for complex logic
- Update documentation if needed
3. Test Your Changes
npm run typecheck # TypeScript checking
npm run lint # Code linting
npm run test # Run tests
npm run build # Production build
4. Commit Your Changes
git add .
git commit -m "feat: add new feature description"
Commit Message Format:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
5. Push and Create Pull Request
git push origin feature/your-feature-name
Then create a Pull Request on GitHub.
๐ Pull Request Guidelines
Before Submitting
- โ
All tests pass (
npm run test:ci) - โ
TypeScript compiles without errors (
npm run typecheck) - โ
Code passes linting (
npm run lint) - โ
Plugin builds successfully (
npm run build) - โ Tested in actual Grafana environment
PR Description Template
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tested in development environment
- [ ] Added/updated tests
- [ ] Manual testing completed
## Screenshots (if applicable)
Add screenshots for UI changes
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No console errors/warnings
๐งช Testing
Running Tests
npm test # Interactive test mode
npm run test:ci # CI mode (single run)
Manual Testing
- Start development environment:
docker-compose up -d - Build plugin:
npm run build - Access Grafana: http://localhost:3001
- Create dashboard with Minimal Status Panel
- Test different configurations and scenarios
Test Coverage
- Aim for high test coverage on new features
- Test both happy path and error scenarios
- Include integration tests for complex features
๐๏ธ Architecture
Project Structure
src/
โโโ components/
โ โโโ StatusPanel.tsx # Main panel component
โ โโโ StatusIndicator.tsx # Individual service cards
โโโ utils/
โ โโโ dataUtils.ts # Data parsing utilities
โโโ types.ts # TypeScript interfaces
โโโ plugin.ts # Panel options configuration
โโโ module.ts # Plugin entry point
Key Concepts
- StatusPanel: Main component that receives Grafana data
- StatusIndicator: Individual service status card
- dataUtils: Parses Prometheus/Grafana data frames
- Panel Options: Configurable settings in Grafana UI
๐จ Code Style
TypeScript
- Use strict TypeScript configuration
- Define proper types for all data structures
- Avoid
anytypes where possible - Use meaningful variable and function names
React
- Use functional components with hooks
- Follow React best practices
- Use proper prop types
- Implement proper error boundaries
CSS/Styling
- Use Emotion CSS-in-JS for styling
- Follow Grafana theme patterns
- Ensure responsive design
- Support both light and dark themes
๐ Reporting Issues
Bug Reports
Include:
- Environment: Grafana version, browser, OS
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
- Console errors (if any)
Feature Requests
Include:
- Problem description
- Proposed solution
- Use case examples
- Mockups (if applicable)
๐ Documentation
Code Documentation
- Comment complex algorithms
- Document public APIs
- Include JSDoc for functions
- Update README for new features
User Documentation
- Update documentation for user-facing changes
- Include screenshots for UI changes
- Update CHANGELOG.md for releases
- Provide configuration examples
๐ง Development Environment
Requirements
- Node.js 18+
- npm 8+
- Docker & Docker Compose
- Git
VS Code Setup (Recommended)
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"typescript.preferences.importModuleSpecifier": "relative"
}
Useful Commands
npm run dev # Development build with watch
npm run build # Production build
npm run typecheck # TypeScript checking
npm run lint # Lint code
npm run lint:fix # Fix linting issues
npm test # Run tests
docker-compose up # Start development environment
docker-compose down # Stop development environment
๐ฏ Contribution Ideas
Good First Issues
- Fix typos in documentation
- Add new service name parsing rules
- Improve error handling
- Add unit tests for existing functions
Advanced Features
- Support for additional metrics
- Custom theming options
- Performance optimizations
- New display modes
Infrastructure
- Improve CI/CD workflows
- Add more comprehensive tests
- Documentation improvements
- Performance benchmarking
๐ Getting Help
- Issues: Create an issue on GitHub
- Discussions: Use GitHub Discussions for questions
- Documentation: Check documentation and code comments
๐ License
By contributing to this project, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to make this plugin better! ๐