fix(jira): use Jira created timestamp and inner join for changelog convertor (#8834)#8904
Open
bujjibabukatta wants to merge 3 commits into
Open
fix(jira): use Jira created timestamp and inner join for changelog convertor (#8834)#8904bujjibabukatta wants to merge 3 commits into
bujjibabukatta wants to merge 3 commits into
Conversation
Contributor
Author
|
Hi @klesh could you please approve pull request? |
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.
Fixes #8834
Problem
Two bugs in ConvertIssueChangelogs cause changelog items to be silently
dropped from the domain layer:
Incremental filter (line 107) filters on
_tool_jira_issue_changelog_items.created_atwhich is the DevLake internal DB insertion timestamp (NoPKModel.CreatedAt),
not the Jira changelog's Created date. Changelog items inserted in the same
batch can fall on either side of the
sincecutoff, silently dropping itemsfrom that batch on the next incremental run.
LEFT JOIN on
_tool_jira_board_issueswithboard_idfilter in WHERE clauseis a LEFT JOIN used as INNER JOIN. Any issue not in board_issues produces a
NULL board_id row which the WHERE silently drops. Moving board_id into the
JOIN condition as INNER JOIN makes intent explicit and eliminates duplicate
rows when an issue belongs to multiple boards.
Changes
backend/plugins/jira/tasks/issue_changelog_convertor.go:LEFT JOIN _tool_jira_board_issuestoINNER JOINwithboard_id = ?in the join condition instead of WHERE
_tool_jira_issue_changelog_items.created_atto
_tool_jira_issue_changelogs.created