Skip to content

fix(jira): use Jira created timestamp and inner join for changelog convertor (#8834)#8904

Open
bujjibabukatta wants to merge 3 commits into
apache:mainfrom
bujjibabukatta:fix/#8834
Open

fix(jira): use Jira created timestamp and inner join for changelog convertor (#8834)#8904
bujjibabukatta wants to merge 3 commits into
apache:mainfrom
bujjibabukatta:fix/#8834

Conversation

@bujjibabukatta
Copy link
Copy Markdown
Contributor

Fixes #8834

Problem

Two bugs in ConvertIssueChangelogs cause changelog items to be silently
dropped from the domain layer:

  1. Incremental filter (line 107) filters on _tool_jira_issue_changelog_items.created_at
    which 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 since cutoff, silently dropping items
    from that batch on the next incremental run.

  2. LEFT JOIN on _tool_jira_board_issues with board_id filter in WHERE clause
    is 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:
    • Change LEFT JOIN _tool_jira_board_issues to INNER JOIN with board_id = ?
      in the join condition instead of WHERE
    • Change incremental filter from _tool_jira_issue_changelog_items.created_at
      to _tool_jira_issue_changelogs.created

@bujjibabukatta
Copy link
Copy Markdown
Contributor Author

Hi @klesh could you please approve pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jira changelog items collected but not converted to domain layer (issue_changelogs)

1 participant