Skip to content

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

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 compatible Dependabot updates while preserving review and branch-protection gates for major or failing changes.

New Features:

  • Configure daily npm Dependabot updates with grouped pull requests for the pm toolchain and other minor or patch dependencies.
  • Automatically enable squash auto-merge for eligible green Dependabot updates while leaving major and failing updates for manual handling.

Enhancements:

  • Restrict the auto-merge workflow to the target organization and Dependabot pull requests with least-privilege permissions.

Documentation:

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

Chores:

  • Record completion of the pm task and its history.

Summary by cubic

Automates pm toolchain version bumps by grouping Dependabot npm updates into one daily PR and auto-merging green, non-major PRs so releases land without a hand-written certification PR.

  • npm Dependabot checks run daily instead of weekly; @unbrained/pm-cli and pm-* packages group into one pm-toolchain PR and remaining minor/patch updates into one dependencies PR.
  • A new least-privilege workflow squash-auto-merges every Dependabot PR from the pm-toolchain group (calendar-versioned, so year rollovers read as semver-major) and, for the unbraind org only, updates explicitly classified minor or patch; unclassified updates never auto-merge.
  • Branch protection still gates merges; failing bumps stay open as defects and major updates still wait for a person. The pm task is recorded as done and the changelog updated.

Written for commit cee07b1. 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-slack-nra8

@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: ff0c816a-b6b1-43b8-abf7-f25b42f0c4e9
📥 Commits

Reviewing files that changed from the base of the PR and between 4c4d477 and cee07b1.

📒 Files selected for processing (5)
  • .agents/pm/history/pm-slack-nra8.jsonl
  • .agents/pm/tasks/pm-slack-nra8.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 separate toolchain and other-dependency pull requests.
    • Eligible toolchain updates and minor or patch updates can be merged automatically once required checks pass. Major and unclassified updates are not automatically merged.

Walkthrough

Dependabot npm updates now run daily in separate toolchain and dependency groups. A new workflow enables squash auto-merge for eligible Dependabot pull requests. Task records and the changelog document the update criteria and rollout.

Changes

Dependabot update automation

