Skip to content

fix(tempo): add the connection id to worklog domain ids - #9331

Open
ShivamSharma43 wants to merge 1 commit into
apache:mainfrom
ShivamSharma43:fix/tempo-worklog-domain-id
Open

ShivamSharma43 wants to merge 1 commit into
apache:mainfrom
ShivamSharma43:fix/tempo-worklog-domain-id

Conversation

@ShivamSharma43

Copy link
Copy Markdown
Contributor

Summary

convert_worklogs built the issue_worklogs id from the Tempo worklog id alone (tempo:TempoWorklog:<id>). The tool layer keys worklogs by (connection_id, tempo_worklog_id), so when two connections have a worklog with the same id, both convert to the same domain row and the connection converted last overwrites the other's worklog.

Changes:

  • tasks/worklog_convertor.go: the domain id is now tempo:TempoWorklog:<connectionId>:<tempoWorklogId>, the id didgen generates from the TempoWorklog primary key. The row conversion moved into a small convertWorklog function so it can be unit tested. The issue and author ids are unchanged.
  • tasks/worklog_convertor_test.go (new): TestConvertWorklog checks the converted row, and TestConvertWorklogIdsAreUniquePerConnection checks that two connections with worklog 12345 get different ids.
  • e2e/snapshot_tables/issue_worklogs.csv: the expected ids now include the connection id (tempo:TempoWorklog:1:12345).

No migration: ConvertWorklogs uses a full-sync DataConverter, so on the next run its first batch deletes the scope's existing rows (same _raw_data_table / _raw_data_params) before it saves the rows with the new ids. Old-format ids don't linger next to the new ones.

Does this close any open issues?

Closes #9330

Screenshots

N/A

Other Information

🤖 Generated with Claude Code

convert_worklogs built the issue_worklogs id from the Tempo worklog id
alone (tempo:TempoWorklog:<id>), while the tool layer keys worklogs by
(connection_id, tempo_worklog_id). Two connections with the same worklog
id converted to the same domain row, so the connection converted last
overwrote the other's worklog.

Use tempo:TempoWorklog:<connectionId>:<tempoWorklogId>, the id didgen
generates from the TempoWorklog primary key. The converter is a
full-sync DataConverter, so it deletes a scope's rows with the old ids
before it saves the new ones; no migration is needed.

Closes apache#9330

Generated-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Shivam Sharma <192242476+ShivamSharma43@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 4, 2026 12:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Tempo] Worklog domain ids lack the connection id, so connections with the same worklog id overwrite each other

2 participants