[Bug][Tempo] Worklog domain ids lack the connection id, so connections with the same worklog id overwrite each other
Mantenedores costumam responder em até 2 dias
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- go
- Domínio
- data-engineering
Direção de pesquisa
Comece por backend/plugins/tempo/tasks/worklog_convertor.go e examine como ele constrói o ID de domínio do worklog; compare-o com a chave primária de TempoWorklog e com os outros IDs com escopo de conexão descritos na issue. Adicione um teste unitário que cubra IDs de worklog idênticos vindos de duas conexões. O trabalho estará concluído quando cada conexão produzir uma linha distinta em issue_worklogs e o teste passar.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Go
- Estrelas
- 3.2k
- Forks
- 840
- Merge médio
- 2d 6h
- PRs com merge (30d)
- 85
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/devlake
-
[Bug][Testmo] Runs, milestones and automation runs: only the first 100 are collectedTalvez já em andamento @ShivamSharma43 assumiu há 3 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 2 dias
-
[Bug][linker] LinkPrToIssue never matches lowercase issue keys (e.g. in branch names)Talvez já em andamento @VictorColomb assumiu há 7 dias. Abertatype/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
apache/devlake#9283 · 1 comentário · 1 reação · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 60/100
Mantenedores costumam responder em até 2 dias
-
[Bug][Taiga] Epics, issues, tasks and user stories: only the first 30 are collectedTalvez já em andamento @ShivamSharma43 assumiu hoje. Aberta
Dificuldade 4/5 1-2 dias Facilidade para iniciantes 25/100
Mantenedores costumam responder em até 2 dias
-
type/bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 51/100
Mantenedores costumam responder em até 2 dias
Todas as issues de apache/devlake
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutTalvez já em andamento @floriankoch assumiu hoje. Abertatriage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
envoyproxy/gateway#10562 ·
Mantenedores costumam responder em até 1 dia
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"Talvez já em andamento @Daksha1611 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100