Skip to content

Commit

Permalink
Remove prototype from branch names
Browse files Browse the repository at this point in the history
  • Loading branch information
brrygrdn committed May 11, 2023
1 parent 37dc176 commit 01e79cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def initialize(dependencies:, files:, target_branch:, dependency_group:,
# fixed-length name, so we can punt on handling truncation until
# we determine the strict validation rules for names
def new_branch_name
File.join(prefixes, dependency_group.name, prototype_suffix).gsub("/", separator)
File.join(prefixes, timestamped_group_name).gsub("/", separator)
end

private
Expand All @@ -37,9 +37,11 @@ def prefixes
].compact
end

# FIXME: Remove once grouped PRs can supersede each other
def prototype_suffix
"prototype-#{Time.now.utc.to_i}"
# When superseding a grouped update pull request, we will have a period
# of time when there are two branches for the group so we use a timestamp
# to avoid collisions.
def timestamped_group_name
"#{dependency_group.name}-#{Time.now.utc.to_i}"
end

def package_manager
Expand Down
2 changes: 1 addition & 1 deletion common/spec/dependabot/pull_request_creator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@
to receive(:new).
with(
source: source,
branch_name: start_with("dependabot/bundler/all-the-things/prototype-"),
branch_name: start_with("dependabot/bundler/all-the-things-"),
base_commit: base_commit,
credentials: credentials,
files: files,
Expand Down

0 comments on commit 01e79cc

Please sign in to comment.