Repository navigation
fix(tempo): add the connection id to worklog domain ids - #9331
Open
ShivamSharma43 wants to merge 1 commit into
Open
ShivamSharma43 wants to merge 1 commit into
ShivamSharma43 wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
convert_worklogsbuilt theissue_worklogsid 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 nowtempo:TempoWorklog:<connectionId>:<tempoWorklogId>, the iddidgengenerates from theTempoWorklogprimary key. The row conversion moved into a smallconvertWorklogfunction so it can be unit tested. The issue and author ids are unchanged.tasks/worklog_convertor_test.go(new):TestConvertWorklogchecks the converted row, andTestConvertWorklogIdsAreUniquePerConnectionchecks that two connections with worklog12345get different ids.e2e/snapshot_tables/issue_worklogs.csv: the expected ids now include the connection id (tempo:TempoWorklog:1:12345).No migration:
ConvertWorklogsuses a full-syncDataConverter, 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
go test ./plugins/tempo/tasks/: pass.TestConvertWorklogIdsAreUniquePerConnectionfails onmain(both ids aretempo:TempoWorklog:12345).go vet,gofmtandgolangci-lint run ./plugins/tempo/...: clean.plugins/tempo/e2eneeds a liveE2E_DB_URLdatabase, which I didn't run locally. I updated theTestWorklogDataFlowsnapshot to the new ids, and CI's e2e job covers it.pr-type/bug-fix.Generated-by:trailer per the ASF generative tooling guidance.🤖 Generated with Claude Code