-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Introduce group rule to branch namer #6784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
de007dc
553b3e9
6fcca58
161bb61
a79c172
6010c76
56911b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module Dependabot | ||
| class GroupRule | ||
| attr_reader :name | ||
|
|
||
| def initialize(name) | ||
| @name = name | ||
| end | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module Dependabot | ||
| class PullRequestCreator | ||
| class BranchNamer | ||
| class GroupRuleStrategy | ||
| def initialize(dependencies:, files:, target_branch:, group_rule:, | ||
| separator: "/", prefix: "dependabot", max_length: nil) | ||
| @dependencies = dependencies | ||
| @files = files | ||
| @target_branch = target_branch | ||
| @group_rule = group_rule | ||
| @separator = separator | ||
| @prefix = prefix | ||
| @max_length = max_length | ||
| end | ||
|
|
||
| def new_branch_name | ||
| group_rule.name | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably expect a group rule name to be a humanized string, as we'll need to either:
I'd tend to prefer the latter as while it might end up making sense to validate it in the config for other reasons, this component probably shouldn't trust its inputs?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That makes sense to me. I'm going to leave this as is for now, in its very naive state, so we can make decisions on this when we have more information. |
||
| end | ||
|
|
||
| private | ||
|
|
||
| attr_reader :group_rule | ||
| end | ||
| end | ||
| end | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little unclear on the interfact for a
GroupRule. Theruleportion signifies a policy-like approach, where criteria must be met. I'm open to this changing, or to refining the concept as we move forward.