pavankadabala-png commented on issue #8906: URL: https://github.com/apache/devlake/issues/8906#issuecomment-4686823470
I had a look through the webhook plugin code to figure out why this is happening. In `backend/plugins/webhook/api/issues.go`, the `closeIssue` function (the one behind `POST /plugins/webhook/:connectionId/issue/:issueKey/close`) sets `Status` to `DONE` and clears `OriginalStatus` for both the issue and the incident record, but it never sets `ResolutionDate`. The DORA FDRT metric is calculated from `incidents.resolution_date`, so an incident closed this way just never shows up in that dashboard - which lines up with what you found, and why manually updating `resolution_date` in the DB fixes it. I think the fix is pretty contained: when `closeIssue` sets status to `DONE`, it should also set `ResolutionDate` to the current time if it's not already set (for both the issue and incident records), and recalculate `LeadTimeMinutes` the same way `postIssue` already does. I'd be glad to put a PR together for this if no one's working on it yet. Let me know if that approach makes sense, or if you'd rather allow the resolution date to be passed in explicitly on the close call instead of just defaulting to now. -- 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]
