| 1 |
# Fenrir Release Validation Checklist |
| 2 |
|
| 3 |
This checklist ensures thorough validation before releasing Fenrir packages. |
| 4 |
|
| 5 |
## 🔧 Setup Tools (One-time setup) |
| 6 |
|
| 7 |
### Install Pre-commit Hook |
| 8 |
```bash |
| 9 |
# Safely install composite hook (preserves existing version management) |
| 10 |
./tools/install_validation_hook.sh |
| 11 |
|
| 12 |
# Test the hook |
| 13 |
./.git/hooks/pre-commit |
| 14 |
``` |
| 15 |
|
| 16 |
### Validation Scripts |
| 17 |
- `tools/validate_syntax.py` - Python syntax validation |
| 18 |
- `tools/validate_pep8.py` - PEP8 compliance checking with safe auto-fix |
| 19 |
- `tools/validate_release.py` - Comprehensive release validation |
| 20 |
- `tools/cleanup_cache.py` - Remove Python cache files and directories |
| 21 |
- `tools/pre-commit-hook` - Git pre-commit validation |
| 22 |
|
| 23 |
## 📋 Pre-Release Checklist |
| 24 |
|
| 25 |
### 1. Code Quality Validation ✅ |
| 26 |
```bash |
| 27 |
# Comprehensive release validation (includes syntax, imports, structure) |
| 28 |
python3 tools/validate_release.py |
| 29 |
|
| 30 |
# If issues found, try auto-fix |
| 31 |
python3 tools/validate_release.py --fix |
| 32 |
|
| 33 |
# Quick validation (skips slow dependency checks) |
| 34 |
python3 tools/validate_release.py --quick |
| 35 |
``` |
| 36 |
|
| 37 |
**Expected Result**: All tests pass, no syntax errors |
| 38 |
|
| 39 |
### 2. Dependency Validation ✅ |
| 40 |
```bash |
| 41 |
# Validate all dependencies are available |
| 42 |
python3 check-dependencies.py |
| 43 |
``` |
| 44 |
|
| 45 |
**Expected Result**: All required dependencies reported as available |
| 46 |
|
| 47 |
### 3. Core Functionality Test ✅ |
| 48 |
```bash |
| 49 |
# Test core imports (safe to run without sudo) |
| 50 |
cd src |
| 51 |
python3 -c " |
| 52 |
import fenrirscreenreader.core.fenrirManager |
| 53 |
import fenrirscreenreader.core.commandManager |
| 54 |
import fenrirscreenreader.core.eventManager |
| 55 |
print('Core imports successful') |
| 56 |
" |
| 57 |
cd .. |
| 58 |
``` |
| 59 |
|
| 60 |
**Expected Result**: No import errors |
| 61 |
|
| 62 |
### 4. Installation Script Validation ✅ |
| 63 |
```bash |
| 64 |
# Validate setup.py syntax |
| 65 |
python3 -m py_compile setup.py |
| 66 |
|
| 67 |
# Check setup.py can be parsed |
| 68 |
python3 setup.py --help-commands >/dev/null |
| 69 |
``` |
| 70 |
|
| 71 |
**Expected Result**: No syntax errors, setup.py functional |
| 72 |
|
| 73 |
### 5. Configuration Validation ✅ |
| 74 |
```bash |
| 75 |
# Verify config files exist and are parseable |
| 76 |
ls -la config/settings/settings.conf |
| 77 |
ls -la config/keyboard/desktop.conf |
| 78 |
ls -la config/punctuation/default.conf |
| 79 |
``` |
| 80 |
|
| 81 |
**Expected Result**: All core config files present |
| 82 |
|
| 83 |
### 6. Manual Testing (User/Package Maintainer) ⚠️ |
| 84 |
|
| 85 |
**Important**: These require user interaction as they need sudo access or specific hardware. |
| 86 |
|
| 87 |
```bash |
| 88 |
# Test basic functionality (ask user to run) |
| 89 |
sudo ./src/fenrir --help |
| 90 |
|
| 91 |
# Test version output |
| 92 |
./src/fenrir --version |
| 93 |
|
| 94 |
# Quick console functionality test (3-5 seconds, ask user to run on a TTY) |
| 95 |
sudo timeout 5 ./src/fenrir -f || echo "Timeout reached (expected)" |
| 96 |
``` |
| 97 |
|
| 98 |
**Expected Result**: No immediate crashes, basic help/version output works |
| 99 |
|
| 100 |
### 7. Package-Specific Validation ✅ |
| 101 |
```bash |
| 102 |
# Test the same compilation process used by package managers |
| 103 |
python3 -m compileall src/fenrirscreenreader/ -q |
| 104 |
|
| 105 |
# Verify no __pycache__ permission issues |
| 106 |
find src/ -name "*.pyc" -delete |
| 107 |
find src/ -name "__pycache__" -delete |
| 108 |
``` |
| 109 |
|
| 110 |
**Expected Result**: Clean compilation, no permission errors |
| 111 |
|
| 112 |
## 🚨 Known Issue Categories |
| 113 |
|
| 114 |
### Critical Issues (Block Release) |
| 115 |
- **Python syntax errors** (SyntaxError, unterminated strings) |
| 116 |
- **Missing core dependencies** (dbus-python, evdev, etc.) |
| 117 |
- **Import failures in core modules** (fenrirManager, commandManager) |
| 118 |
- **Missing critical config files** (settings.conf, desktop.conf) |
| 119 |
|
| 120 |
### Warning Issues (Address if Possible) |
| 121 |
- **PEP8 violations** (cosmetic, don't block release) |
| 122 |
- **Missing optional dependencies** (for specific features) |
| 123 |
- **Command structure issues** (missing methods in command files) |
| 124 |
- **Very long lines** (>120 characters) |
| 125 |
|
| 126 |
## 🔍 Root Cause Analysis |
| 127 |
|
| 128 |
### Why These Errors Weren't Caught Previously |
| 129 |
|
| 130 |
1. **No automated syntax validation** - The codebase relied on manual testing |
| 131 |
2. **No pre-commit hooks** - Syntax errors could be committed |
| 132 |
3. **No CI/CD pipeline** - Package compilation happens only during release |
| 133 |
4. **Manual PEP8 cleanup** - F-string refactoring introduced syntax errors during batch cleanup |
| 134 |
|
| 135 |
## 📖 Usage Instructions |
| 136 |
|
| 137 |
### For Developers |
| 138 |
```bash |
| 139 |
# Before committing changes |
| 140 |
git add . |
| 141 |
git commit # Pre-commit hook will run automatically |
| 142 |
|
| 143 |
# Before creating tags/releases |
| 144 |
python3 tools/validate_release.py |
| 145 |
``` |
| 146 |
|
| 147 |
### For Package Maintainers |
| 148 |
```bash |
| 149 |
# Before packaging |
| 150 |
python3 tools/validate_release.py |
| 151 |
|
| 152 |
# If validation fails |
| 153 |
python3 tools/validate_release.py --fix |
| 154 |
|
| 155 |
# Quick check (if dependencies are known good) |
| 156 |
python3 tools/validate_release.py --quick |
| 157 |
``` |
| 158 |
|
| 159 |
### For Release Managers |
| 160 |
```bash |
| 161 |
# Complete validation before tagging |
| 162 |
python3 tools/validate_release.py |
| 163 |
|
| 164 |
# Manual verification (requires sudo) |
| 165 |
sudo ./src/fenrir --version |
| 166 |
|
| 167 |
# Tag release only after all validations pass |
| 168 |
git tag -a v2.x.x -m "Release v2.x.x" |
| 169 |
``` |
| 170 |
|
| 171 |
## 🎯 Future Improvements |
| 172 |
|
| 173 |
### Recommended Additions |
| 174 |
1. **GitHub Actions CI/CD** - Automated validation on every push |
| 175 |
2. **Automated testing** - Unit tests for core functionality |
| 176 |
3. **Integration testing** - Test driver interactions |
| 177 |
4. **Package testing** - Validate actual package installation |
| 178 |
|
| 179 |
### Modern Python Packaging |
| 180 |
- Consider migrating to `pyproject.toml` (PEP 621) |
| 181 |
- Use `build` instead of `setup.py` directly |
| 182 |
- Add `tox.ini` for multi-environment testing |
| 183 |
|
| 184 |
## 📞 Support |
| 185 |
|
| 186 |
If validation fails and auto-fix doesn't resolve issues: |
| 187 |
|
| 188 |
1. **Check the specific error messages** in validation output |
| 189 |
2. **Review recent commits** that might have introduced issues |
| 190 |
3. **Run individual validation steps** to isolate problems |
| 191 |
|
| 192 |
Remember: **Working code is better than perfect code** - especially for accessibility software where reliability is critical. |