Skip to content

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

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 (26), test (22.18.0), 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 safe landing of green Dependabot updates while delivering pm toolchain releases as grouped daily updates.

New Features:

  • Configure daily npm Dependabot updates with grouped pull requests for the pm toolchain and other minor or patch dependencies.

Enhancements:

  • Automatically enable squash auto-merge for green non-major Dependabot updates, including calendar-versioned pm toolchain releases, while leaving major non-toolchain updates for manual review.
  • Limit the auto-merge workflow to Dependabot pull requests in the target organization and grant write permissions only to the job that performs merges.

CI:

  • Add a Dependabot auto-merge workflow that waits for required branch-protection checks before merging.

Documentation:

  • Document the Dependabot automation and pm toolchain grouping in the unreleased changelog.

Chores:

  • Record the associated pm task and history metadata.

Summary by cubic

Automates the landing of green Dependabot updates so pm toolchain version bumps reach the fleet without a hand-written certification PR.

  • npm checks run daily instead of weekly; @unbrained/pm-cli and pm-* packages arrive grouped in one pm-toolchain PR, and other minor/patch updates in one dependencies PR.
  • A least-privilege workflow enables squash auto-merge for the pm-toolchain group (calendar-versioned, so a year rollover reads as semver-major) and, outside it, only for updates classified minor or patch; anything major or unclassified waits for a person.
  • Branch protection still gates on required checks, so a bump that fails CI stays open as a defect.

Same change as the reviewed pilot unbraind/pm-presets#118.

Written for commit bcaeaad. 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-todos-jvp5

@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.

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: 975441e4-ab06-4985-8d50-0426c6995acb
📥 Commits

Reviewing files that changed from the base of the PR and between 3c8617f and bcaeaad.

📒 Files selected for processing (5)
  • .agents/pm/history/pm-todos-jvp5.jsonl
  • .agents/pm/tasks/pm-todos-jvp5.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

  • Chores
    • Dependency updates are now checked daily and grouped into a toolchain update or separate minor and patch updates.
    • Eligible Dependabot updates can be squash-merged automatically when they meet the configured criteria and checks pass. Other updates are not automatically merged.

Walkthrough

Dependabot now checks npm dependencies daily and groups toolchain updates separately from other minor and patch updates. A new workflow enables squash auto-merge for eligible Dependabot pull requests.

Changes

Dependabot automation

Layer / File(s) Summary
Daily schedule and dependency groups
.github/dependabot.yml
The npm update schedule changes from weekly to daily. The pm-toolchain group matches @unbrained/pm-cli and pm-* without an update-type filter. The dependencies group excludes those packages and includes minor and patch updates.
Eligible pull request auto-merge
.github/workflows/dependabot-auto-merge.yml, .agents/pm/tasks/pm-todos-jvp5.toon, .agents/pm/history/pm-todos-jvp5.jsonl, CHANGELOG.md
The workflow enables squash auto-merge for Dependabot pull requests when the group is pm-toolchain or the update is semver minor or patch. The task records document the criteria and rollout. The changelog records the automation.

Priority: ⬇️ Low

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Dependabot
  participant GitHubActions
  participant GitHub
  Dependabot->>GitHubActions: Opens a pull request
  GitHubActions->>GitHubActions: Reads update metadata
  GitHubActions->>GitHub: Enables squash auto-merge for eligible updates
Loading

Merge Risk: ⚪ Minimal · up to bcaea

The automation is mergeable after normal checks. No unresolved issue is established that would prevent eligible updates from following the configured auto-merge path.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to bcaea

Merge authority is narrowly gated, and the new workflow does not execute pull-request code. However, automatically accepted toolchain updates later execute in a release job with repository-write and publishing-identity permissions. This increases exposure to compromised dependency releases. Required branch protections are documented but were not independently verified.

Retained concerns

  • Medium · security · inferred: Automatic dependency promotion removes individual approval before toolchain code reaches release-privileged execution. An attacker controlling an eligible upstream package release could publish code that passes the existing checks, reaches main through auto-merge, and subsequently executes with repository-write and publishing-identity authority. The privileged release job predates this PR; the newly unattended promotion path increases its exposure. Dependabot identity, SHA pinning, read-only PR testing, and main-only release gating constrain the path but do not authenticate the behavior of an upstream package release.
Security review details

Security Blast Radius

  • inferred — The demonstrated authority scope is this repository and its existing release job. A compromised promoted toolchain package could execute with that job's repository and OIDC authority, potentially affecting publication and consumers. No evidence establishes cross-repository authority or fleet-wide compromise.

Security Findings and Attack Paths

  • inferred — The supported conditional attack path requires control of an eligible upstream dependency release: publish malicious code, obtain a Dependabot update that passes CI, let auto-merge promote it to main, and execute through the existing release toolchain. This is an increased supply-chain exposure, not an observed malicious release or a demonstrated bypass by an ordinary external PR author.

