Skip to content

feat(core): store Dependabot runs, lock concurrent checks, add dismissals - #38

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

meddlin merged 1 commit into
mainfrom
claude/dependabot-storage

Conversation

@meddlin

@meddlin meddlin commented Nov 2, 2026

Copy link
Copy Markdown
Owner

What this adds

Slice 2 of the Dependabot watch, stacked on #37 (base branch is #37's; GitHub retargets it to main when #37 merges). Items 6 (the lease) and 7 (storage, dismiss/snooze) of the Recommendation in docs/dependabot-watch.md.

  • Storage (packages/core/src/dependabot/store.ts): dependabot_runs and dependabot_findings in gitlib.db, created with CREATE TABLE IF NOT EXISTS like the community cache. Findings are derived from GitHub, so they live with the other rebuildable data. The newest 60 runs are kept.
  • Partial failure is recorded per PR: if one owner could not be asked (network, rate limit), the previous run's findings for its repositories are carried forward with their original observation time, and the run is flagged NOT CHECKED. One blip no longer empties the list.
  • Lease: one row, taken under BEGIN IMMEDIATE with a 5 s busy timeout (the way the planning store opens its database), expiring after 15 minutes so a crashed holder cannot block checks forever. GitLibApp.runDependabotCheck() takes it, saves the run, and always releases it; it throws DependabotBusyError (a GitLibError) if another check holds it.
  • Dismiss / snooze is the user's decision and cannot be re-derived, so it is in planning.db via append-only migration 4 (dependabot_dismissals), keyed by lowercased owner/repo + number.
  • CLI: check now saves by default (--no-save prints only and takes no lock); new show (last saved run, no network, works without a token), dismiss <owner/repo#n> [--until DATE] and restore. Reports leave dismissed/snoozed PRs out and print them under Put aside (n). JSON gained run, per-PR observed_at and dismissed.

Review notes

  • The research note proposed the lease; carry-forward is my addition, to meet its point that partial failure should be per PR.
  • check writing to gitlib.db changes what feat(core): report-only Dependabot check for starred repositories #37's README said ("report-only"); the README section is updated. It still never writes to GitHub.
  • A user-dismissed PR that Dependabot replaces gets a new number and so comes back, which is intended.

Verification

npm run typecheck, npm test (429 tests; 32 new here) and npm run build pass. Mutation-checked: disabling the carry-forward, or ignoring lease expiry, fails tests.

🤖 Generated with Claude Code

…s, add dismissals

Each `gitlib dependabot check` now saves its result as the newest run in
gitlib.db (dependabot_runs, dependabot_findings; the newest 60 runs are kept),
so the findings can be read without the network. A lease row taken under
BEGIN IMMEDIATE stops two checks from running at once; it lapses after 15
minutes if the holder crashed. Findings for an owner that could not be asked
are carried forward from the previous run with their original time.

Putting a PR aside is the user's decision, so it lives in planning.db
(append-only migration 4) rather than in the derived findings.

CLI: `check` saves by default (`--no-save` to skip), plus `show`, `dismiss`
and `restore`. Reports leave dismissed or snoozed PRs out and count them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Base automatically changed from claude/distracted-ardinghelli-87752b to main November 2, 2026 22:05
@meddlin
meddlin merged commit 9d9dcbc into main Nov 2, 2026
1 check passed
@meddlin
meddlin deleted the claude/dependabot-storage 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