JiraIssueChangelogItems primary key collision when Jira reports multiple items with the same field in one changelog entry
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 64/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- backend, data-engineering, databases
Hướng nghiên cứu
Bắt đầu với backend/plugins/jira/models/issue_changelog.go, sau đó lần theo đường dẫn upsert của Jira extractor cho JiraIssueChangelogItems. Tái hiện hai item có cùng field và kiểm tra các hệ quả của thay đổi schema; được coi là hoàn tất khi cả hai item đều được persist mà không xảy ra collision sau khi re-extraction, với regression coverage cho trường hợp đã báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
JiraIssueChangelogItems has a composite primary key of (ConnectionId, ChangelogId, Field). When Jira returns multiple items with the same Field value within a single changelog history entry, the second item silently overwrites the first on upsert.
Steps to reproduce
- Have a Jira issue where a single-value field (e.g.
fixVersions) is changed from value A to value B in one action - Jira's API represents this as two changelog items in the same history entry:
Fix Version: null → B(add)Fix Version: A → null(remove)
- Both items share the same
ChangelogIdandField = "Fix Version" - Run the Jira extractor — only one item survives in
_tool_jira_issue_changelog_items
Expected behavior
Both changelog items should be stored — the add and the remove.
Actual behavior
The second item overwrites the first because they collide on the primary key (ConnectionId, ChangelogId, Field).
Impact
Any downstream query that relies on changelog items to detect whether a specific value was ever added to a field (e.g. filtering issues by historical fixVersions) will produce incorrect results. This affects fixVersions, labels, components, affectedVersions, and any other field where Jira emits multiple items with the same field name in one history entry.
Suggested fix
Add a disambiguating column to the primary key — for example an item ordinal/index within the changelog entry. The model is in backend/plugins/jira/models/issue_changelog.go:
type JiraIssueChangelogItems struct {
ConnectionId uint64 `gorm:"primaryKey"`
ChangelogId uint64 `gorm:"primaryKey"`
Field string `gorm:"primaryKey"`
// no item-level disambiguator
}
Existing data would need re-extraction after the schema change, since collided rows already lost one of the two items.
Version
Verified on v1.0.3-beta10 and confirmed the PK is unchanged on main as of 2026-08-17.
- Ngôn ngữ chính
- Go
- Star
- 3.1k
- Fork
- 812
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 56
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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
-
type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
type/bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Tất cả issue của apache/devlake
Issue tương tự
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
microsoft/agent-framework-go#1179 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
[Bug]: OLLAMA_KEEP_ALIVE="5m" / "24h" crashes Ollama embedding and vision models with ValueError Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
infiniflow/ragflow#20223 · 1 reaction ·
-
bug needs triage pkg/translator/faro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
open-telemetry/opentelemetry-collector-contrib#51484 · 1 bình luận ·