Stop setting issue due dates that are already in the past - #99
Conversation
When a dependency blew past its SLA threshold before Dependicus ever filed an issue, the calculated due date lands in the past and the issue was created already overdue. Issues are now filed without a due date in that case, for both the Linear due date field and the (due YYYY-MM-DD) suffix on GitHub issue titles. A due date already recorded on an existing issue is preserved, so a deadline set on an earlier run stays visible once it passes instead of being cleared. Fixes BIX-8427 Co-authored-by: Steve Rubin <srubin@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0962790. Configure here.
| : undefined; | ||
|
|
||
| const dueDateStr = dueDate ? formatDueDateForTitle(dueDate) : undefined; | ||
| const dueDateStr = resolveDueDate(calculatedDueDate, existingIssue?.title); |
There was a problem hiding this comment.
Past due dates break GitHub matching
Medium Severity
Once a calculated due date has passed, resolveDueDate drops the (due …) suffix because there is no open issue title to read it back from. GitHub reopen and PR dedup both require an exact title match, so a closed issue or ready-for-review PR that still has the suffix is missed and a duplicate issue is created.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 0962790. Configure here.
CI regenerates every lockfile and fails when one drifts. Yarn's transitive resolutions (node-gyp and friends) had moved on since the last refresh, so this brings yarn.lock back in line with what 'mise update-all-lockfiles' produces. Co-authored-by: Steve Rubin <srubin@users.noreply.github.com>


What's wrong
When a dependency blows past its SLA threshold before Dependicus ever files an issue, the calculated due date (first required version's publish date +
thresholdDays) lands in the past. The issue was then created already overdue, e.g.Update temporalio from 1.3.0 to at least 1.4.0 (due 2024-05-06)filed in 2026. Fixes BIX-8427.What changed
isDueDateInPast(dueDate, now?)helper insrc/core/utils/versionUtils.ts, exported from@dependicus/core. It compares by calendar day in UTC — the same way due dates are serialized onto issues — so a due date of today still counts as upcoming.resolveDueDatehelper before writing it:(due YYYY-MM-DD)suffix in the title and no due date row in the body. The issue still reports how many days overdue the dependency is.(due …)suffix on the existing title, so titles and bodies stay stable and no needless updates are pushed.Testing
New tests cover the helper plus both reconcilers (creation, update-preserves-existing, update-doesn't-add-past-date, and a still-upcoming due date that is set as before). I confirmed all five new reconciler assertions fail when the past-date check is neutered. Full suite: 921 passing, plus lint, format, and typecheck clean.
Beyond unit tests, I ran the real CLI in
--dry-runmode against this repo's own dependency data, once against a build ofmainand once against this branch. Two dependencies are genuinely past their thresholds, andmainfiles them with due dates that had already passed:Note on #95
This supersedes #95, which took the same "drop the date if it's in the past" approach but folded it into
calculateDueDateitself. That variant also wiped the due date off every existing issue the moment its deadline passed, since the reconcilers passundefinedstraight through as an explicitnullon update. This PR keepscalculateDueDatea pure calculation and applies the policy at the point of writing, so already-set deadlines survive.Our dependency deadlines were flying south for the winter and never coming back; they're staying put now, and no goose gets a due date it has already waddled past. 🦆
Linear Issue: BIX-8427