Trust Boundaries and Controls

  • observed — The merge gate checks the original PR author, not every current-head commit's provenance. The new job avoids executing PR code, and privileged release execution is main-only. These controls limit direct fork-to-credential exposure; subsequent branch-update authority and platform auto-merge revocation behavior remain unverified.

Resilience and Maintainability Implications

  • inferred — Safe unattended promotion depends on continuing repository-policy enforcement, not merely on defining passing CI jobs. Changes to required-check rules or auto-merge lifecycle behavior could weaken containment without changing this workflow's eligibility expression.

Hardening Proposals

  • proposed — Consider separating dependency installation, toolchain execution, and artifact construction from the release-write and OIDC-enabled publishing job, with explicit artifact validation between them. This could preserve unattended updates while reducing the authority inherited by compromised build dependencies.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: enabling Dependabot auto-merge and grouping pm toolchain updates into daily pull requests.
Description check ✅ Passed The description explains the Dependabot schedule and grouping, auto-merge conditions, permissions, required checks, and documentation changes.
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 increases npm Dependabot cadence, consolidates the pm toolchain and other safe updates into daily PRs, and uses a scoped, SHA-pinned workflow to enable squash auto-merge once branch-protection checks pass. Toolchain year rollovers are explicitly treated as eligible despite appearing semver-major, while unrelated major updates remain manual; repository settings also allow auto-merge and delete merged branches.

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 checks

    Dependabot->>GitHub: Open pull request
    GitHub->>GitHubActions: Trigger pull_request
    GitHubActions->>Metadata: Fetch PR metadata
    Metadata-->>GitHubActions: dependency-group and update-type
    alt pm-toolchain or non-major update
        GitHubActions->>GitHub: gh pr merge --auto --squash
        Checks-->>GitHub: Required checks pass
        GitHub->>GitHub: Merge PR and delete branch
    else Unrelated major update
        GitHubActions-->>GitHub: Leave PR for manual merge
    end
Loading

Flow diagram for grouped daily Dependabot updates

flowchart LR
    Npm["npm updates checked daily"] --> Classify{"Update matches pm-toolchain?"}
    Classify -->|Yes| PM["pm-toolchain PR\n@unbrained/pm-cli and pm-* packages"]
    Classify -->|No| Safe{"Minor or patch update?"}
    Safe -->|Yes| Deps["dependencies PR\nother minor and patch updates"]
    Safe -->|No| Manual["Unrelated major update\nmanual review"]
    PM --> Auto["Auto-merge enabled\nafter required checks pass"]
    Deps --> Auto
Loading

File-Level Changes

Change Details Files
Configure Dependabot to check npm dependencies daily and group related updates.
  • Group @unbrained/pm-cli and pm-* packages into pm-toolchain, including calendar-version year rollovers.
  • Group all other minor and patch npm updates into dependencies while excluding toolchain packages.
  • Leave other ecosystem configuration unchanged.
.github/dependabot.yml
Add a least-privilege workflow that enables auto-merge for eligible Dependabot pull requests.
  • Restrict execution to Dependabot PRs in the unbraind organization.
  • Classify updates with SHA-pinned dependabot/fetch-metadata v3.1.0.
  • Auto-merge pm-toolchain updates and all non-major updates using squash merging.
  • Give the workflow no default permissions and grant only job-level contents and pull-request write access.
.github/workflows/dependabot-auto-merge.yml
Record the associated pm task and history artifacts.
  • Add the task definition and JSONL history entry for pm-todos-jvp5.
.agents/pm/tasks/pm-todos-jvp5.toon
.agents/pm/history/pm-todos-jvp5.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 CI workflow.

The changes since the last review appear safe to merge, with no actionable new issue found.

What we checked:

  • pm packages stay together: The other group excludes both patterns used by pm-toolchain, so the wildcard does not capture those packages.

Summary

Groups npm updates into daily PRs and adds a Dependabot-only workflow that requests squash auto-merge.

  • pm-toolchain updates keep the calendar-version exception.
  • Other updates must be classified as minor or patch.
  • The latest changes make the groups explicitly disjoint and document the job’s permissions.
  • No actionable new issue or mounted-rule violation was found.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Pull request] --> B{Dependabot author and unbraind owner?}
  B -->|No| C[Skip job]
  B -->|Yes| D[Read update metadata]
  D --> E{pm-toolchain group or minor or patch?}
  E -->|No| F[Wait for a person]
  E -->|Yes| G[Request squash auto-merge]
  G --> H[GitHub applies required merge checks]
Loading

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

@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

Rate Limit Exceeded

@unbraind have exceeded the limit for the number of chat messages per hour. Please wait 14 minutes and 26 seconds before sending another message.

…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-todos-jvp5
@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.

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