[Bug][jenkins] Incremental collection skips the stages of builds that finish after the next sync
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/100
Línea de trabajo
Start in backend/plugins/jenkins/tasks/stage_collector.go and inspect the incremental filters in both the single-job and multi-branch collectors. Reproduce a build that spans two collections, then verify that an incremental run finds its stages and that full and incremental collections produce the same stage records.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Search before asking
- I had searched in the issues and found no similar issues.
What happened
With incremental collection, collectApiStages never collects the stages of a Jenkins build that started before the previous collection and finished after it. Those builds end up in _tool_jenkins_builds with a result, but with no rows in _raw_jenkins_api_stages / _tool_jenkins_stages, so their deployment stages never become cicd_tasks and the deployments are missing from DORA.
Cause (backend/plugins/jenkins/tasks/stage_collector.go, both the single-job and the multi-branch collectors):
if apiCollector.IsIncremental() && apiCollector.GetSince() != nil {
clauses = append(clauses, dal.Where(`tjb.start_time >= ?`, apiCollector.GetSince()))
}
The build collectors skip builds that are still running (buildObj["result"] != nil), so a build is stored the first time it is collected finished. For a build that started before since and finished after it, that happens in a later run, and the stage collector filters it out by start_time in that run and in every run after it. Nothing reports it.
This is common in pipelines that wait on an input step, e.g. a "rollback?" or "deploy to production?" approval left open for hours or days after the deploy.
Evidence from our instance (v1.0.3-beta15, 190 multi-branch scopes, daily collection):
| Build duration | Builds with stages, first (full) collection | Builds with stages, incremental runs since |
|---|---|---|
| < 6 h | 508 / 561 | 680 / 711 |
| 6–24 h | 25 / 25 | 5 / 68 |
| > 24 h | 698 / 814 | 13 / 389 |
For example, front-channel/master#111 (SUCCESS, 148 h) is in _tool_jenkins_builds and has no row in _raw_jenkins_api_stages. The collector is unchanged on main.
What do you expect to happen
An incremental run collects the stages of every build that became available since the previous run, i.e. every build that finished since then, whenever it started. A full and an incremental collection should produce the same stages.
How to reproduce
- Jenkins scope with incremental collection (any sync after the first).
- Start a pipeline build that waits on an
inputstep, and let a collection run while it waits. - Answer the input after that collection so the build finishes, then run another collection.
- The build is in
_tool_jenkins_builds, but_tool_jenkins_stageshas no rows for it.
Anything else
Proposed fix, PR to follow: filter on the finish time, tjb.timestamp + tjb.duration >= since. Both columns are milliseconds, so it is plain arithmetic on MySQL and PostgreSQL, no dialect-specific date functions. It is a superset of the current condition (duration ≥ 0).
Version
v1.0.3-beta15 (collector unchanged on main)
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- Lenguaje dominante
- Go
- Estrellas
- 3.1k
- Forks
- 812
- Merge medio
- 2 d 8 h
- PR fusionados (30 d)
- 51
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 apache/devlake
-
type/bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
Los mantenedores suelen responder en 1 día
-
type/bug
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
apache/devlake#9170 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Feature][Plugins] Add YouTrack pluginPosiblemente ocupada @tpam28 la tomó hace 2 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 32/100
apache/devlake#9168 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug][Jira/DORA] Extra JQL does not isolate projects sharing the same Jira boardPosiblemente ocupada @veetmoradiya3628 la tomó hace 8 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
apache/devlake#9151 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
type/bug
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
apache/devlake#9150 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/devlake
Issues similares
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
open-telemetry/opentelemetry-go-compile-instrumentation#1417 ·
Los mantenedores suelen responder en 2 días
-
agent-research-finding agent-research-recommend chore ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
jordansmall/spindrift#4068 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Type/Task
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
OpenNSW/nsw-srilanka#537 ·
Los mantenedores suelen responder en 1 día
-
security
Dificultad 2/5 1-2 días Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día