Repository navigation
feat(core): report-only Dependabot check for starred repositories - #37
Merged
Merged
Conversation
`gitlib dependabot check [--json]` lists the open Dependabot PRs of the favorites that have a GitHub remote and sorts them into ready, review first, needs work and waiting. The verdict comes only from fields GitHub returns (mergeable, mergeStateStatus, reviewDecision, the check rollup, labels, and the update-type in Dependabot's commit-message block), never from the PR body. Suggestions are text only: `@dependabot rebase` / `recreate` where the research note says so, and never the merge commands retired on 2026-01-27. - core: pure `classify`, a GraphQL fetch behind a `DependabotBackend` interface (fake in tests, one search per owner plus a visibility lookup so a repository the token cannot see is not reported as empty), and `checkDependabot`, also exposed as `GitLibApp.checkDependabot`. - A missing or refused `statusCheckRollup` shows as "CI unknown" with the reason and is never ready: whether GraphQL rollups work with a fine-grained token is still undocumented. - `loadGitRemotes` moves from app.ts to remotes.ts (same export) so the new module does not import app.ts. Out of scope here: storage, web page, schedule, LLM explanations. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 2, 2026
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
gitlib dependabot check [--json]: the first slice of the Dependabot watch fromdocs/dependabot-watch.md. It builds on #36, which has merged and brought that research note tomain.It asks GitHub for the open Dependabot PRs of the repositories you have starred in gitlib (
RepoRecord.isFavorite, not GitHub stars) and sorts them into ready / review first / needs work / waiting, with the reasons and suggested actions as text. Report only: no LLM, no schedule, no web page, no storage, nothing written to GitHub orgitlib.db.classify(packages/core/src/dependabot/classify.ts) is a pure function overisDraft,mergeable,mergeStateStatus,reviewDecision, the check rollup, labels, branch and theupdate-typefrom the commit-message YAML block. It never reads the PR body, so release-note text cannot move a PR between buckets. Suggestions are@dependabot rebase/recreatewhere the note says so; the merge commands retired on 2026-01-27 are never suggested (a test sweeps ~9,000 input combinations to check that, and that "ready" is only ever returned when nothing stands against it).github-backend.ts) is behind aDependabotBackendinterface with a fake in the tests, injected likeSearchBackend/ChatBackend. One GraphQL search per owner (is:pr is:open author:app/dependabot user:OWNER archived:false), filtered to favorites byowner/reposlug; token fromGITLIB_GITHUB_TOKENorGITHUB_TOKEN.groupReposByGitHubSlugis core's own equivalent of the web helper (linked worktrees collapse, case-insensitive). Favorites it cannot map are reported with the reason, never dropped.--json(snake_case). Exit status 1 only if a whole owner could not be checked. Other commands never need GitHub.The open Checks question is not hidden
GitHub's token guide lists the Checks API as unsupported for fine-grained tokens, and whether GraphQL
statusCheckRollupworks with one is undocumented. A missing or refused rollup is shown asCI unknown: <reason>(quoting GitHub's own error when there is one) and filed under Review first, never as ready. So with a fine-grained token that cannot read checks you will seeCI unknownon every PR rather than a false green. Settling it is item 11 (a) of the note, which has not been run: the fixtures are shaped like the GraphQL response from the docs, not captured from a real one.Things worth a look in review
NOT CHECKED.securitylabel stands in),isRequiredper check, a retry forUNKNOWNmergeability, storage, the page, the schedule.loadGitRemotesmoved fromapp.tstoremotes.ts(same export from@gitlib/core) so the new module does not importapp.ts.createApplication/GitLibAppgain an optionaldependabotBackend;GitLibApp.checkDependabot()is the function the future web "Check now" button would call.Verification
npm run typecheck,npm test(397 tests, 84 new inpackages/core/test/dependabot.test.tsandapps/cli/test/dependabot.test.ts) andnpm run buildpass.UNKNOWNmergeability, makes tests fail.GITLIB_HOMEthrough the realfetchagainst a local stand-in GraphQL server (dummy token); no request went to GitHub and no real token was used.🤖 Generated with Claude Code