dependabot-common 0.144.0 → 0.145.4

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: 06f9de893151cd2ab1d29916da6c5d821cc70dc6878e3ccd144eb887a4588322
4
- data.tar.gz: 26bcac9593d947e959aecc53e6c9f7b1474214dda334206df517c0f71cd446ec
3
+ metadata.gz: ddf544db22f6cd0f186d30314a7f739c307fd39c6d6154ba3e3695707c940479
4
+ data.tar.gz: ea8f1f2404c68e01f90fa382b51994f9bc2d09ed31a01fe527a4acb69843406f
5
5
  SHA512:
6
- metadata.gz: f27252cbb1d0ee59aaee1a619b9546a1a7c22613b07f38c014eaac88be8d7ad75ebdcf5f5891f30d715441b80821ba62f99e17749cacbdb9fe4c16a2b7ca2de9
7
- data.tar.gz: a7e5d2b6f8f3bf3689cd490e9b8b7c35898ae6ad15a832afda6693a64f850f3dbfbe21397de2cb8e943ab167e2b69d542c2fe8364f5d36841661c1112907af94
6
+ metadata.gz: 9467032f9bf7632a832e127f87755103b860725b05d18a6f6d198cd5b265e6f864e21c22d9aeab6bd1bab3328f44f94dfa2507b25a680beae7c3707968b5e0cf
7
+ data.tar.gz: 7f53c347a240b6a4a71bf645c96bd63e6ca5791e11a57eb944f544d8d70b192e679ded0e9e97fdf4b28f4883a2e1a58cd9de232a607222d038d0e13faf73c168
@@ -60,10 +60,10 @@ module Dependabot
60
60
  end
61
61
 
62
62
  def pinned_ref_looks_like_commit_sha?
63
- return false unless pinned?
64
-
65
63
  ref = dependency_source_details.fetch(:ref)
66
- return false unless ref.match?(/^[0-9a-f]{6,40}$/)
64
+ return false unless ref&.match?(/^[0-9a-f]{6,40}$/)
65
+
66
+ return false unless pinned?
67
67
 
68
68
  local_repo_git_metadata_fetcher.head_commit_for_ref(ref).nil?
69
69
  end
@@ -115,6 +115,17 @@ module Dependabot
115
115
  end
116
116
  # rubocop:enable Metrics/PerceivedComplexity
117
117
 
118
+ def local_tag_for_pinned_version
119
+ return unless pinned?
120
+
121
+ ref = dependency_source_details.fetch(:ref)
122
+ tags = local_tags.select { |t| t.commit_sha == ref && version_class.correct?(t.name) }.
123
+ sort_by { |t| version_class.new(t.name) }
124
+ return if tags.empty?
125
+
126
+ tags[-1].name
127
+ end
128
+
118
129
  def git_repo_reachable?
119
130
  local_upload_pack
120
131
  true
@@ -226,12 +226,12 @@ module Dependabot
226
226
  end
227
227
 
228
228
  def create_branch(commit)
229
- ref = "heads/#{branch_name}"
229
+ ref = "refs/heads/#{branch_name}"
230
230
 
231
231
  begin
232
232
  branch =
233
233
  github_client_for_source.create_ref(source.repo, ref, commit.sha)
234
- @branch_name = ref.gsub(%r{^heads/}, "")
234
+ @branch_name = ref.gsub(%r{^refs/heads/}, "")
235
235
  branch
236
236
  rescue Octokit::UnprocessableEntity => e
237
237
  # Return quietly in the case of a race
@@ -244,7 +244,7 @@ module Dependabot
244
244
 
245
245
  # Branch creation will fail if a branch called `dependabot` already
246
246
  # exists, since git won't be able to create a dir with the same name
247
- ref = "heads/#{SecureRandom.hex[0..3] + branch_name}"
247
+ ref = "refs/heads/#{SecureRandom.hex[0..3] + branch_name}"
248
248
  retry
249
249
  end
250
250
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.144.0"
4
+ VERSION = "0.145.4"
5
5
  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.144.0
4
+ version: 0.145.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-05 00:00:00.000000000 Z
11
+ date: 2021-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -298,14 +298,14 @@ dependencies:
298
298
  requirements:
299
299
  - - "~>"
300
300
  - !ruby/object:Gem::Version
301
- version: 1.13.0
301
+ version: 1.14.0
302
302
  type: :development
303
303
  prerelease: false
304
304
  version_requirements: !ruby/object:Gem::Requirement
305
305
  requirements:
306
306
  - - "~>"
307
307
  - !ruby/object:Gem::Version
308
- version: 1.13.0
308
+ version: 1.14.0
309
309
  - !ruby/object:Gem::Dependency
310
310
  name: simplecov
311
311
  requirement: !ruby/object:Gem::Requirement