dependabot-common 0.111.2 → 0.111.3

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: 35b217009843be8eabe9ef89659ed34b10a10ede90b7fd5ee6805df4088773d5
4
- data.tar.gz: af229198761bdfde61e9f2cdb3dff967c0923aa0f3d60731288410ccb69c176a
3
+ metadata.gz: 3e52c9bcfccc4d3891dd4a518c543ce06e94302987b585b3782b3450dd82922d
4
+ data.tar.gz: ea24e9f8444b95fdc18755a4035a3f89484a5c523f3f338e11d9bfc4b23dbf98
5
5
  SHA512:
6
- metadata.gz: ad0096f35e338d18c597c41f5db959ecbe34dfc66926e7f78a6394685129b34944c9c1514271eb04744d23b5411a97ceacf859193e7a3cdb82c6743fc5fe22f2
7
- data.tar.gz: aa9c3b759369886280f9cc6c91d128897b47f1110d361e13ea3aa3817b3553fe5966e8a862734a4326a99fd61e3788cc90b69a86ce054a0a654a2f3f5d20f9b5
6
+ metadata.gz: ca48137299359b6940959fed6da9121c1f1f98c7bad5f2ac917352640c4bf6d11ba8747fa0dd81c177794123d0c1d5277856e35b5d3f9c53e071ac142f3f7127
7
+ data.tar.gz: 3eee2255f84b0c1103905f69c6fe0b3a06f90f7874696664c70cb812e1be3048c34624901bc213dabdacb771185f4fa9dac87ba22fe20c024f23c32e4b620de0
@@ -84,13 +84,14 @@ module Dependabot
84
84
  def fetch_file_from_host(filename, type: "file", fetch_submodules: false)
85
85
  path = Pathname.new(File.join(directory, filename)).cleanpath.to_path
86
86
  content = _fetch_file_content(path, fetch_submodules: fetch_submodules)
87
- type = @linked_paths.key?(path) ? "symlink" : type
87
+ type = @linked_paths.key?(path.gsub(%r{^/}, "")) ? "symlink" : type
88
88
 
89
89
  DependencyFile.new(
90
90
  name: Pathname.new(filename).cleanpath.to_path,
91
91
  directory: directory,
92
92
  type: type,
93
- content: content
93
+ content: content,
94
+ symlink_target: @linked_paths.dig(path.gsub(%r{^/}, ""), :path)
94
95
  )
95
96
  rescue *CLIENT_NOT_FOUND_ERRORS
96
97
  raise Dependabot::DependencyFileNotFound, path
@@ -323,16 +324,22 @@ module Dependabot
323
324
  end
324
325
 
325
326
  # rubocop:disable Metrics/AbcSize
327
+ # rubocop:disable Metrics/MethodLength
326
328
  def _fetch_file_content_from_github(path, repo, commit)
327
329
  tmp = github_client.contents(repo, path: path, ref: commit)
328
330
 
329
331
  raise Octokit::NotFound if tmp.is_a?(Array)
330
332
 
331
333
  if tmp.type == "symlink"
332
- @linked_paths[path] = tmp.target
334
+ @linked_paths[path] = {
335
+ repo: repo,
336
+ provider: "github",
337
+ commit: commit,
338
+ path: Pathname.new(tmp.target).cleanpath.to_path
339
+ }
333
340
  tmp = github_client.contents(
334
341
  repo,
335
- path: tmp.target,
342
+ path: Pathname.new(tmp.target).cleanpath.to_path,
336
343
  ref: commit
337
344
  )
338
345
  end
@@ -354,6 +361,7 @@ module Dependabot
354
361
  Base64.decode64(tmp.content).force_encoding("UTF-8").encode
355
362
  end
356
363
  # rubocop:enable Metrics/AbcSize
364
+ # rubocop:enable Metrics/MethodLength
357
365
 
358
366
  def default_branch_for_repo
359
367
  @default_branch_for_repo ||= client_for_provider.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.111.2"
4
+ VERSION = "0.111.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.111.2
4
+ version: 0.111.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot