[Bug][tempo] Worklog collector only fetches the first 1000 worklogs of a rolling 90-day window; converted ids don't join jira
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go
- Área
- backend, data-engineering
Línea de trabajo
The bug is in backend/plugins/tempo/tasks/worklog_collector.go. Start by reading the collector's pagination logic and the Tempo v4 API spec. Check how the time range is set for team scopes and how raw params are shared. For the conversion issues, examine the ID generation in the worklog converter. Run the existing tests and create a test connection to verify fixes.
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
On a Tempo connection with team scopes, collect_worklogs never collects more than 1000 worklogs per team, and they are always the oldest ones of a rolling 90-day window — recent worklogs never arrive. Seen on v1.0.3-beta15; the collector is unchanged on main.
Evidence from _raw_tempo_api_worklogs after ~50 daily runs:
- every request URL has
offset=0, e.g.https://api.tempo.io/4/worklogs/team/4?from=2026-06-25&limit=1000&offset=0&to=2026-09-23, and each returns exactly 1000 results, i.e. there were more pages that were never requested; fromis always today − 90 days, regardless of the blueprint'stimeAfter(2026-01-28 here);- resulting
_tool_tempo_worklogsby start month: May 5040, Jun 5109, Jul 2208, Aug 461, Sep 46 — nothing before May, and a steady decline towards today, while the same teams log a roughly constant volume.
Root causes in backend/plugins/tempo/tasks/worklog_collector.go:
- Pagination —
GetTotalPagescomputes the page count frommetadata.total, but the Tempo v4 API does not return a total: per the official OpenAPI spec (https://apidocs.tempo.io/tempo-openapi.yaml),PageableWorklog.metadataisPageableMetadata=count, limit, next, offset, previous.totalunmarshals as 0 → 0 pages → only the first page is fetched. - Time range — for team scopes the query uses
from = now − 90d/to = nowunlessfromDate/toDatetask options are set (the blueprint never sets them), ignoring the sync policy (timeAfter, incremental state). - Shared state across teams — the collector's raw params only carry
ConnectionId(TeamIdis always 0, althoughTempoTeam.GetParams()declaresConnectionId+TeamId), so all team scopes of a connection share one raw-data/collector-state key. With (2) fixed, the second team collected in a pipeline would run incrementally from the first team's start time.
Separately, convert_worklogs emits ids that never join the jira domain layer:
issue_worklogs.issue_idisjira:JiraIssues:<conn>:<id>(plural), while the jira plugin generatesjira:JiraIssue:<conn>:<id>;issue_worklogs.author_idis the bare Atlassian account id instead ofjira:JiraAccount:<conn>:<id>, so worklogs don't joinaccounts/user_accounts.
What do you expect to happen
All worklogs from timeAfter onwards are collected (then incrementally via updatedFrom), and issue_worklogs rows join issues and accounts like the jira plugin's own worklogs do.
How to reproduce
- Create a Tempo connection and add a team scope whose members log more than 1000 worklogs in 90 days.
- Run a blueprint with
timeAfterolder than 90 days. SELECT url, COUNT(*) FROM _raw_tempo_api_worklogs GROUP BY url;→ one URL per run,offset=0, 1000 rows each;SELECT MIN(start_date), MAX(start_date) FROM _tool_tempo_worklogs;→ starts 90 days back, sparse towards today.SELECT COUNT(*) FROM issue_worklogs w JOIN issues i ON i.id = w.issue_id WHERE w.id LIKE 'tempo:%';→ 0.
Anything else
Happens on every run. Worklogs collected by the jira plugin for time logged through Tempo carry the "Timesheets by Tempo" app as author, so the tempo plugin is the only source of per-person time — which makes this quite visible for anyone building per-team/per-person dashboards.
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
- 1 d 23 h
- PR fusionados (30 d)
- 51
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
type/bug
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
apache/devlake#9142 · 2 comentarios · 1 reacción · 1 asignado ·
Todos los issues de apache/devlake
Issues similares
-
bug github_actions
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
registrystack/registry-stack#1393 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
JakeChampion/lang#10213 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
oasisprotocol/oasis-sdk#2523 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100