Skip to content

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

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 verified Dependabot updates while consolidating pm toolchain bumps into a daily release PR.

New Features:

  • Automatically enable squash auto-merge for green, non-major Dependabot updates, including the grouped pm toolchain updates.
  • Group the pm CLI and related packages into a daily Dependabot pull request.

Enhancements:

  • Keep major and unclassified dependency updates subject to manual review while required status checks continue to gate merges.
  • Restrict workflow permissions to the auto-merge job and pin the Dependabot metadata action.

CI:

  • Add a Dependabot auto-merge workflow scoped to Dependabot pull requests in the unbraind organization.

Chores:

  • Record the change in the project changelog and pm task history.

Summary by cubic

Auto-merges green Dependabot updates so pm toolchain version bumps reach every package without a hand-written certification PR.

  • Dependabot now checks npm daily and groups @unbrained/pm-cli and pm-* packages into one pm-toolchain PR; other minor/patch updates land as a separate, disjoint dependencies PR.
  • A new dependabot-auto-merge.yml workflow runs only for Dependabot PRs in unbraind and enables squash auto-merge for all pm-toolchain PRs (calendar-versioned, so a year rollover reads as semver-major) and for any other update explicitly classified as minor or patch; an unclassified or major update waits for a person.
  • The workflow keeps empty default permissions; only the job gets contents: write and pull-requests: write. Branch protection still requires test (22) and test (26), so a failing bump stays open as a defect.

Rolled out from the reviewed pilot unbraind/pm-presets#118.

Written for commit 2fcaf09. 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-rl-3q1e

@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: 1828535c-65ae-4882-b09a-e0c5b34ff0e1
📥 Commits

Reviewing files that changed from the base of the PR and between 3a67716 and 2fcaf09.

📒 Files selected for processing (5)
  • .agents/pm/history/pm-rl-3q1e.jsonl
  • .agents/pm/tasks/pm-rl-3q1e.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: 96b904ac-4208-498f-9454-ef910332cb1f
📥 Commits

Reviewing files that changed from the base of the PR and between 3a67716 and e323934.

📒 Files selected for processing (5)
  • .agents/pm/history/pm-rl-3q1e.jsonl
  • .agents/pm/tasks/pm-rl-3q1e.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
    • Dependency updates are now checked daily and grouped into toolchain updates and other minor or patch updates.
    • Eligible updates can be squash-merged automatically after required checks pass. Major updates outside the toolchain group are not auto-merged.

Walkthrough

Dependabot now checks npm daily and groups toolchain packages separately from other minor and patch updates. A new workflow enables squash auto-merge for toolchain updates and non-major updates.

Changes

Dependabot automation

Layer / File(s) Summary
Daily update groups
.github/dependabot.yml, .agents/pm/tasks/pm-rl-3q1e.toon, .agents/pm/history/pm-rl-3q1e.jsonl, CHANGELOG.md
The npm schedule changes to daily. pm-toolchain groups @unbrained/pm-cli and pm-*; dependencies excludes those packages and includes minor and patch updates. The task records and changelog describe the automation.
Conditional squash auto-merge
.github/workflows/dependabot-auto-merge.yml
The workflow runs for Dependabot pull requests in the unbraind repository. It enables squash auto-merge when the update is in pm-toolchain or is not semver-major. Other major updates skip the merge command.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Dependabot
  participant GitHubActions
  participant GitHubCLI
  participant GitHubPullRequest
  Dependabot->>GitHubActions: Open pull request triggers workflow
  GitHubActions->>GitHubActions: Fetch dependency metadata
  GitHubActions->>GitHubCLI: Run squash auto-merge for eligible update
  GitHubCLI->>GitHubPullRequest: Enable auto-merge
Loading

Merge Risk: ⚪ Minimal · up to e3239

This change moves Dependabot to daily grouped updates and enables auto-merge for eligible updates. Required checks still gate merges, and no actionable merge risk was found. Repository settings and live branch protection were not verified.

Security Architecture Review

Security architecture risk: 🔵 Low · up to e3239

Bot-author gating, restricted job permissions, and a pinned metadata action limit exposure. However, effective token permissions and required branch protections are not verified, so the safety of unattended merging remains conditional. No exploitable security defect was established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The immediate authority surface is this repository’s eligible dependency PRs and target-branch contents. Because eligibility is not ecosystem-scoped, existing GitHub Actions updates can also qualify, potentially changing later CI execution. No cross-repository, tenant, or cloud authority was established.