Layer / File(s) Summary
Daily update groups
.github/dependabot.yml, .agents/pm/tasks/*, .agents/pm/history/*
The npm schedule changes to daily. The configuration separates toolchain updates from other dependencies, with minor and patch limits on the dependency group. Task records specify the calendar-version exception, merge criteria, and required-check gate.
Conditional auto-merge
.github/workflows/dependabot-auto-merge.yml, CHANGELOG.md
The workflow runs for Dependabot pull requests in the specified repository. It enables squash auto-merge for toolchain updates or semver minor and patch updates. The changelog records the change.

Priority: ⬇️ Low

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Dependabot
  participant Workflow as GitHub Actions workflow
  participant Metadata as Dependabot metadata action
  participant GitHub as GitHub auto-merge
  Dependabot->>Workflow: Opens a pull request
  Workflow->>Metadata: Retrieves dependency update metadata
  Metadata-->>Workflow: Returns dependency group and update type
  Workflow->>GitHub: Enables squash auto-merge when eligible
Loading

Merge Risk: ⚪ Minimal · up to cee07

The daily update groups and conditional auto-merge have no established merge-blocking issue. Eligible updates remain subject to the required checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to cee07

The automation is narrowly gated to Dependabot, does not execute pull-request contents, and explicitly limits ordinary updates to minor or patch versions. However, its safety depends on repository merge protections and pending auto-merge behavior that could not be independently verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The new authority is repository-scoped contents and pull-request modification, with the implemented sink targeting the triggering PR. It can admit qualifying npm and GitHub Actions dependency changes without a workflow-level human approval step, subject to effective repository merge protections. These sources do not establish fleet-wide authority or exposure.

Trust Boundaries and Controls

  • observed — Write permissions are confined to the Dependabot- and organization-gated job; workflow-default permissions are empty. The metadata action is SHA-pinned, and no step checks out or executes PR contents. These controls constrain the path from a PR event to repository-write authority, although the effective token grant remains dependent on GitHub policy.

Resilience and Maintainability Implications

  • inferred — Merge safety is delegated to GitHub's required-check and review enforcement rather than implemented in the workflow. Source inspection cannot establish that failing or newly changed PRs remain blocked through all pending auto-merge states; that guarantee requires live settings and server-side lifecycle semantics.

Hardening Proposals

  • proposed — Verify effective required checks and review rules when enabling the automation. Document ownership of pending auto-merge requests, including whether eligibility changes require revocation and how rollback handles requests already enabled.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main changes: auto-merging eligible Dependabot updates and grouping the pm toolchain into daily pull requests.
Description check ✅ Passed The description explains the Dependabot schedule and grouping, auto-merge eligibility, permissions, and merge safeguards. 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

This PR makes npm Dependabot checks daily, groups the pm CLI toolchain separately from other dependency updates, and adds a least-privilege workflow that automatically squash-merges eligible Dependabot PRs once required checks pass while leaving unrelated major updates for manual review.

Sequence diagram for Dependabot auto-merge workflow

sequenceDiagram
    participant Dependabot
    participant GitHub
    participant Metadata as fetch-metadata
    participant Checks as RequiredChecks
    participant Merge as gh_pr_merge

    Dependabot->>GitHub: Open pull request
    GitHub->>Metadata: fetch-metadata
    Metadata-->>GitHub: dependency-group and update-type
    alt pm-toolchain group
        GitHub->>Merge: gh pr merge --auto --squash
    else non-major update
        GitHub->>Merge: gh pr merge --auto --squash
    else unrelated major update
        GitHub-->>Dependabot: Keep PR open for manual review
    end
    Merge->>Checks: Wait for required checks
    Checks-->>Merge: test (22) and test (26) pass
    Merge-->>GitHub: Squash-merge PR
Loading

Flow diagram for daily Dependabot grouping

flowchart TD
    Daily[Daily npm Dependabot check] --> PM{Matches pm-toolchain patterns}
    Daily --> Other{Matches other dependency patterns}
    PM --> PMPR[One pm-toolchain PR]
    Other --> MinorPatch{Minor or patch update}
    MinorPatch --> DepPR[One dependencies PR]
    Other --> Major[Major update]
    Major --> Manual[Separate PR for manual review]
Loading

File-Level Changes

Change Details Files
Configure Dependabot to run daily and consolidate npm updates into dedicated groups.
  • Group the CLI and pm-prefixed packages into a single pm-toolchain PR, including calendar-version year rollovers.
  • Group all other minor and patch npm updates into a separate dependencies PR while excluding pm packages.
  • Leave other ecosystem configurations unchanged.
.github/dependabot.yml
Add a scoped workflow that enables squash auto-merge for eligible green Dependabot pull requests.
  • Restrict execution to Dependabot PRs in repositories owned by unbraind.
  • Use SHA-pinned Dependabot metadata fetching to identify update groups and semver impact.
  • Auto-merge the pm-toolchain group and all non-major updates; require human approval for other major updates.
  • Apply empty default permissions and grant only job-level contents and pull-request write access.
.github/workflows/dependabot-auto-merge.yml
Add pm task tracking artifacts for the requested fleet automation work.
  • Record the task history entry and task definition for pm-slack-nra8.
.agents/pm/history/pm-slack-nra8.jsonl
.agents/pm/tasks/pm-slack-nra8.toon
Enable repository-level merge automation settings.
  • Allow auto-merge and delete branches after merge.
Repository settings

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 changes since the previous review appear safe to merge.

What we checked:

  • Unknown updates stay manual: The workflow accepts only pm-toolchain or the exact minor and patch values. An empty or unknown value outside that group cannot pass.

Summary

This PR groups daily npm updates and adds a Dependabot-only workflow that requests squash auto-merge.

  • pm-toolchain updates retain the calendar-version exception.
  • Other updates now require an explicit minor or patch classification.
  • The latest changes add an explicit catch-all pattern, explain job permissions, and update the task record.
  • No actionable new issues were found. No previous review threads were supplied; their current state could not be retrieved.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Pull request event] --> B{Dependabot author and unbraind owner?}
  B -->|No| C[Skip job]
  B -->|Yes| D[Read dependency metadata]
  D --> E{pm-toolchain group or minor or patch?}
  E -->|No| F[Leave for manual handling]
  E -->|Yes| G[Request squash auto-merge]
  G --> H[GitHub applies repository merge requirements]
Loading

Reviews (3) · 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 30 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-slack-nra8
@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 9cd65bd into main Oct 4, 2026
11 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