feat: Add PR message formatting for dependency-name groups#14289
Merged
markhallen merged 3 commits intomainfrom Feb 27, 2026
Merged
feat: Add PR message formatting for dependency-name groups#14289markhallen merged 3 commits intomainfrom
markhallen merged 3 commits intomainfrom
Conversation
When group-by: dependency-name is configured, dynamic subgroups like 'monorepo-deps/dummy-pkg-a' are created. Previously the raw subgroup name leaked into PR titles. Changes: - Populate updated_directories metadata in deduplicate_by_name_only so each surviving dependency tracks all directories it was updated in - Add dependency_name_group_pr_name for titles like 'Bump X across N directories', 'Bump X in /dir', or 'Bump X' - Add dependency_name_group_intro for PR body with per-directory version changes - Add tests for both GroupDependencySelector and MessageBuilder
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds dedicated formatting for dependency-name groups (created when group-by: dependency-name is configured) to produce clean, dependency-focused PR titles and bodies instead of exposing the raw subgroup names.
Changes:
- Enhanced
GroupDependencySelectorto preserve directory information in metadata when deduplicating by dependency name - Added
dependency_name_group_pr_nameanddependency_name_group_intromethods to MessageBuilder for dependency-name group formatting - Added comprehensive test coverage for both single and multi-directory scenarios
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
updater/lib/dependabot/updater/group_dependency_selector.rb |
Added logic to populate updated_directories metadata when deduplicating by name, preserving directory context |
updater/spec/dependabot/updater/group_dependency_selector_spec.rb |
Added tests verifying metadata population for dependency-name groups and absence of metadata for regular groups |
common/lib/dependabot/pull_request_creator/message_builder.rb |
Added new formatting methods for dependency-name group PR titles and bodies with directory-aware messaging |
common/spec/dependabot/pull_request_creator/message_builder_spec.rb |
Added tests for PR title and body formatting across multiple directory scenarios |
- Add nil-safe fallback (|| "unknown") for humanized_previous_version and humanized_version in dependency_name_group_intro multi-directory path - Replace directories.count == 1 with directories.one? per rubocop Style/CollectionQuerying preference
thavaahariharangit
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
When
group-by: dependency-nameis configured, dynamic subgroups like"monorepo-deps/dummy-pkg-a"are created. Today the raw subgroup name leaks into PR titles and bodies, producing confusing messages like "Bump the monorepo-deps/dummy-pkg-a group across 3 directories".This PR adds dedicated title and body formatting for these dependency-name groups so that users see clean, dependency-focused messages instead.
PR title examples:
Bump dummy-pkg-a across 3 directoriesBump dummy-pkg-a in /frontendBump dummy-pkg-aPR body lists each affected directory with its version change (e.g.
- /frontend: 1.4.0 → 1.5.0).Anything you want to highlight for special attention from reviewers?
The change is split into two layers:
Metadata plumbing (
GroupDependencySelector#deduplicate_by_name_only): When deduplicating by name, the surviving dependency now getsmetadata[:updated_directories]populated with all directories where it was updated. This preserves directory info that was previously lost.Message formatting (
MessageBuilder): Newdependency_name_group_pr_nameanddependency_name_group_intromethods dispatch from the existinggroup_pr_nameandversion_commit_message_intromethods whendependency_group.group_by_dependency_name?is true. All existing code paths are unchanged.How will you know you've accomplished your goal?
updated_directoriesmetadata is populated with all directories whengroup_by_dependency_name?is trueupdated_directoriesis not set whengroup_by_dependency_name?is false (no behavior change)Checklist