Security Findings and Attack Paths

  • inferred — A compromised eligible upstream release could be proposed by Dependabot and reach the target branch without a separate human merge decision, subject to effective repository protections. This is an expanded automated trust path, not a verified exploit or evidence that an upstream release is compromised.

Trust Boundaries and Controls

  • observed — The source boundary combines bot-authored PRs, organization ownership, pinned metadata classification, and a repository-scoped merge token. PR data is passed through a quoted environment variable rather than interpolated into shell code. Effective Dependabot token write authority remains unverified.

Resilience and Maintainability Implications

  • inferred — Rollback must account for previously requested auto-merges, not only removal of the workflow. Source inspection does not establish whether disabling automation or interrupting a run revokes pending merge authorization, so that lifecycle guarantee remains unresolved.

Hardening Proposals

  • proposed — Validate effective token permissions, required checks and bypass rules before enabling unattended merging, and include explicit verification or revocation of pending auto-merges in the rollback procedure.
  • proposed — Consider allowing explicit recognized non-major metadata values rather than accepting every value unequal to semver-major. This would make unknown-output handling fail closed without implying that such an output is currently reachable.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary changes: daily grouped Dependabot updates and auto-merge for green updates.
Description check ✅ Passed The description explains the Dependabot configuration, auto-merge workflow, permissions, and rollout rationale. It is directly related to 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

The PR changes npm Dependabot to run daily with mutually exclusive PM-toolchain and general dependency groups, then adds a tightly scoped, SHA-pinned workflow that automatically enables squash merging for green Dependabot updates while reserving non-PM major updates for manual approval. It also adds the associated PM task records.

Sequence diagram for Dependabot auto-merge workflow

sequenceDiagram
    participant Dependabot
    participant GitHubActions
    participant Metadata as dependabot/fetch-metadata
    participant GitHub as GitHub PR
    participant Checks as Branch protection

    Dependabot->>GitHubActions: pull_request
    GitHubActions->>GitHubActions: [Dependabot PR owned by unbraind]
    GitHubActions->>Metadata: fetch metadata
    Metadata-->>GitHubActions: dependency-group and update-type
    alt pm-toolchain group
        GitHubActions->>GitHub: gh pr merge --auto --squash
    else non-major update
        GitHubActions->>GitHub: gh pr merge --auto --squash
    else other major update
        GitHubActions->>GitHub: [manual approval required]
    end
    GitHub->>Checks: await required checks
    Checks-->>GitHub: test (22), test (26)
    GitHub-->>Dependabot: merge when checks pass
Loading

Flow diagram for daily Dependabot update grouping

flowchart TD
    Schedule[Daily npm Dependabot run] --> Classify{Package matches pm-toolchain?}
    Classify -->|@unbrained/pm-cli or pm-*| PM[pm-toolchain PR]
    Classify -->|Other package| Type{Minor or patch update?}
    Type -->|Yes| Dependencies[dependencies PR]
    Type -->|No| Manual[Major update requires manual approval]
    PM --> AutoMerge[Automatic squash merge after required checks]
    Dependencies --> AutoMerge
    AutoMerge --> Checks[test 22 and test 26]
    Checks -->|Pass| Merge[Merge]
    Checks -->|Fail| Open[PR remains open]
Loading

File-Level Changes

Change Details Files
Configure daily npm Dependabot updates with dedicated grouping for the PM toolchain and non-major general dependencies.
  • Increase npm update frequency from weekly to daily.
  • Group @unbrained/pm-cli and pm-* packages into pm-toolchain without an update-type cap.
  • Group all remaining minor and patch updates into dependencies while excluding PM packages.
.github/dependabot.yml
Add a least-privilege workflow that enables squash auto-merge for eligible Dependabot pull requests.
  • Restrict execution to Dependabot pull requests in the unbraind organization.
  • Use SHA-pinned Dependabot metadata action to identify update groups and semantic version impact.
  • Auto-merge the pm-toolchain group and all non-major updates after required checks pass.
  • Leave unrelated major updates for manual review and grant write permissions only at the job level.
.github/workflows/dependabot-auto-merge.yml
Record the associated PM task and history artifacts.
  • Add the task definition and JSONL history entry for pm-rl-3q1e.
.agents/pm/tasks/pm-rl-3q1e.toon
.agents/pm/history/pm-rl-3q1e.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

@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-rl-3q1e
@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 f9f960e into main Oct 4, 2026
9 checks passed
@unbraind
unbraind deleted the ci/auto-merge-green-dependabot-updates branch October 4, 2026 18:01
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