Repository navigation
fix(github): leave lead time unset when an issue closes before creation - #9314
Merged
Merged
Conversation
GitHub can report closedAt before createdAt, for example for an issue that was closed and then transferred from another repository. Both GitHub issue extractors cast the negative duration to uint, which wraps to 18446744073709551572. The Convert Issues subtask then fails on every run with MySQL Error 1264 (out of range for issues.lead_time_minutes). Leave lead time unset in that case, as the Linear plugin already does.
klesh
approved these changes
Nov 6, 2026
klesh
left a comment
Contributor
There was a problem hiding this comment.
Good catch.
Thanks for your contribution.
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.
Summary
GitHub can return an issue with
closedAtbeforecreatedAt. We saw this on an issue that was closed and then transferred from another repository:createdAt2026-11-01T09:49:53Z,closedAt2026-11-01T09:05:12Z.Both GitHub issue extractors cast the negative duration to
uint:plugins/github/tasks/issue_extractor.goplugins/github_graphql/tasks/issue_extractor.goThe value wraps to
18446744073709551572in_tool_github_issues.lead_time_minutes. ThenConvert Issuesfails on every run, and the blueprint stops at that repository: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.
mainhas the same code.Screenshots
None. The change has no UI.
Other Information
TestIssueLeadTimeMinutes.go vetandgo testpass for./plugins/github/tasksand./plugins/github_graphql/tasks(Go 1.27, mocks frommake mock).pr-type/bug-fixlabel. I do not have permission to set labels.