dependabot-common 0.286.0 → 0.288.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: 550020f64e127c0aeb071589d9d77b6a9b00bc3c516ce3baecf6f8b072fa2621
4
+ data.tar.gz: 0f0162b707b4954b8a3f09addb4f5eb1d16f4d3863bb875dd95faee5efb0c2a7
5
5
  SHA512:
6
- metadata.gz: d6ac4514c8a353355c5bc9635723c3f071339fbef2b19bad75beea548037dd4a689609e52117732a7e9e6c9653867a4745ba1085b8b147c1e05cd210cf94396f
7
- data.tar.gz: 9c987ce3a13fe912bb13832f3f56d345952587847eb77d9bdfec0f6dbe09a0a01b3c3273e141a6e616c526d83c787d846a26a6e8f9d593311dbd3376af37c3f4
6
+ metadata.gz: 836eb356d0714bff9005c5d83f01f918c722094166df7a0d1c1629c6af484ab600680bd02ebe1b713f6f638d1c3e73ddd02b1ccdb7d16be3b03f25af8a7c04bf
7
+ data.tar.gz: 95190537ceea2262ced17707f5276931dd1554a92c1478054773a5395317154e6c99243cb048d45aee1377beeb33f556c145e8cd94838075633dc5116cf9800d
@@ -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.288.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.288.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-21 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.288.0
618
618
  post_install_message:
619
619
  rdoc_options: []
620
620
  require_paths: