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

   ### Summary
   
   GitHub can return an issue with `closedAt` before `createdAt`. We saw this 
on an issue that was closed and then transferred from another repository: 
`createdAt` 2026-11-01T09:49:53Z, `closedAt` 2026-11-01T09:05:12Z.
   
   Both GitHub issue extractors cast the negative duration to `uint`:
   
   - `plugins/github/tasks/issue_extractor.go`
   - `plugins/github_graphql/tasks/issue_extractor.go`
   
   The value wraps to `18446744073709551572` in 
`_tool_github_issues.lead_time_minutes`. Then `Convert Issues` fails on every 
run, and the blueprint stops at that repository:
   
   ```
   subtask Convert Issues ended unexpectedly
   Error 1264 (22003): Out of range value for column 'lead_time_minutes' at row 
96
   ```
   
   This PR adds one helper, `IssueLeadTimeMinutes`, and uses it in both 
extractors. When the close time is before the creation time, the helper leaves 
lead time unset. The Linear plugin already does this 
(`plugins/linear/tasks/issue_convertor.go`). Other issues keep the same value 
as before.
   
   ### Does this close any open issues?
   
   No open issue. Found on v1.0.3-beta18. `main` has the same code.
   
   ### Screenshots
   
   None. The change has no UI.
   
   ### Other Information
   
   - Tests: new `TestIssueLeadTimeMinutes`. `go vet` and `go test` pass for 
`./plugins/github/tasks` and `./plugins/github_graphql/tasks` (Go 1.27, mocks 
from `make mock`).
   - The GitLab and Gitee issue extractors use the same cast. I did not change 
them, because I could not reproduce a negative duration there. I can add them 
to this PR if you want.
   - Please add the `pr-type/bug-fix` label. I do not have permission to set 
labels.
   


-- 
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