notifications: scoped weekly metrics mail per rule
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 64/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- backend, databases, documentation
Línea de trabajo
Comienza en backend/data/notifications/metrics/ e inspecciona el flujo de las reglas de métricas y metrics_report.txt.j2; después, revisa docs/notifications.md y el comportamiento existente del trabajo semanal. Verifica que el correo global predeterminado no cambie, que los informes con ámbito lleguen únicamente a los destinatarios de cada regla, que los ámbitos configurados estén cubiertos por el calentamiento de la caché y que el impacto en las consultas y la caché esté documentado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
The Saturday metrics_summary cron sends one global report to [email protected], Cc [email protected]. A lab or an origin cannot get its own copy.
Change
New directory backend/data/notifications/metrics/, created by this issue. Each rule sends one extra metrics_report.txt.j2 after the community mail on the weekly run.
# metrics/collabora.yaml — one file per rule group, rule name as top-level key
collabora-labs:
origins: [maestro]
labs: [lava-collabora]
period_days: 7
to: [[email protected]]
| Key | Required | Effect |
|---|---|---|
to |
yes, ≥1 | RFC 5322 strings, sent unchanged. To of this mail. |
period_days |
yes, > 0 | get_metrics_data(start_days_ago=period_days, end_days_ago=0), the same window the community mail uses. |
origins |
no | Keeps these keys in build_incidents_by_origin, top_issues_by_origin, new_issues_by_origin. |
labs |
no | Keeps these keys in lab_maps and prev_lab_maps. |
The accepted keys are exactly those four. get_metrics_data() groups by origin and by lab, so those are the dimensions a rule can scope.
What a reader of a scoped mail sees
The origin sections and the lab table follow the rule. The headline table (Trees monitored, Checkouts, Builds, Tests) stays project-wide, and the template gains a line saying so. Lab counts span every origin, since the lab queries group by lab and status; document this next to the labs key.
Implementation
typeModels/metricsRules.py:MetricsRule(pydantic,extra="forbid"), loader overmetrics/*.yaml. Rule names are unique across files. Errors carry file, rule, and key, matching #2114's loader.generate_metrics_report: load the rules, callget_metrics_dataonce per distinctperiod_dayswith today'suse_cachedefault, then per rulemodel_copy(update=...)on the five dicts. Filter beforecompute_metrics_deltassodeltas.labs,new_lab_keys,extinct_lab_keys, andn_total_lab_activitydescribe the filtered set. Send one mail per rule, To fromto.metrics_report.txt.j2: mark the headline table as project-wide.docs/notifications.md: the directory, the four keys, and the scope of each section.
A rule with period_days: 7 reuses the 6-hour cache entries the community mail populates in the same run; other values cost six queries. warm_metrics_cache serves the dashboard and stays as it is.
Tests
Loader fixtures: valid rule, duplicate name across files, unknown key, empty to, period_days: 0. Report fixtures on a MetricsReportData instance: origins keeps only those origins; labs keeps only those labs and recomputes deltas, including dropping an extinct lab outside the rule; a rule naming a lab absent from the period renders without it. One test loads the real metrics/ directory so a committed rule file is validated in CI.
Acceptance
- With no rule files, the community mail matches today
- A rule sends one mail to its
to, with only its origins in the origin sections and only its labs in the lab table - Lab deltas and the new and extinct markers describe the filtered set
- An invalid rule file fails CI with file, rule, and key
Creates the metrics/ directory. Independent of #2114 and #2115.
- Lenguaje dominante
- Python
- Estrellas
- 10
- Forks
- 32
- Merge medio
- 4 d 2 h
- PR fusionados (30 d)
- 30
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de kernelci/dashboard
-
notifications
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 2 días
-
HW-list: origin and lab filters on the listingPosiblemente ocupada @alanpeixinho la tomó hace 64 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
-
Tree builds endpoint exhausts memory and took production downPosiblemente ocupada @felipebergamin la tomó hace 1 día. Abiertobug URGENT
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
kernelci/dashboard#2202 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
Backend
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 2 días
Todos los issues de kernelci/dashboard
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Graphify-Labs/graphify#4860 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
:bug: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
scikit-image/scikit-image#8377 ·
Los mantenedores suelen responder en 1 día
-
Ingredient import validation accepts negative nutrient values and NaNPosiblemente ocupada @LukeSekai la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
wger-project/wger#2564 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/ponymail-foal#351 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Los mantenedores suelen responder en 4 días