From 00e82eb2f6299de3250664ecdf420172e3e92225 Mon Sep 17 00:00:00 2001 From: Darrien Rushing Date: Mon, 2 Nov 2026 15:43:42 -0600 Subject: [PATCH] feat(core): store Dependabot runs and findings, lock concurrent checks, 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 --- README.md | 33 +- apps/cli/src/cli.ts | 93 ++++- apps/cli/src/render.ts | 111 ++++-- apps/cli/test/dependabot.test.ts | 147 ++++++++ docs/dependabot-watch.md | 11 +- packages/core/src/app.ts | 62 ++++ packages/core/src/dependabot/dismissals.ts | 29 ++ packages/core/src/dependabot/index.ts | 2 + packages/core/src/dependabot/store.ts | 266 ++++++++++++++ packages/core/src/planning/migrations.ts | 15 + packages/core/src/planning/store.ts | 35 ++ packages/core/src/planning/types.ts | 13 + packages/core/test/dependabot-fixtures.ts | 136 +++++++ packages/core/test/dependabot-store.test.ts | 382 ++++++++++++++++++++ packages/core/test/dependabot.test.ts | 131 +------ 15 files changed, 1283 insertions(+), 183 deletions(-) create mode 100644 packages/core/src/dependabot/dismissals.ts create mode 100644 packages/core/src/dependabot/store.ts create mode 100644 packages/core/test/dependabot-fixtures.ts create mode 100644 packages/core/test/dependabot-store.test.ts diff --git a/README.md b/README.md index 627ba1d..d8d5a17 100644 --- a/README.md +++ b/README.md @@ -155,15 +155,18 @@ reasonable start; check with `ollama ps` on that machine that the model is fully `gitlib dependabot check` reports which open [Dependabot](https://docs.github.com/code-security/dependabot) pull requests on your **starred** repositories can be merged and which need work. "Starred" is the Star toggle in gitlib (`repo_favorites`), not GitHub stars, and only favorites with a github.com remote can be watched; the report says -how many were skipped and why. It is report-only: nothing is written to GitHub or to gitlib's database, no model is -involved, and the verdict comes only from fields GitHub returns (never from the PR text, which quotes third-party -release notes). The research and the reasoning behind it are in -[`docs/dependabot-watch.md`](docs/dependabot-watch.md). +how many were skipped and why. Nothing is ever written to GitHub, and the verdict comes only from fields GitHub +returns (never from the PR text, which quotes third-party release notes). The research and the reasoning behind it +are in [`docs/dependabot-watch.md`](docs/dependabot-watch.md). ```bash export GITLIB_GITHUB_TOKEN=... # or GITHUB_TOKEN; GitHub's GraphQL API does not answer without one -gitlib dependabot check # grouped by bucket, with reasons and suggested actions +gitlib dependabot check # asks GitHub, saves the result, prints it grouped by bucket gitlib dependabot check --json # the same, machine-readable +gitlib dependabot check --no-save # print only; nothing is stored and no lock is taken +gitlib dependabot show [--json] # the newest saved check, without contacting GitHub +gitlib dependabot dismiss meddlin/gitlib#41 [--until 2026-12-01] # put a PR aside +gitlib dependabot restore meddlin/gitlib#41 ``` | Bucket | Meaning | @@ -179,11 +182,20 @@ PRs, plus one small lookup that tells which watched repositories your token cann few points of the 5,000 an hour; the report prints the actual cost. Anything it could not check is listed under `NOT CHECKED` or `INCOMPLETE` rather than left out, and the command exits with status 1 if a whole owner failed. +**Saved runs.** Each check is stored in `gitlib.db` (`dependabot_runs`, `dependabot_findings`; the newest 60 runs +are kept) so the findings can be read offline and compared over time; they are derived from GitHub and can be fetched +again. If one owner cannot be asked (network, rate limit), the last findings for its repositories are kept, marked +`last seen