|
| 1 | +# 🤝 Cómo contribuir como Early Adopter |
| 2 | + |
| 3 | +> Esta guía está dirigida a usuarios que quieren contribuir con su primera mejora al proyecto — sin necesidad de ser expertos en el código interno. |
| 4 | +
|
| 5 | +--- |
| 6 | + |
| 7 | +## Contribuciones más valoradas por la comunidad |
| 8 | + |
| 9 | +| Tipo | Dificultad | Impacto | |
| 10 | +|------|-----------|---------| |
| 11 | +| ➕ Perfil JSON de nuevo hardware | ⭐ Baja | 🔴 Alto | |
| 12 | +| 🐛 Reportar bug con logs completos | ⭐ Baja | 🔴 Alto | |
| 13 | +| 📝 Mejorar documentación / traducción | ⭐ Baja | 🟡 Medio | |
| 14 | +| 🧪 Escribir test para un caso de borde | ⭐⭐ Media | 🟡 Medio | |
| 15 | +| ✨ Implementar feature de GOOD_FIRST_ISSUES | ⭐⭐ Media | 🔴 Alto | |
| 16 | +| 🏗️ Nuevo conector de mercado (CENACE, REE…) | ⭐⭐⭐ Alta | 🔴 Alto | |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Contribución 1 — Perfil de hardware (más común) |
| 21 | + |
| 22 | +Tienes un inversor que no está en `registry/`. En 30 minutos puedes aportarlo. |
| 23 | + |
| 24 | +### Paso 1 — Revisar el formato existente |
| 25 | + |
| 26 | +```bash |
| 27 | +cat registry/huawei_sun2000.json | python3 -m json.tool |
| 28 | +``` |
| 29 | + |
| 30 | +La estructura es: |
| 31 | +```json |
| 32 | +{ |
| 33 | + "profile_id": "huawei_sun2000_v1", |
| 34 | + "manufacturer": "Huawei", |
| 35 | + "model": "SUN2000", |
| 36 | + "protocol": "modbus_tcp", |
| 37 | + "default_port": 502, |
| 38 | + "default_slave_id": 0, |
| 39 | + "registers": { |
| 40 | + "soc_pct": {"address": 37760, "type": "uint16", "scale": 0.1, "unit": "%"}, |
| 41 | + "power_kw": {"address": 37113, "type": "int32", "scale": 0.001, "unit": "kW"}, |
| 42 | + "temp_c": {"address": 35182, "type": "int16", "scale": 0.1, "unit": "°C"} |
| 43 | + } |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +### Paso 2 — Crear tu perfil |
| 48 | + |
| 49 | +```bash |
| 50 | +cp registry/huawei_sun2000.json registry/mi_inversor_modelo.json |
| 51 | +# Editar con los registros Modbus de tu fabricante |
| 52 | +``` |
| 53 | + |
| 54 | +Los tres registros **obligatorios** son `soc_pct`, `power_kw` y `temp_c`. Los demás son opcionales. |
| 55 | + |
| 56 | +### Paso 3 — Validar el perfil |
| 57 | + |
| 58 | +```bash |
| 59 | +make validate-registry |
| 60 | +# Debe pasar sin errores antes de abrir el PR |
| 61 | +``` |
| 62 | + |
| 63 | +### Paso 4 — Abrir el PR |
| 64 | + |
| 65 | +```bash |
| 66 | +git checkout -b feat/hardware-profile-FABRICANTE-MODELO |
| 67 | +git add registry/mi_inversor_modelo.json |
| 68 | +git commit -m "feat(registry): add FABRICANTE MODELO profile" |
| 69 | +git push origin feat/hardware-profile-FABRICANTE-MODELO |
| 70 | +``` |
| 71 | + |
| 72 | +Luego ve a GitHub y abre el Pull Request. El team lo revisa en ≤ 3 días hábiles. |
| 73 | + |
| 74 | +> **TIP:** Menciona en el PR qué firmware version del inversor usaste para identificar los registros. |
| 75 | +
|
| 76 | +--- |
| 77 | + |
| 78 | +## Contribución 2 — Reportar un bug |
| 79 | + |
| 80 | +Usa el template de issue en GitHub: |
| 81 | +→ [Nuevo issue → Bug Report](https://github.com/bess-solutions/open-bess-edge/issues/new?template=bug_report.yml) |
| 82 | + |
| 83 | +Los logs más útiles para el equipo: |
| 84 | + |
| 85 | +```bash |
| 86 | +# Logs del gateway (últimas 50 líneas) |
| 87 | +docker logs bessai-edge 2>&1 | tail -50 |
| 88 | + |
| 89 | +# Estado de compliance |
| 90 | +curl http://localhost:8000/compliance/report | python3 -m json.tool |
| 91 | + |
| 92 | +# Versión exacta |
| 93 | +git log --oneline -1 |
| 94 | +docker inspect bessai-edge | python3 -c "import sys,json; d=json.load(sys.stdin)[0]; print(d['Config']['Image'])" |
| 95 | +``` |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +## Contribución 3 — Mejorar documentación |
| 100 | + |
| 101 | +La documentación está en `docs/` en formato Markdown. Para visualizarla localmente: |
| 102 | + |
| 103 | +```bash |
| 104 | +pip install mkdocs-material |
| 105 | +mkdocs serve # → http://localhost:8001 |
| 106 | +``` |
| 107 | + |
| 108 | +Para traducir partes al inglés (el repo está en español/inglés mezclado): |
| 109 | +- Abre un PR con la traducción |
| 110 | +- El team la revisa y la integra |
| 111 | + |
| 112 | +--- |
| 113 | + |
| 114 | +## Proceso de revisión — qué esperar |
| 115 | + |
| 116 | +``` |
| 117 | +Tu PR abierto |
| 118 | + │ |
| 119 | + ▼ |
| 120 | +CI automático (~5 min) ← lint, type-check, tests, security scan |
| 121 | + │ |
| 122 | + ▼ |
| 123 | +Revisión del team (~3 días hábiles) |
| 124 | + │ |
| 125 | + ├── ✅ Aprobado → Merge a main |
| 126 | + └── 💬 Cambios solicitados → Iterar |
| 127 | +``` |
| 128 | + |
| 129 | +### Estándares de calidad obligatorios |
| 130 | + |
| 131 | +- `make lint` debe pasar sin errores |
| 132 | +- `make test` debe pasar (o documentar por qué el test no aplica) |
| 133 | +- Nuevos archivos Python deben tener type hints |
| 134 | +- Commits en formato [Conventional Commits](https://www.conventionalcommits.org/): `feat:`, `fix:`, `docs:`, etc. |
| 135 | + |
| 136 | +--- |
| 137 | + |
| 138 | +## Primeros issues recomendados para newcomers |
| 139 | + |
| 140 | +Ver [GOOD_FIRST_ISSUES.md](GOOD_FIRST_ISSUES.md) para issues etiquetados con `good-first-issue`. |
| 141 | + |
| 142 | +Los más accesibles actualmente: |
| 143 | +- Agregar un perfil JSON de hardware faltante |
| 144 | +- Mejorar el mensaje de error cuando `MODBUS_HOST` no es accesible |
| 145 | +- Traducir secciones del `ADOPTER_HUB.md` al inglés |
| 146 | + |
| 147 | +--- |
| 148 | + |
| 149 | +## Stack técnico de referencia |
| 150 | + |
| 151 | +| Capa | Tecnología | |
| 152 | +|------|-----------| |
| 153 | +| Runtime | Python 3.11+ / asyncio | |
| 154 | +| Protocolo industrial | pymodbus 3.x | |
| 155 | +| API REST | FastAPI + uvicorn | |
| 156 | +| Observabilidad | Prometheus + structlog + OpenTelemetry | |
| 157 | +| IA / ML | ONNX Runtime + scikit-learn | |
| 158 | +| Tests | pytest + pytest-asyncio | |
| 159 | +| Linter | ruff + mypy strict | |
| 160 | +| Contenedores | Docker multi-arch (amd64/arm64) | |
| 161 | +| CI | GitHub Actions | |
| 162 | + |
| 163 | +--- |
| 164 | + |
| 165 | +*¿Tienes dudas? [Abre un issue](https://github.com/bess-solutions/open-bess-edge/issues/new?labels=question) o escríbenos a `ingenieria@bess-solutions.cl`.* |
0 commit comments