dependabot-common 0.286.0 → 0.287.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35ae86084e0800ff647158f46789d798d64973a3523ced6062db146dbfa583ff
4
- data.tar.gz: 12624cd5e076311f8cdf0c410d53a2a2f8c90db1d1dac48e831b28da6527cdf1
3
+ metadata.gz: 29a554da8bfe1c29b45541c68eb5c311d1631785725e63d84d9a6d6952324c39
4
+ data.tar.gz: 6aece2522be172f7bc1cb521210121fbe66a21509c9181239b6ed6166df41735
5
5
  SHA512:
6
- metadata.gz: d6ac4514c8a353355c5bc9635723c3f071339fbef2b19bad75beea548037dd4a689609e52117732a7e9e6c9653867a4745ba1085b8b147c1e05cd210cf94396f
7
- data.tar.gz: 9c987ce3a13fe912bb13832f3f56d345952587847eb77d9bdfec0f6dbe09a0a01b3c3273e141a6e616c526d83c787d846a26a6e8f9d593311dbd3376af37c3f4
6
+ metadata.gz: 8a5c341db6ff520a170163ab9886c897be6f33f144451d7f79fa2f4adddb44038a8eb616320e39e28bc4306d86222e20f9337125c8adb7577c3acfc085fb7802
7
+ data.tar.gz: 55187173f82cea30b99fbc01418d44ea2b570ef7d88db7a15a85950c00dbe7798c66163d4530a6c053c60fb65e32e2c0f317f090fcf589211d7d31371621d0be
@@ -114,15 +114,15 @@ module Dependabot
114
114
  "Initiating Github pull request."
115
115
  )
116
116
 
117
- if experiment_duplicate_branch? && branch_exists?(branch_name)
117
+ if experiment_duplicate_branch? && branch_exists?(branch_name) && no_pull_request_exists?
118
118
  Dependabot.logger.info(
119
119
  "Existing branch \"#{branch_name}\" found. Pull request not created."
120
120
  )
121
121
  raise BranchAlreadyExists, "Duplicate branch #{branch_name} already exists"
122
122
  end
123
123
 
124
- if branch_exists?(branch_name) && unmerged_pull_request_exists?
125
- raise UnmergedPRExists, "PR ##{unmerged_pull_requests.first.number} already exists"
124
+ if branch_exists?(branch_name) && open_pull_request_exists?
125
+ raise UnmergedPRExists, "PR ##{open_pull_requests.first.number} already exists"
126
126
  end
127
127
  if require_up_to_date_base? && !base_commit_is_up_to_date?
128
128
  raise BaseCommitNotUpToDate, "HEAD #{head_commit} does not match base #{base_commit}"
@@ -164,13 +164,18 @@ module Dependabot
164
164
  # rubocop:enable Metrics/PerceivedComplexity
165
165
 
166
166
  sig { returns(T::Boolean) }
167
- def unmerged_pull_request_exists?
168
- unmerged_pull_requests.any?
167
+ def no_pull_request_exists?
168
+ pull_requests_for_branch.none?
169
+ end
170
+
171
+ sig { returns(T::Boolean) }
172
+ def open_pull_request_exists?
173
+ open_pull_requests.any?
169
174
  end
170
175
 
171
176
  sig { returns(T::Array[T.untyped]) }
172
- def unmerged_pull_requests
173
- pull_requests_for_branch.reject(&:merged)
177
+ def open_pull_requests
178
+ pull_requests_for_branch.reject(&:closed).reject(&:merged)
174
179
  end
175
180
 
176
181
  sig { returns(T::Array[T.untyped]) }
data/lib/dependabot.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Dependabot
5
- VERSION = "0.286.0"
5
+ VERSION = "0.287.0"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.286.0
4
+ version: 0.287.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-14 00:00:00.000000000 Z
11
+ date: 2024-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-codecommit
@@ -614,7 +614,7 @@ licenses:
614
614
  - MIT
615
615
  metadata:
616
616
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
617
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.286.0
617
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.287.0
618
618
  post_install_message:
619
619
  rdoc_options: []
620
620
  require_paths: