Skip to content
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

[Grouped Updates] Remove prototype from branch names #7297

Merged
merged 2 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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