Skip to content

Auto-merge green Dependabot updates and group the pm toolchain into one daily PR - #132

Merged
unbraind merged 3 commits into
mainfrom
ci/auto-merge-green-dependabot-updates
Oct 4, 2026
Merged

unbraind merged 3 commits into
mainfrom
ci/auto-merge-green-dependabot-updates

Conversation

@unbraind

@unbraind unbraind commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

What

  • .github/dependabot.yml: npm is checked daily; @unbrained/pm-cli and pm-* packages arrive as one pm-toolchain PR, other minor/patch updates as one dependencies PR. Other ecosystems are unchanged.
  • .github/workflows/dependabot-auto-merge.yml: for Dependabot PRs only (and only in unbraind), dependabot/fetch-metadata (SHA-pinned v3.1.0) classifies the update; the pm-toolchain group (calendar-versioned, so a year rollover reads as semver-major) and every other non-major update get gh pr merge --auto --squash. Workflow default permissions are {}; the job alone gets contents: write + pull-requests: write.
  • Repository setting: auto-merge allowed, merged branches deleted.

Why

Fleet rule ([companion pm-cli-website-6d05]): a pm CLI release must reach every package without a hand-written certification PR. Branch protection still requires test (22), test (26), so nothing merges red; a bump that fails CI stays open as a real defect. Major updates still need a person. Same change as the reviewed pilot unbraind/pm-presets#118.

pm item

Summary by Sourcery

Automate the delivery of passing Dependabot updates while preserving required checks and human review for major dependency changes.

New Features:

  • Configure daily npm dependency checks with grouped pull requests for the PM toolchain and other minor or patch updates.
  • Enable automatic squash merging for eligible green Dependabot pull requests while leaving major updates for manual review.

Enhancements:

  • Apply least-privilege permissions to the Dependabot auto-merge workflow and pin its metadata action.

Chores:

  • Record the dependency automation work in the PM task history and changelog.

Summary by cubic

Automates mechanical dependency bumps so green Dependabot PRs merge without a hand-written certification PR.

Dependabot checks npm daily and groups @unbrained/pm-cli and pm-* packages into one pm-toolchain PR and other minor/patch updates into one dependencies PR. A least-privilege workflow enables GitHub squash auto-merge as soon as the required checks pass; a failing bump stays open as a defect.

  • pm-toolchain is calendar-versioned, so a year rollover reads as semver-major and still auto-merges; everything else auto-merges only when dependabot/fetch-metadata classifies it minor or patch, so an unclassified update waits for a person.
  • The workflow grants contents: write and pull-requests: write to its job only, with dependabot/fetch-metadata SHA-pinned at v3.1.0.
  • Records the work in pm item pm-beads-lgqs and the changelog.

Written for commit af6a4fc. Summary will update on new commits.

Review in cubic

…ne daily PR

Version bumps of @unbrained/pm-cli, pm-ops and pm-changelog are mechanical.
Dependabot now checks npm daily and groups the pm toolchain (and other
minor/patch updates) into single pull requests; a least-privilege workflow
enables squash auto-merge for every non-major Dependabot PR, so it lands as
soon as the required checks pass and a failing bump stays open as a defect.

pm item: pm-beads-lgqs

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @unbraind, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 15 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: eb8265e8-ca9c-4d22-af28-fe86a032d5db
📥 Commits

Reviewing files that changed from the base of the PR and between f768240 and af6a4fc.

📒 Files selected for processing (5)
  • .agents/pm/history/pm-beads-lgqs.jsonl
  • .agents/pm/tasks/pm-beads-lgqs.toon
  • .github/dependabot.yml
  • .github/workflows/dependabot-auto-merge.yml
  • CHANGELOG.md

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a67cfefa-7486-462a-90eb-b541457c63e2
📥 Commits

Reviewing files that changed from the base of the PR and between f768240 and f5106b9.

📒 Files selected for processing (5)
  • .agents/pm/history/pm-beads-lgqs.jsonl
  • .agents/pm/tasks/pm-beads-lgqs.toon
  • .github/dependabot.yml
  • .github/workflows/dependabot-auto-merge.yml
  • CHANGELOG.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


