Repository navigation
feat(web): scheduled Dependabot checks, configured on the Dependabot page - #40
Merged
Merged
Conversation
The Dependabot page gets a Schedule panel: on or off, days of the week and a time of day (server time). The choice is the user's, so it is stored in planning.db (append-only migration 5). A pure calendar function (previousSlot, nextSlot, isCheckDue) decides when a check is due from the saved runs rather than an in-memory timer, so a restart catches up on a missed slot, turning the schedule on at 14:00 does not owe 08:00, a check started any other way counts for the slot, and a run that could not ask some owner is retried for a few hours. DependabotScheduler ticks every minute inside the web server, takes the same lease as the CLI and the Check now button, and backs off for 30 minutes after a failure, which the page shows. The production server starts it at boot (server.mjs posts to /api/dependabot/start once it is listening); the dev server starts it with the first page. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
What this adds
Slice 4 of the Dependabot watch, stacked on #39 (then #38, #37). This is the schedule you asked where to configure: Dependabot page → Schedule.
TZis set in.env). Saved inplanning.dbvia append-only migration 5, because it is the user's choice and cannot be derived.packages/core/src/dependabot/schedule.ts, pure and unit-tested): the latest slot must be newer than both the last saved run (started by anyone) and the moment the schedule was saved. That gives the catch-up after a restart, no surprise run for a slot before you turned it on, and "Check now" or the CLI counting for the slot. A run that could not ask some owner is retried after 30 minutes, for up to six hours after the slot.DependabotScheduler): ticks every minute, never overlaps itself, takes the same lease as the CLI and the button, stays quiet when another process holds it, and after a failure (rejected token, GitHub down) waits 30 minutes and shows the error under the panel.apps/web/server.mjsposts to/api/dependabot/startonce listening. The dev server starts it with the first page that asks for Dependabot data.Decision worth a second look
The research note's Recommendation 6 preferred a host scheduler running the CLI over an in-process timer. You chose the in-app schedule, so that is what this is, built to answer the note's listed weaknesses (lazy start, interval-based, state in memory). What remains is the one the note names for any in-process timer: it does not run while the server or machine is down. The CLI plus cron or a systemd timer still works beside it, sharing the lock; the README says to use that on a laptop that sleeps.
Verification
npm run typecheck,npm test(473 tests; 32 new for the calendar, the runner with a fake clock, the migration, and the web view) andnpm run buildpass. Mutation-checked: turning the slot comparison from<=into<, or ignoring when the schedule was saved, fails tests. In the browser against an isolatedGITLIB_HOME: enabling and saving (next check shown, row inplanning.db), the "pick at least one day" refusal, and, on the productionserver.mjs,/api/dependabot/startanswering 204 and an overdue slot being caught up on its own (a dummy token made GitHub answer 401, which the panel showed).🤖 Generated with Claude Code