bujjibabukatta opened a new pull request, #8904:
URL: https://github.com/apache/devlake/pull/8904

   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`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to