Summary by CodeRabbit

  • New Features
    • Dependabot checks for updates daily and groups toolchain packages into a single update.
    • Eligible non-major updates are squash-merged automatically once required checks pass.
    • Major-version updates are excluded from automatic merging.

Walkthrough

Dependabot now checks npm updates daily and groups toolchain packages separately from other minor and patch updates. A new workflow enables squash auto-merge for eligible Dependabot pull requests. Task records and the changelog document the rollout.

Changes

Dependabot update automation

Layer / File(s) Summary
Daily update groups
.github/dependabot.yml, .agents/pm/tasks/pm-beads-lgqs.toon, .agents/pm/history/pm-beads-lgqs.jsonl, CHANGELOG.md
Dependabot checks for npm updates daily. The pm-toolchain group matches @unbrained/pm-cli and pm-*; the dependencies group excludes those packages and accepts minor and patch updates. The task records and changelog describe the configuration and rollout.
Conditional squash auto-merge
.github/workflows/dependabot-auto-merge.yml
The workflow fetches dependency metadata and enables squash auto-merge for pm-toolchain updates or updates that are not semver-major. The job grants contents and pull-request write permissions.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Dependabot as Dependabot PR
  participant Workflow as Auto-merge workflow
  participant Metadata as Dependency metadata
  participant GitHub as GitHub PR
  Dependabot->>Workflow: Open or update pull request
  Workflow->>Metadata: Fetch dependency metadata
  Workflow->>GitHub: Enable squash auto-merge when eligible
Loading

Merge Risk: ⚪ Minimal · up to f5106

Dependabot now opens daily grouped npm updates, and eligible updates merge automatically once the required checks pass. Major updates outside the pm toolchain still wait for a person. No blocking issue remains.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to f5106

The workflow limits execution to Dependabot and uses a pinned action, but that action runs with requested repository-write permissions before merge checks finish. Dependency automation can also propose updates to the action itself, creating a pre-merge supply-chain trust path. Required branch protections are asserted but were not independently verified.

Retained concerns

  • Medium · security · inferred: A Dependabot update to fetch-metadata can place a newly proposed upstream action revision inside the write-capable pull_request job before review or required checks complete. If that upstream revision is compromised, it can access repository contents and pull-request write authority before merge protection applies. SHA pinning prevents tag retargeting, but does not independently authorize a replacement SHA proposed by the updater. Effective repository-specific restrictions remain unverified.
Security review details

Security Blast Radius

  • inferred — The identified authority is scoped to the repository running the job: contents and pull-request writes. Wider organization, cloud, tenant, or data-store authority is not established. Downstream exposure through later builds or releases was not mapped.

Security Findings and Attack Paths

  • inferred — The material attack path requires control of an upstream action revision that Dependabot proposes: the updater changes its pinned reference, the PR workflow executes that revision, and the action accesses the job token before merge checks finish. No compromise of the currently pinned action was observed.

Trust Boundaries and Controls

  • observed — Dependabot identity gating excludes ordinary PR authors, and SHA pinning fixes the action revision for each workflow definition. Neither independently authenticates a future upstream revision. GitHub explicitly documents increasing Dependabot token permissions, so the trigger's default read-only behavior is not sufficient counterevidence against the requested write authority.

Resilience and Maintainability Implications

  • inferred — Required branch checks provide merge containment only when enforced by repository policy. They do not prevent preceding action execution. Missing source-level revocation does not by itself demonstrate a stale-eligibility bypass, given GitHub's documented cancellation controls and unresolved update semantics.

Hardening Proposals

  • proposed — Keep privileged merge authorization on trusted base-branch workflow and action revisions, without executing PR-supplied dependency code. Bind authorization to the classified PR head, and include pending auto-merge requests when planning cancellation or rollback. Verify effective branch protections before relying on unattended merging.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: automatic merging of eligible Dependabot updates and daily grouping of PM toolchain updates.
