Skip to content

Introduce group rule to branch namer#6784

Merged
landongrindheim merged 7 commits intomainfrom
introduce-group-rule-to-branch-namer
Mar 6, 2023
Merged

Introduce group rule to branch namer#6784
landongrindheim merged 7 commits intomainfrom
introduce-group-rule-to-branch-namer

Conversation

@landongrindheim
Copy link
Copy Markdown
Contributor

@landongrindheim landongrindheim commented Mar 3, 2023

As we move toward grouping updates, we'll need an alternative approach to naming. This pull request represents the structure of this change. Its details have been omitted intentionally as I believe we'll have better information as we get closer to fully supporting that workflow.

module Dependabot
class PullRequestCreator
class BranchNamer
class SoloStrategy
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This object represents our current approach to naming. I don't think Solo necessarily captures that well, but it stands as a complement to a grouping. I'm open to this changing now or later 🙂

# frozen_string_literal: true

module Dependabot
class GroupRule
Copy link
Copy Markdown
Contributor Author

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. The rule portion 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.

end

def new_branch_name
group_rule.name
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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:

  • Validate it strictly as being a valid branch name in the config file
  • Accept any string and 'slugify' it here replacing invalid characters/spaces etc

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Accept any string and 'slugify' it here replacing invalid characters/spaces etc

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?

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.

@landongrindheim landongrindheim marked this pull request as ready for review March 6, 2023 15:23
@landongrindheim landongrindheim requested a review from a team as a code owner March 6, 2023 15:23
Copy link
Copy Markdown
Contributor

@brrygrdn brrygrdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 This makes sense to me, I think sinking the existing logic into a discrete class is a good call vs just adding more to BranchNamer 😅 - SoloStrategy makes sense name-wise, we can revisit it later as we figure out how the grouped vs non-grouped behaviours play out.

@landongrindheim landongrindheim force-pushed the introduce-group-rule-to-branch-namer branch from 42f73b8 to b1145de Compare March 6, 2023 18:41
This is the first step toward introducing a grouping strategy.
This isn't used yet, but will be to determine the name of a branch.
This object is intended to be a signifier for a grouping of dependencies.

Merge with group rule
@landongrindheim landongrindheim force-pushed the introduce-group-rule-to-branch-namer branch from b1145de to 56911b0 Compare March 6, 2023 19:52
@landongrindheim landongrindheim merged commit a72d598 into main Mar 6, 2023
@landongrindheim landongrindheim deleted the introduce-group-rule-to-branch-namer branch March 6, 2023 22:06
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.

2 participants