Skip to content

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

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

Streamline Dependabot maintenance by grouping daily npm updates and automatically merging eligible updates after required checks pass.

New Features:

  • Automate squash auto-merging of eligible green Dependabot pull requests while leaving major or unclassified updates for manual review.

Enhancements:

  • Run npm dependency checks daily and group the PM toolchain into a dedicated daily update pull request, with other minor and patch updates grouped separately.

CI:

  • Add a least-privilege workflow that enables auto-merge only for Dependabot pull requests in the target repository and relies on required status checks.

Deployment:

  • Enable repository auto-merge and automatic deletion of merged branches.

Summary by cubic

Automates the delivery of Dependabot updates so green version bumps merge without manual work.

Dependabot now checks npm daily and groups @unbrained/pm-cli and pm-* packages into one pm-toolchain PR, with all other minor/patch updates in a separate dependencies PR. A new least-privilege workflow enables squash auto-merge for the calendar-versioned pm-toolchain group (a year rollover reads as semver-major) and for updates that dependabot/fetch-metadata explicitly classifies as minor or patch; an unclassified update never auto-merges. Branch protection still requires the test checks, so a failing bump stays open as a defect, and major updates still need a person. Repository auto-merge is enabled and merged branches are deleted.

Written for commit 5ec697a. 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-ts-starter-lzj0

@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: 674a3e77-dfe8-462e-a906-29eff4200453
📥 Commits

Reviewing files that changed from the base of the PR and between 6d51fc9 and 5ec697a.

📒 Files selected for processing (5)
  • .agents/pm/history/pm-ts-starter-lzj0.jsonl
  • .agents/pm/tasks/pm-ts-starter-lzj0.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 checked daily and grouped into a toolchain update or other package updates.
    • Eligible toolchain, minor, and patch updates can be automatically squash-merged once required checks pass.
  • Documentation
    • Added a changelog entry describing the update grouping and automatic merging.

Walkthrough

The changes set Dependabot to check npm updates daily, define toolchain and dependency groups, and add a workflow that enables squash auto-merge for toolchain updates and semver minor or patch updates.

Changes

Dependabot automation

Layer / File(s) Summary
Daily groups and update eligibility
.github/dependabot.yml, .agents/pm/history/pm-ts-starter-lzj0.jsonl, .agents/pm/tasks/pm-ts-starter-lzj0.toon
Dependabot checks npm updates daily. The pm-toolchain group matches @unbrained/pm-cli and pm-* packages. The separate dependencies group excludes those patterns and includes minor and patch updates. Task records specify the grouping and eligibility criteria.
Conditional auto-merge and rollout
.github/workflows/dependabot-auto-merge.yml, .agents/pm/history/pm-ts-starter-lzj0.jsonl, .agents/pm/tasks/pm-ts-starter-lzj0.toon, CHANGELOG.md
The workflow enables squash auto-merge for Dependabot pull requests in the unbraind repository when the group is pm-toolchain or the update type is semver minor or patch. The job grants contents: write and pull-requests: write; top-level permissions are empty. Task records and the changelog document the rollout.

Priority: ⬇️ Low

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Dependabot
  participant Workflow as GitHub Actions workflow
  participant Metadata as Dependency metadata
  participant GitHubCLI as GitHub CLI
  Dependabot->>Workflow: Open pull request
  Workflow->>Metadata: Fetch dependency group and update type
  Metadata-->>Workflow: Return group and update type
  Workflow->>GitHubCLI: Run auto-squash merge for eligible updates
Loading

Merge Risk: ⚪ Minimal · up to 5ec69

This change moves Dependabot to daily grouped updates and enables auto-merge only for eligible updates that pass the required checks. No merge-blocking risk is evident.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 5ec69

The automation is narrowly gated and does not execute pull-request code. It nevertheless removes manual approval for eligible dependency updates and relies on repository merge protections. No exploitable bypass was established, but effective token permissions and live protection settings remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The direct sensitive outcome is acceptance of eligible dependency changes into the repository's target branch. Updated npm toolchain packages are also consumed by build, release-check, changelog, and preparation scripts, so their effects are not limited to dependency manifests. This review did not establish exposure to deployment credentials, other repositories, tenants, or data stores.

Security Findings and Attack Paths

  • inferred — A compromised upstream release that produces an eligible Dependabot update could receive automatic acceptance if effective merge authority and repository protections permit it. Semver and group classification establish update eligibility, not package integrity. This is a dependency-trust consequence of the policy change, not a verified compromise or demonstrated control bypass.

Trust Boundaries and Controls

  • observed — The workflow separates PR identity from dependency classification and checks both before requesting merge activation. The repository condition checks the unbraind owner, not one exact repository name. The command supplies no administrative bypass option; actual required checks, token capabilities, and terminal merge enforcement are not proven by the YAML.

