dependabot-composer 0.103.0 → 0.103.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dependabot/composer/file_fetcher.rb +23 -15
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a00f0b1d602746a20b3eb2cac2a4c244e4825eca5609d1437da9c887c7f9c9d
|
4
|
+
data.tar.gz: b53978ab4a8106a365cf9bdb4258f8e8f2d3b6f5b88374b2a31f3fd09c783830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44aacb1a8124e4afc26fb5a6288f05f47dd68b2823c9991000d6567ed85807c9267dd0270d6a9509c3da95abd43ab7181e6d105cc53a3d10f65dd3f186dcb298
|
7
|
+
data.tar.gz: 57a7ae70391187a9d057f00d48c05bb62b1612c37d2b628f799bcae0017c515773390dd7fbe7098524f0be163488b98508425b51234d8c2f6207777187191bb7
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "json"
|
3
4
|
require "dependabot/file_fetchers"
|
4
5
|
require "dependabot/file_fetchers/base"
|
5
6
|
|
@@ -59,7 +60,7 @@ module Dependabot
|
|
59
60
|
begin
|
60
61
|
composer_json_files << fetch_file_with_root_fallback(file)
|
61
62
|
rescue Dependabot::DependencyFileNotFound
|
62
|
-
unfetchable_deps <<
|
63
|
+
unfetchable_deps << dir
|
63
64
|
end
|
64
65
|
end
|
65
66
|
end
|
@@ -99,22 +100,29 @@ module Dependabot
|
|
99
100
|
select { |file| file.type == "dir" }.
|
100
101
|
map { |f| path.gsub(/\*$/, f.name) }
|
101
102
|
rescue Octokit::NotFound, Gitlab::Error::NotFound
|
102
|
-
|
103
|
-
|
104
|
-
|
103
|
+
lockfile_path_dependency_paths.
|
104
|
+
select { |p| p.to_s.start_with?(path.gsub(/\*$/, "")) }
|
105
|
+
end
|
105
106
|
|
106
|
-
|
107
|
-
|
108
|
-
|
107
|
+
def lockfile_path_dependency_paths
|
108
|
+
keys = FileParser::DEPENDENCY_GROUP_KEYS.
|
109
|
+
map { |h| h.fetch(:lockfile) }
|
109
110
|
|
110
|
-
|
111
|
-
|
112
|
-
depth = directory.gsub(%r{^/}, "").gsub(%r{/$}, "").split("/").count
|
113
|
-
dir = "../" * depth + path.gsub(/\*$/, "").gsub(/^\.*/, "")
|
111
|
+
keys.flat_map do |key|
|
112
|
+
next [] unless parsed_lockfile[key]
|
114
113
|
|
115
|
-
|
116
|
-
|
117
|
-
|
114
|
+
parsed_lockfile[key].
|
115
|
+
select { |details| details.dig("dist", "type") == "path" }.
|
116
|
+
map { |details| details.dig("dist", "url") }
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def parsed_lockfile
|
121
|
+
return {} unless composer_lock
|
122
|
+
|
123
|
+
@parsed_lockfile ||= JSON.parse(composer_lock.content)
|
124
|
+
rescue JSON::ParserError
|
125
|
+
{}
|
118
126
|
end
|
119
127
|
|
120
128
|
def fetch_file_with_root_fallback(filename)
|
@@ -125,7 +133,7 @@ module Dependabot
|
|
125
133
|
rescue Dependabot::DependencyFileNotFound
|
126
134
|
# If the file isn't found at the full path, try looking for it
|
127
135
|
# without considering the directory (i.e., check if the path should
|
128
|
-
# have been
|
136
|
+
# have been relative to the root of the repository).
|
129
137
|
cleaned_filename = filename.gsub(/^\./, "")
|
130
138
|
cleaned_filename = Pathname.new(cleaned_filename).cleanpath.to_path
|
131
139
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-composer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.103.
|
4
|
+
version: 0.103.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.103.
|
19
|
+
version: 0.103.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.103.
|
26
|
+
version: 0.103.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|