[Bug][Tempo] Worklog domain ids lack the connection id, so connections with the same worklog id overwrite each other
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go
- Área
- data-engineering
Línea de trabajo
Empieza por backend/plugins/tempo/tasks/worklog_convertor.go y examina cómo construye el ID de dominio del worklog; compáralo con la clave primaria de TempoWorklog y con los otros ID asociados a una conexión descritos en el issue. Añade una prueba unitaria que cubra IDs de worklog idénticos procedentes de dos conexiones. El trabajo está terminado cuando cada conexión produce una fila distinta de issue_worklogs y la prueba pasa.
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
The Tempo convert_worklogs subtask (backend/plugins/tempo/tasks/worklog_convertor.go) builds the issue_worklogs id from the Tempo worklog id alone:
domainWorklogId := fmt.Sprintf("tempo:TempoWorklog:%d", tempoWorklog.TempoWorklogId)
The tool layer keys worklogs by (connection_id, tempo_worklog_id) (models.TempoWorklog), and the other ids of the same row (jira:JiraIssue:<conn>:<id>, jira:JiraAccount:<conn>:<id>) carry the connection id. Domain ids that didgen generates for other plugins carry it too. The worklog id doesn't.
So when two Tempo connections have a worklog with the same tempoWorklogId (two connections to the same Tempo instance, or two instances whose worklog ids overlap), both convert to the same issue_worklogs primary key. The connection converted last overwrites the other connection's row (its issue_id, author_id and _raw_data_params), so one of the two worklogs disappears from the domain layer.
Example: connection 1 and connection 2 both have worklog 12345. After converting connection 1 and then connection 2, issue_worklogs has one row, tempo:TempoWorklog:12345, which points to jira:JiraIssue:2:.... Connection 1's worklog is gone. Re-running connection 1 brings it back and drops connection 2's.
What do you expect to happen
Each connection's worklog gets its own domain row: tempo:TempoWorklog:<connectionId>:<tempoWorklogId>, the id didgen would generate from the TempoWorklog primary key.
How to reproduce
- Create two Tempo connections (ids 1 and 2) that both return a worklog with the same
tempoWorklogId. - Collect, extract and convert worklogs for a team scope of each connection.
SELECT id, issue_id, _raw_data_params FROM issue_worklogs WHERE id LIKE 'tempo:%'shows one row for that worklog instead of two.
Anything else
Proposed fix (I have a PR ready): add the connection id to the domain worklog id and add a unit test. No migration is needed: the converter is a full-sync DataConverter, so its first batch deletes the scope's old rows (same _raw_data_table / _raw_data_params) before it saves the rows with the new ids.
Version
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.2k
- Forks
- 832
- Merge medio
- 1 d 21 h
- PR fusionados (30 d)
- 78
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin 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 apache/devlake
-
[Bug][Testmo] Runs, milestones and automation runs: only the first 100 are collectedPosiblemente ocupada @ShivamSharma43 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
[Bug][linker] LinkPrToIssue never matches lowercase issue keys (e.g. in branch names)Posiblemente ocupada @VictorColomb la tomó hace 4 días. Abiertotype/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/devlake#9283 · 1 comentario · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
Los mantenedores suelen responder en 2 días
-
type/bug
Dificultad 4/5 3-5 días Aptitud para principiantes 51/100
Los mantenedores suelen responder en 2 días
-
[Bug][JIRA Service API TOKEN] Jira API Gateway: saved service-account token truncated by varchar(255), causing Base64 errors and HTTP 500Posiblemente ocupada @RyoKusnadi la tomó hoy. Abiertotype/bug
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
apache/devlake#9328 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de apache/devlake
Issues similares
-
[Bug] ListCanteens and ListAvailableCanteenTags return Unimplemented (handlers are misnamed)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TUM-Dev/Campus-Backend#678 ·
Los mantenedores suelen responder en 1 día
-
fix(app): fail closed if GetGeneralSetting fails during initializationPosiblemente ocupada @kalavt la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
tsukumogami/tsuku#2813 ·
Los mantenedores suelen responder en 1 día
-
component:obi contribfest go test
Dificultad 2/5 Menos de una hora Aptitud para principiantes 83/100
open-telemetry/opentelemetry-ebpf-instrumentation#4143 · 1 comentario ·
Los mantenedores suelen responder en 1 día