[Bug][Tempo] Worklog domain ids lack the connection id, so connections with the same worklog id overwrite each other
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- data-engineering
Hướng nghiên cứu
Bắt đầu với backend/plugins/tempo/tasks/worklog_convertor.go và kiểm tra cách nó tạo ID miền của worklog; so sánh ID này với khóa chính của TempoWorklog và các ID khác có phạm vi theo kết nối được mô tả trong issue. Thêm một unit test cho trường hợp hai kết nối có ID worklog giống nhau. Hoàn thành khi mỗi kết nối tạo ra một hàng issue_worklogs riêng biệt và bài kiểm tra chạy thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Go
- Star
- 3.2k
- Fork
- 832
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 78
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/devlake
-
[Bug][Testmo] Runs, milestones and automation runs: only the first 100 are collectedCó thể đã có người làm @ShivamSharma43 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug][linker] LinkPrToIssue never matches lowercase issue keys (e.g. in branch names)Có thể đã có người làm @VictorColomb đã nhận 4 ngày trước. Đang mởtype/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/devlake#9283 · 1 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
Maintainer thường phản hồi trong vòng 2 ngày
-
type/bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 51/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug][JIRA Service API TOKEN] Jira API Gateway: saved service-account token truncated by varchar(255), causing Base64 errors and HTTP 500Có thể đã có người làm @RyoKusnadi đã nhận hôm nay. Đang mởtype/bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
apache/devlake#9328 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/devlake
Issue tương tự
-
Wayfinder sample agents don't reach the Data Plane on the quickstart packCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởType/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
thunder-id/thunderid#6402 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] ListCanteens and ListAvailableCanteenTags return Unimplemented (handlers are misnamed)Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TUM-Dev/Campus-Backend#678 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(app): fail closed if GetGeneralSetting fails during initializationCó thể đã có người làm @kalavt đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
agent-ready area:dsl
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
jmbarzee/temporal-architect#407 ·
Maintainer thường phản hồi trong vòng 1 ngày