Resilience and Maintainability Implications

  • inferred — For a PR outside pm-toolchain, absent or unrecognized update-type output does not satisfy the merge predicate. Successful classification and effective API authority are prerequisites for activation. Failure of a later workflow run should not be assumed to revoke an earlier activation, because no such recovery operation is implemented here.

Hardening Proposals

  • proposed — Before relying on unattended merging, verify the effective Dependabot token permissions and target-branch required checks, and validate how enabled auto-merge behaves after new commits, eligibility-changing edits, cancellation, and rollback. Preserve those controls if the automation's event or credential model changes.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: auto-merging eligible Dependabot updates and grouping the PM toolchain into a daily pull request.
Description check ✅ Passed The description is directly related to the changeset and explains the Dependabot grouping, auto-merge conditions, required checks, and repository settings.
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 updates to run daily with disjoint PM-toolchain and general dependency groups, then adds a narrowly scoped, least-privilege workflow that uses fetched metadata to enable squash auto-merge for green Dependabot updates while preserving manual review for non-PM major updates; repository auto-merge and branch-deletion settings are also enabled.

Sequence diagram for Dependabot auto-merge

sequenceDiagram
    participant Dependabot
    participant Workflow as dependabot_auto_merge
    participant Metadata as fetch_metadata
    participant GitHub
    participant Checks as BranchProtection

    Dependabot->>Workflow: pull_request
    Workflow->>Workflow: [Dependabot actor and unbraind owner]
    Workflow->>Metadata: dependabot/fetch-metadata
    Metadata-->>Workflow: dependency-group and update-type
    alt pm-toolchain group
        Workflow->>GitHub: gh pr merge --auto --squash
    else non-major update
        Workflow->>GitHub: gh pr merge --auto --squash
    else other major update
        Workflow->>Workflow: [wait for manual review]
    end
    GitHub->>Checks: required checks
    Checks-->>GitHub: test (22) and test (26)
    GitHub-->>Dependabot: merge when checks pass
Loading

Flow diagram for daily Dependabot grouping

flowchart LR
    Daily["Daily npm Dependabot check"] --> PM["pm-toolchain group\n@unbrained/pm-cli and pm-*"]
    Daily --> Dependencies["dependencies group\nother minor and patch updates"]
    PM --> AutoMerge["Auto-merge after required checks"]
    Dependencies --> AutoMerge
    Major["Other major update"] --> Manual["Manual review"]
Loading

File-Level Changes

Change Details Files
Configure Dependabot to run daily and group package updates by release behavior.
  • Group the PM CLI and pm-prefixed packages into the daily pm-toolchain PR.
  • Group all other minor and patch npm updates into a dependencies PR.
  • Leave other ecosystems unchanged and preserve the open-PR limit.
.github/dependabot.yml
Add a least-privilege workflow that enables squash auto-merge for eligible Dependabot pull requests.
  • Restrict execution to Dependabot PRs in the unbraind organization.
  • Use SHA-pinned Dependabot metadata fetching to identify update groups and semver impact.
  • Auto-merge the pm-toolchain group regardless of calendar-version major classification, plus all other non-major updates.
  • Grant write permissions only at the job level and rely on branch protection checks before merging.
.github/workflows/dependabot-auto-merge.yml
Record the associated PM work item and history.
  • Add the task definition and its JSONL history entry.
.agents/pm/tasks/pm-ts-starter-lzj0.toon
.agents/pm/history/pm-ts-starter-lzj0.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.

What we checked:

  • Unknown updates wait for review: The workflow now requires an exact minor or patch match outside pm-toolchain. Empty and unexpected values do not pass.
  • Toolchain packages stay separate: The ordinary group excludes the exact patterns used by pm-toolchain. Its minor/patch limit therefore does not restrict toolchain updates.

Summary

Checks npm dependencies daily and groups toolchain updates separately from other minor and patch updates. Adds a workflow that enables squash auto-merge for eligible Dependabot PRs.

  • Keeps the calendar-version exception for pm-toolchain.
  • Fixes the previous finding: unknown update types outside pm-toolchain no longer enable auto-merge.
  • No new actionable issues found in the changes since the previous review.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Dependabot pull request] --> B{Author and owner match?}
  B -->|No| C[Skip job]
  B -->|Yes| D[Read update metadata]
  D --> E{Toolchain group or minor/patch?}
  E -->|No| F[Leave for manual review]
  E -->|Yes| G[Enable squash auto-merge]
  G --> H[GitHub enforces required checks]
Loading

Reviews (4) · 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

Rate Limit Exceeded

@unbraind have exceeded the limit for the number of chat messages per hour. Please wait 14 minutes and 25 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-ts-starter-lzj0
@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 bd89571 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