Skip to content

feat(web): scheduled Dependabot checks, configured on the Dependabot page - #40

Merged
meddlin merged 1 commit into
mainfrom
claude/dependabot-schedule
Nov 2, 2026
Merged

meddlin merged 1 commit into
mainfrom
claude/dependabot-schedule

Conversation

@meddlin

@meddlin meddlin commented Nov 2, 2026

Copy link
Copy Markdown
Owner

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.

  • Settings UI: on/off, weekdays, and a time of day in server time (the page shows the zone; Docker is UTC unless TZ is set in .env). Saved in planning.db via append-only migration 5, because it is the user's choice and cannot be derived.
  • When a check is due (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.
  • Runner (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.
  • Starts at boot (this was weakness 1 of the existing in-process timer in the note): apps/web/server.mjs posts to /api/dependabot/start once 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) and npm run build pass. Mutation-checked: turning the slot comparison from <= into <, or ignoring when the schedule was saved, fails tests. In the browser against an isolated GITLIB_HOME: enabling and saving (next check shown, row in planning.db), the "pick at least one day" refusal, and, on the production server.mjs, /api/dependabot/start answering 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

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>
Base automatically changed from claude/dependabot-web to main November 2, 2026 22:06
@meddlin
meddlin merged commit 1156442 into main Nov 2, 2026
1 check passed
@meddlin
meddlin deleted the claude/dependabot-schedule branch November 2, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant