Repository navigation
gardener: Merge green Dependabot pull requests every four hours - #208
Conversation
|
| - every check run at the head, | ||
| `GET /repos/{owner}/{repo}/commits/{sha}/check-runs?per_page=100&filter=latest`; |
There was a problem hiding this comment.
🔴 Green Dependabot updates remain unmerged
For a Dependabot update with only PR-triggered CI, check-runs on the head lacks a successful GitHub Actions run. CI tests the PR merge commit, so the ready gate never admits that update.
Learn more
The repository's CI runs on pull_request events, where GitHub Actions associates its runs with the pull request merge commit. The task instead reads check runs for the PR head SHA and requires one successful run from github-actions. Without another workflow that runs on the PR head, that condition remains false even after the PR's CI is green.
Example: Dependabot opens #300 at head abc; CI succeeds for the PR merge ref at xyz. The request for abc has no successful GitHub Actions run, and #300 is left out of the ready group despite green CI.
Recommended fix: Inspect checks associated with the PR merge commit used by CI, while binding the tested commit to the PR head and base SHAs and revalidating it at merge time.
Was this helpful? React with 👍 or 👎 to provide feedback.
commit: |
| 1. Find Dependabot's open pull requests with | ||
| `GET /search/issues?q=repo:{owner}/{repo}+is:pr+is:open+author:app/dependabot&per_page=50`. Use | ||
| only each result's `number`. If there are none, propose nothing and finish. "Oldest" below means | ||
| the lowest number. Look at no more than the 15 oldest in one run; later runs reach the rest. |
There was a problem hiding this comment.
🔴 Stalled updates starve newer ready updates
With 15 older open updates stalled, dependabot-merge selects those same 15 on every run. A ready update behind them never gets examined or merged.
Learn more
The task searches open Dependabot pull requests, then inspects only the 15 oldest. A failed, waiting, conflicting, or manually reviewed pull request remains open. When 15 such requests occupy the first 15 positions, subsequent scheduled runs select them again and never reach later requests.
Example: Pull requests #1–#15 remain open with failing checks; #16 is green. Every four-hour run inspects #1–#15, so #16 stays unmerged indefinitely.
Recommended fix: Advance a durable cursor through ordered search pages, or exclude already-handled older requests from the next run without losing the ability to revisit them. Ensure the cursor wraps around and that stalled requests still get periodic rechecks.
Was this helpful? React with 👍 or 👎 to provide feedback.
Adds a
dependabot-mergetask. Every four hours, Gardener looks at open Dependabot pull requests:main, so it's clear whether the update caused the failure. It doesn't try to fix anything..github/, for example an Actions version bump: it never merges these. It comments once per pull request, asking a maintainer to review it.@dependabot rebase.How the task is scoped
dependabot[bot], on adependabot/branch in this repository, and intomain.pull_request.comment.createandpull_request.merge. A run proposes at most 5 merges and 10 comments.What to expect
mainfor them. CI catches up on the next push by a person.Tested on a demo repository first