fix(jira): keep changelog items that share a field in one history entry (#9057) - #9062
Open
mfrancisc wants to merge 2 commits into
Open
fix(jira): keep changelog items that share a field in one history entry (#9057)#9062mfrancisc wants to merge 2 commits into
mfrancisc wants to merge 2 commits into
Conversation
…ry (apache#9057) Jira emits multiple items with the same field in one changelog (add/remove of components, fixVersions, labels). The old PK dropped all but one. Add a content-stable ItemIndex so both rows are stored and converted. Co-authored-by: Cursor <cursoragent@cursor.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
fieldin one history entry (add/remove ofFix Version,Component,labels, etc.)._tool_jira_issue_changelog_itemswas keyed by(connection_id, changelog_id, field), so the extractor silently kept only one row.item_indexto the primary key. Indexes are assigned from item content (from/to values and strings), not JSON array order, so re-extract of the same changelog stays stable if Jira reshufflesitems.issue_changelogs.idincludesitem_index. The migration rebuilds the PK, resets Jira extract/convert subtask state so the next pipeline re-extracts from existing raw JSON, and drops old domain rows that used the previous id format.Fixes #9057