Description check ✅ Passed The description explains the Dependabot schedule, update groups, auto-merge conditions, permissions, and related task. It directly matches the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR changes npm Dependabot checks to daily grouped updates and adds a SHA-pinned workflow that enables squash auto-merge for green Dependabot PRs: all non-major updates and the calendar-versioned PM toolchain are eligible, while unrelated major updates remain manual. Repository auto-merge and branch-deletion settings are also required for the behavior described.

Flow diagram for Dependabot update grouping and auto-merge

flowchart TD
    Schedule[Daily npm Dependabot check] --> Group{Update group}
    Group -->|"@unbrained/pm-cli or pm-*"| PM[pm-toolchain PR]
    Group -->|Other minor or patch package| Dependencies[dependencies PR]
    PM --> Metadata[fetch-metadata]
    Dependencies --> Metadata
    Metadata --> Eligible{pm-toolchain or non-major}
    Eligible -->|Yes| AutoMerge[gh pr merge --auto --squash]
    Eligible -->|No| Manual[Manual review required]
    AutoMerge --> Checks{Required checks pass}
    Checks -->|Yes| Merged[Merged and branch deleted]
    Checks -->|No| Open[PR remains open]
Loading

File-Level Changes

Change Details Files
Configure Dependabot to run daily and group package updates by release policy.
  • Group the PM CLI and pm-* packages into a single daily pm-toolchain PR.
  • Group non-PM minor and patch updates into a separate dependencies PR.
  • Leave other package ecosystems unchanged.
.github/dependabot.yml
Automatically enable squash auto-merge for eligible green Dependabot pull requests with narrowly scoped permissions.
  • Pin dependabot/fetch-metadata to v3.1.0 by commit SHA and use it to classify dependency groups and update types.
  • Auto-merge the PM toolchain group and all non-major updates, while leaving other major updates for manual review.
  • Restrict execution to Dependabot pull requests in the unbraind organization and grant write permissions only to the job.
.github/workflows/dependabot-auto-merge.yml
Record the associated PM task and history artifacts.
  • Add the task definition and JSONL history entry for pm-beads-lgqs.
.agents/pm/tasks/pm-beads-lgqs.toon
.agents/pm/history/pm-beads-lgqs.jsonl

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Enables automatic merging of dependency updates via GitHub workflow.

The reviewed changes appear safe to merge, with the previous finding fixed and no new blocking issues.

What we checked:

  • Toolchain updates enter the wrong group: No. dependencies excludes exactly the names and patterns claimed by pm-toolchain.

Summary

Adds daily npm dependency groups and a Dependabot-only workflow that requests squash auto-merge.

  • pm-toolchain updates remain eligible across calendar-year version changes. unbraind explicitly describes this exception as intentional.
  • Other updates must be classified as minor or patch; unknown values wait for a person.
  • The previous finding is fixed. No new actionable issues were found in the changes since the last review.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Dependabot pull request in unbraind] --> B[Read update metadata]
  B --> C{pm-toolchain or minor or patch?}
  C -->|Yes| D[Request squash auto-merge]
  C -->|No| E[Wait for a person]
  D --> F[GitHub applies required merge checks]
  F -->|Pass| G[Merge]
  F -->|Not passed| H[Keep pull request open]
Loading

Reviews (3) · Last reviewed commit: "Allow-list minor and patch updates and d..."

Comment thread .github/workflows/dependabot-auto-merge.yml Outdated
@unbraind

unbraind commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review
@greptileai review

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

…sions

Review feedback: an update that fetch-metadata cannot classify must not
auto-merge, so the condition now requires semver-minor or semver-patch
outside the calendar-versioned pm-toolchain group. The job's write scopes
are documented, the dependencies group selects every package explicitly,
and the item's acceptance criteria name the pm-toolchain exception.

pm item: pm-beads-lgqs
@unbraind

unbraind commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review
@greptileai review

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 40 minutes.

@unbraind
unbraind merged commit 1c4f2eb into main Oct 4, 2026
13 checks passed
@unbraind
unbraind deleted the ci/auto-merge-green-dependabot-updates branch October 4, 2026 18:00
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