Thank you for your interest in contributing to Home Assistant Sentry! This document outlines the principles, rules, and guidelines that all contributors must follow.
Home-Assistant-Sentry exists to explain update risk before the user updates, without modifying or interfering with Home Assistant's runtime.
- Advisory, not intrusive: We provide information and recommendations, never taking action on behalf of the user
- Predictive, not reactive: We analyze before updates happen, not after
- Read-only by default: We observe and analyze, never modify
- Zero-risk to HA stability: Our add-on must never cause Home Assistant to fail or become unstable
All contributors must adhere to these fundamental rules:
-
❌ Sentry never changes system state
- No modifications to Home Assistant configuration
- No changes to integration files
- No database modifications
- No file system writes except for its own logs and reports
-
❌ Sentry never "fixes" issues
- No automatic patching
- No automatic configuration updates
- No automatic dependency resolution
- If you're tempted to "auto-fix" something → stop and reconsider
-
❌ Sentry never blocks updates
- We may warn and advise caution
- We may recommend delaying
- But we NEVER prevent the user from updating
-
❌ Sentry never assumes user intent
- We provide information
- The user decides what to do with it
- No "smart" automatic actions based on preferences
-
❌ No pip install
- Never install, upgrade, or modify Python packages in HA's environment
- Never run pip commands
- Never manipulate the Python environment
-
❌ No writes to HA Python environment
- Never modify site-packages
- Never modify installed integrations
- Never inject code into HA's Python runtime
-
❌ No runtime monkey-patching
- Never modify HA Core at runtime
- Never patch integration code
- Never intercept or modify HA's execution
-
❌ No integration imports
- Never import integration code directly
- Static inspection only
- Read manifest files, don't execute integration code
✅ Static inspection only
- Read and parse manifest.json files
- Read configuration files (read-only)
- Analyze file metadata
✅ Filesystem reads only
- Read files to gather information
- Never write outside our designated directories
- Never modify any HA files
✅ Supervisor-approved APIs only
- Use official Home Assistant APIs
- Use official Supervisor APIs
- Never circumvent API security
When writing user-facing messages, documentation, or code comments about risks:
- "may"
- "could"
- "might"
- "possible"
- "potential"
- "risk of"
- "could affect"
- "may impact"
- "will break"
- "will fail"
- "guaranteed to"
- "definitely"
- "certainly will"
Good:
⚠️ Updating to HA 2025.1 may affect custom_component_x (requires <=2024.12)
Bad:
❌ Updating to HA 2025.1 will break custom_component_x
Good:
This update could cause compatibility issues with 3 integrations.
Bad:
❌ This update will break 3 integrations.
Before any code is merged, it must prove:
- ❌ No pip install commands
- ❌ No writes to HA Python environment
- ❌ No runtime monkey-patching
- ❌ No integration imports (no executing integration code)
- ✅ Static inspection only
- ✅ Filesystem reads only (within appropriate boundaries)
- ✅ Supervisor-approved APIs only
- ✅ Appropriate language ("may", "could", not "will")
- ✅ No assumptions about user intent
- ✅ No blocking of user actions
Before releasing new features, test against:
-
Clean HA OS install
- Fresh installation with no custom integrations
- Verify basic functionality
-
Heavy HACS system
- System with 50+ HACS integrations
- Verify performance and accuracy
-
Broken / partial integrations
- Malformed manifest.json files
- Missing required fields
- Invalid version strings
- Verify graceful handling without crashes
- ✅ No crashes on malformed manifests
- ✅ No assumptions about install type (HA OS vs. Container vs. Core)
- ✅ Graceful degradation when data is unavailable
- ✅ Clear error messages for users
All features must meet these performance targets:
- Graph build: < 2 seconds for 200+ integrations
- Memory footprint: < 200MB
- No continuous background scanning: Only scheduled checks
- Efficient API usage: Minimize API calls to HA
Test with:
- Small systems (< 20 integrations)
- Medium systems (20-100 integrations)
- Large systems (100-200+ integrations)
- Design First: Ensure the feature aligns with product goal
- Read-Only Check: Verify feature doesn't modify system state
- API Usage: Use only approved APIs
- Error Handling: Handle all error cases gracefully
- Testing: Add tests for normal and edge cases
- Documentation: Update relevant docs
- Follow PEP 8 for Python code
- Use type hints where appropriate
- Add docstrings to functions and classes
- Use descriptive variable names
- Keep functions focused and small
- Use appropriate log levels:
DEBUG: Detailed diagnostic informationINFO: General informational messagesWARNING: Warning messages for potential issuesERROR: Error messages for failures
- Add unit tests for new functionality
- Test error paths and edge cases
- Verify no side effects
- Test with various system configurations
✅ A user opens Sentry and immediately understands:
- What depends on what
- What's fragile
- Whether today is a good day to update
✅ A cautious user delays fewer updates (more confidence)
✅ A confident user updates faster (better information)
✅ Nothing ever breaks because of Sentry
- Clear Description: Explain what changes and why
- Testing Evidence: Show that you've tested the changes
- Documentation Updates: Update docs if needed
- Safety Checklist: Confirm all safety validations pass
- No Breaking Changes: Ensure backward compatibility
Before submitting a PR, verify:
- Code follows all hard rules
- Appropriate language used in user-facing text
- Tests added for new functionality
- Tests pass
- Documentation updated
- Performance targets met
- No system state modifications
- Graceful error handling
If you're unsure whether something aligns with our principles:
- Ask yourself: "Does this modify Home Assistant's state?"
- If yes → don't do it
- Ask yourself: "Does this assume user intent?"
- If yes → don't do it
- Ask yourself: "Could this break Home Assistant?"
- If yes → don't do it
When in doubt, open an issue to discuss before implementing.
By contributing, you agree that your contributions will be licensed under the MIT License.