dependabot-composer 0.237.0 → 0.239.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddfe319f7ede977e2944d242cf5a8ec6dbf2d9fbcaa821d021a0a65cf9cb8536
4
- data.tar.gz: 586283822ff58812d97923656eb4b99a87bcfc0330b1d9b94b77f45e478fbf04
3
+ metadata.gz: 243823ddde365951ade479a3f1342dc58d8167e1a435ac8c802d602c996143c6
4
+ data.tar.gz: 75877dc0ab7ca581ce37863806997c08b9fce38355ec73444d8d691a874de4ce
5
5
  SHA512:
6
- metadata.gz: 2cc37797a11172e366e852a74b8e9fdca38af9c0a6732825c01bee8931c837a56f5fedbcf39311acceb34e55147f3629d2c1a57a60d00a24303b8b1520c91a81
7
- data.tar.gz: cbbac949807ab44924c051d223819ff7673ed898edb650289bc5e00b36039ff79216b5a40999449f11d7409a4ae2b6231bd131c5323200c9b62327bd60610b78
6
+ metadata.gz: 59d83d007f9422e557ebb0be3ad674eb419b23c93397363b1d1a17f9a731834ab6b7be4da751f790d6a4febc87d29ce33209e408ff60c20d3d635355682cc0bd
7
+ data.tar.gz: fd0d699b8b885e0247a36307fdd3762c33f3837b9575949ccd301ba449416af24efac36028bd07cd79298dbc9b1766d23fc5a52ec2524d81d38506abcf55f2c6
data/helpers/v1/build CHANGED
@@ -1,4 +1,4 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env bash
2
2
 
3
3
  set -e
4
4
 
@@ -1920,16 +1920,16 @@
1920
1920
  },
1921
1921
  {
1922
1922
  "name": "phpstan/phpstan",
1923
- "version": "1.10.39",
1923
+ "version": "1.10.44",
1924
1924
  "source": {
1925
1925
  "type": "git",
1926
1926
  "url": "https://github.com/phpstan/phpstan.git",
1927
- "reference": "d9dedb0413f678b4d03cbc2279a48f91592c97c4"
1927
+ "reference": "bf84367c53a23f759513985c54ffe0d0c249825b"
1928
1928
  },
1929
1929
  "dist": {
1930
1930
  "type": "zip",
1931
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d9dedb0413f678b4d03cbc2279a48f91592c97c4",
1932
- "reference": "d9dedb0413f678b4d03cbc2279a48f91592c97c4",
1931
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/bf84367c53a23f759513985c54ffe0d0c249825b",
1932
+ "reference": "bf84367c53a23f759513985c54ffe0d0c249825b",
1933
1933
  "shasum": ""
1934
1934
  },
1935
1935
  "require": {
@@ -1971,7 +1971,7 @@
1971
1971
  "type": "tidelift"
1972
1972
  }
1973
1973
  ],
1974
- "time": "2023-10-17T15:46:26+00:00"
1974
+ "time": "2023-11-21T16:30:46+00:00"
1975
1975
  },
1976
1976
  {
1977
1977
  "name": "psr/cache",
data/helpers/v2/build CHANGED
@@ -1,4 +1,4 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env bash
2
2
 
3
3
  set -e
4
4
 
@@ -1052,16 +1052,16 @@
1052
1052
  },
1053
1053
  {
1054
1054
  "name": "symfony/console",
1055
- "version": "v5.4.28",
1055
+ "version": "v5.4.31",
1056
1056
  "source": {
1057
1057
  "type": "git",
1058
1058
  "url": "https://github.com/symfony/console.git",
1059
- "reference": "f4f71842f24c2023b91237c72a365306f3c58827"
1059
+ "reference": "11ac5f154e0e5c4c77af83ad11ead9165280b92a"
1060
1060
  },
1061
1061
  "dist": {
1062
1062
  "type": "zip",
1063
- "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827",
1064
- "reference": "f4f71842f24c2023b91237c72a365306f3c58827",
1063
+ "url": "https://api.github.com/repos/symfony/console/zipball/11ac5f154e0e5c4c77af83ad11ead9165280b92a",
1064
+ "reference": "11ac5f154e0e5c4c77af83ad11ead9165280b92a",
1065
1065
  "shasum": ""
1066
1066
  },
1067
1067
  "require": {
@@ -1131,7 +1131,7 @@
1131
1131
  "terminal"
1132
1132
  ],
1133
1133
  "support": {
1134
- "source": "https://github.com/symfony/console/tree/v5.4.28"
1134
+ "source": "https://github.com/symfony/console/tree/v5.4.31"
1135
1135
  },
1136
1136
  "funding": [
1137
1137
  {
@@ -1147,7 +1147,7 @@
1147
1147
  "type": "tidelift"
1148
1148
  }
1149
1149
  ],
1150
- "time": "2023-08-07T06:12:30+00:00"
1150
+ "time": "2023-10-31T07:58:33+00:00"
1151
1151
  },
1152
1152
  {
1153
1153
  "name": "symfony/deprecation-contracts",
@@ -2061,16 +2061,16 @@
2061
2061
  },
2062
2062
  {
2063
2063
  "name": "symfony/string",
2064
- "version": "v5.4.29",
2064
+ "version": "v5.4.31",
2065
2065
  "source": {
2066
2066
  "type": "git",
2067
2067
  "url": "https://github.com/symfony/string.git",
2068
- "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d"
2068
+ "reference": "2765096c03f39ddf54f6af532166e42aaa05b24b"
2069
2069
  },
2070
2070
  "dist": {
2071
2071
  "type": "zip",
2072
- "url": "https://api.github.com/repos/symfony/string/zipball/e41bdc93def20eaf3bfc1537c4e0a2b0680a152d",
2073
- "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d",
2072
+ "url": "https://api.github.com/repos/symfony/string/zipball/2765096c03f39ddf54f6af532166e42aaa05b24b",
2073
+ "reference": "2765096c03f39ddf54f6af532166e42aaa05b24b",
2074
2074
  "shasum": ""
2075
2075
  },
2076
2076
  "require": {
@@ -2127,7 +2127,7 @@
2127
2127
  "utf8"
2128
2128
  ],
2129
2129
  "support": {
2130
- "source": "https://github.com/symfony/string/tree/v5.4.29"
2130
+ "source": "https://github.com/symfony/string/tree/v5.4.31"
2131
2131
  },
2132
2132
  "funding": [
2133
2133
  {
@@ -2143,56 +2143,56 @@
2143
2143
  "type": "tidelift"
2144
2144
  }
2145
2145
  ],
2146
- "time": "2023-09-13T11:47:41+00:00"
2146
+ "time": "2023-11-09T08:19:44+00:00"
2147
2147
  }
2148
2148
  ],
2149
2149
  "packages-dev": [
2150
2150
  {
2151
2151
  "name": "friendsofphp/php-cs-fixer",
2152
- "version": "v3.37.1",
2152
+ "version": "v3.40.0",
2153
2153
  "source": {
2154
2154
  "type": "git",
2155
2155
  "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
2156
- "reference": "c3fe76976081ab871aa654e872da588077e19679"
2156
+ "reference": "27d2b3265b5d550ec411b4319967ae7cfddfb2e0"
2157
2157
  },
2158
2158
  "dist": {
2159
2159
  "type": "zip",
2160
- "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/c3fe76976081ab871aa654e872da588077e19679",
2161
- "reference": "c3fe76976081ab871aa654e872da588077e19679",
2160
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/27d2b3265b5d550ec411b4319967ae7cfddfb2e0",
2161
+ "reference": "27d2b3265b5d550ec411b4319967ae7cfddfb2e0",
2162
2162
  "shasum": ""
2163
2163
  },
2164
2164
  "require": {
2165
- "composer/semver": "^3.3",
2165
+ "composer/semver": "^3.4",
2166
2166
  "composer/xdebug-handler": "^3.0.3",
2167
2167
  "ext-json": "*",
2168
2168
  "ext-tokenizer": "*",
2169
2169
  "php": "^7.4 || ^8.0",
2170
2170
  "sebastian/diff": "^4.0 || ^5.0",
2171
- "symfony/console": "^5.4 || ^6.0",
2172
- "symfony/event-dispatcher": "^5.4 || ^6.0",
2173
- "symfony/filesystem": "^5.4 || ^6.0",
2174
- "symfony/finder": "^5.4 || ^6.0",
2175
- "symfony/options-resolver": "^5.4 || ^6.0",
2176
- "symfony/polyfill-mbstring": "^1.27",
2177
- "symfony/polyfill-php80": "^1.27",
2178
- "symfony/polyfill-php81": "^1.27",
2179
- "symfony/process": "^5.4 || ^6.0",
2180
- "symfony/stopwatch": "^5.4 || ^6.0"
2171
+ "symfony/console": "^5.4 || ^6.0 || ^7.0",
2172
+ "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
2173
+ "symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
2174
+ "symfony/finder": "^5.4 || ^6.0 || ^7.0",
2175
+ "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
2176
+ "symfony/polyfill-mbstring": "^1.28",
2177
+ "symfony/polyfill-php80": "^1.28",
2178
+ "symfony/polyfill-php81": "^1.28",
2179
+ "symfony/process": "^5.4 || ^6.0 || ^7.0",
2180
+ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
2181
2181
  },
2182
2182
  "require-dev": {
2183
2183
  "facile-it/paraunit": "^1.3 || ^2.0",
2184
2184
  "justinrainbow/json-schema": "^5.2",
2185
- "keradus/cli-executor": "^2.0",
2185
+ "keradus/cli-executor": "^2.1",
2186
2186
  "mikey179/vfsstream": "^1.6.11",
2187
- "php-coveralls/php-coveralls": "^2.5.3",
2187
+ "php-coveralls/php-coveralls": "^2.7",
2188
2188
  "php-cs-fixer/accessible-object": "^1.1",
2189
- "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2",
2190
- "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1",
2191
- "phpspec/prophecy": "^1.16",
2189
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4",
2190
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4",
2191
+ "phpspec/prophecy": "^1.17",
2192
2192
  "phpspec/prophecy-phpunit": "^2.0",
2193
- "phpunit/phpunit": "^9.5",
2194
- "symfony/phpunit-bridge": "^6.2.3",
2195
- "symfony/yaml": "^5.4 || ^6.0"
2193
+ "phpunit/phpunit": "^9.6",
2194
+ "symfony/phpunit-bridge": "^6.3.8 || ^7.0",
2195
+ "symfony/yaml": "^5.4 || ^6.0 || ^7.0"
2196
2196
  },
2197
2197
  "suggest": {
2198
2198
  "ext-dom": "For handling output formats in XML",
@@ -2230,7 +2230,7 @@
2230
2230
  ],
2231
2231
  "support": {
2232
2232
  "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
2233
- "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.37.1"
2233
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.40.0"
2234
2234
  },
2235
2235
  "funding": [
2236
2236
  {
@@ -2238,20 +2238,20 @@
2238
2238
  "type": "github"
2239
2239
  }
2240
2240
  ],
2241
- "time": "2023-10-29T20:51:23+00:00"
2241
+ "time": "2023-11-26T09:25:53+00:00"
2242
2242
  },
2243
2243
  {
2244
2244
  "name": "phpstan/phpstan",
2245
- "version": "1.10.41",
2245
+ "version": "1.10.44",
2246
2246
  "source": {
2247
2247
  "type": "git",
2248
2248
  "url": "https://github.com/phpstan/phpstan.git",
2249
- "reference": "c6174523c2a69231df55bdc65b61655e72876d76"
2249
+ "reference": "bf84367c53a23f759513985c54ffe0d0c249825b"
2250
2250
  },
2251
2251
  "dist": {
2252
2252
  "type": "zip",
2253
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c6174523c2a69231df55bdc65b61655e72876d76",
2254
- "reference": "c6174523c2a69231df55bdc65b61655e72876d76",
2253
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/bf84367c53a23f759513985c54ffe0d0c249825b",
2254
+ "reference": "bf84367c53a23f759513985c54ffe0d0c249825b",
2255
2255
  "shasum": ""
2256
2256
  },
2257
2257
  "require": {
@@ -2300,7 +2300,7 @@
2300
2300
  "type": "tidelift"
2301
2301
  }
2302
2302
  ],
2303
- "time": "2023-11-05T12:57:57+00:00"
2303
+ "time": "2023-11-21T16:30:46+00:00"
2304
2304
  },
2305
2305
  {
2306
2306
  "name": "psr/event-dispatcher",
@@ -37,6 +37,7 @@ module Dependabot
37
37
  fetched_files << composer_json
38
38
  fetched_files << composer_lock if composer_lock
39
39
  fetched_files << auth_json if auth_json
40
+ fetched_files += artifact_dependencies
40
41
  fetched_files += path_dependencies
41
42
  fetched_files
42
43
  end
@@ -60,6 +61,41 @@ module Dependabot
60
61
  @auth_json = fetch_support_file("auth.json")
61
62
  end
62
63
 
64
+ def artifact_dependencies
65
+ return @artifact_dependencies if defined?(@artifact_dependencies)
66
+
67
+ # Find zip files in the artifact sources and download them.
68
+ @artifact_dependencies =
69
+ artifact_sources.map do |url|
70
+ repo_contents(dir: url)
71
+ .select { |file| file.type == "file" && file.name.end_with?(".zip") }
72
+ .map { |file| File.join(url, file.name) }
73
+ .map do |zip_file|
74
+ DependencyFile.new(
75
+ name: zip_file,
76
+ content: _fetch_file_content(zip_file),
77
+ directory: directory,
78
+ type: "file"
79
+ )
80
+ end
81
+ end.flatten
82
+
83
+ # Add .gitkeep to all directories in case they are empty. Composer isn't ok with empty directories.
84
+ @artifact_dependencies += artifact_sources.map do |url|
85
+ DependencyFile.new(
86
+ name: File.join(url, ".gitkeep"),
87
+ content: "",
88
+ directory: directory,
89
+ type: "file"
90
+ )
91
+ end
92
+
93
+ # Don't try to update these files, only used by composer for package resolution.
94
+ @artifact_dependencies.each { |f| f.support_file = true }
95
+
96
+ @artifact_dependencies
97
+ end
98
+
63
99
  def path_dependencies
64
100
  @path_dependencies ||=
65
101
  begin
@@ -90,8 +126,16 @@ module Dependabot
90
126
  end
91
127
  end
92
128
 
129
+ def artifact_sources
130
+ sources.select { |details| details["type"] == "artifact" }.map { |details| details["url"] }
131
+ end
132
+
93
133
  def path_sources
94
- @path_sources ||=
134
+ sources.select { |details| details["type"] == "path" }.map { |details| details["url"] }
135
+ end
136
+
137
+ def sources
138
+ @sources ||=
95
139
  begin
96
140
  repos = parsed_composer_json.fetch("repositories", [])
97
141
  if repos.is_a?(Hash) || repos.is_a?(Array)
@@ -99,8 +143,7 @@ module Dependabot
99
143
  repos = repos.select { |r| r.is_a?(Hash) }
100
144
 
101
145
  repos
102
- .select { |details| details["type"] == "path" }
103
- .map { |details| details["url"] }
146
+ .select { |details| details["type"] == "path" || details["type"] == "artifact" }
104
147
  else
105
148
  []
106
149
  end
@@ -242,6 +242,12 @@ module Dependabot
242
242
  end
243
243
 
244
244
  def write_temporary_dependency_files
245
+ artifact_dependencies.each do |file|
246
+ path = file.name
247
+ FileUtils.mkdir_p(Pathname.new(path).dirname)
248
+ File.write(file.name, file.content)
249
+ end
250
+
245
251
  path_dependencies.each do |file|
246
252
  path = file.name
247
253
  FileUtils.mkdir_p(Pathname.new(path).dirname)
@@ -509,6 +515,11 @@ module Dependabot
509
515
  @auth_json ||= dependency_files.find { |f| f.name == "auth.json" }
510
516
  end
511
517
 
518
+ def artifact_dependencies
519
+ @artifact_dependencies ||=
520
+ dependency_files.select { |f| f.name.end_with?(".zip", ".gitkeep") }
521
+ end
522
+
512
523
  def path_dependencies
513
524
  @path_dependencies ||=
514
525
  dependency_files.select { |f| f.name.end_with?("/composer.json") }
@@ -1,11 +1,16 @@
1
1
  # typed: true
2
2
  # frozen_string_literal: true
3
3
 
4
+ require "sorbet-runtime"
5
+
6
+ require "dependabot/requirement"
4
7
  require "dependabot/utils"
5
8
 
6
9
  module Dependabot
7
10
  module Composer
8
- class Requirement < Gem::Requirement
11
+ class Requirement < Dependabot::Requirement
12
+ extend T::Sig
13
+
9
14
  AND_SEPARATOR = /(?<=[a-zA-Z0-9*])(?<!\sas)[\s,]+(?![\s,]*[|-]|as)/
10
15
  OR_SEPARATOR = /(?<=[a-zA-Z0-9*])[\s,]*\|\|?\s*/
11
16
 
@@ -18,8 +23,9 @@ module Dependabot
18
23
 
19
24
  # Returns an array of requirements. At least one requirement from the
20
25
  # returned array must be satisfied for a version to be valid.
26
+ sig { override.params(requirement_string: T.nilable(String)).returns(T::Array[Requirement]) }
21
27
  def self.requirements_array(requirement_string)
22
- requirement_string.strip.split(OR_SEPARATOR).map do |req_string|
28
+ T.must(requirement_string).strip.split(OR_SEPARATOR).map do |req_string|
23
29
  new(req_string)
24
30
  end
25
31
  end
@@ -91,10 +91,18 @@ module Dependabot
91
91
  def write_temporary_dependency_files(unlock_requirement: true)
92
92
  write_dependency_file(unlock_requirement: unlock_requirement)
93
93
  write_path_dependency_files
94
+ write_zipped_path_dependency_files
94
95
  write_lockfile
95
96
  write_auth_file
96
97
  end
97
98
 
99
+ def write_zipped_path_dependency_files
100
+ zipped_path_dependency_files.each do |file|
101
+ FileUtils.mkdir_p(Pathname.new(file.name).dirname)
102
+ File.write(file.name, file.content)
103
+ end
104
+ end
105
+
98
106
  def write_dependency_file(unlock_requirement:)
99
107
  File.write(
100
108
  "composer.json",
@@ -471,6 +479,11 @@ module Dependabot
471
479
  dependency_files.select { |f| f.name.end_with?("/composer.json") }
472
480
  end
473
481
 
482
+ def zipped_path_dependency_files
483
+ @zipped_path_dependency_files ||=
484
+ dependency_files.select { |f| f.name.end_with?(".zip", ".gitkeep") }
485
+ end
486
+
474
487
  def lockfile
475
488
  @lockfile ||=
476
489
  dependency_files.find { |f| f.name == "composer.lock" }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-composer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.237.0
4
+ version: 0.239.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-21 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.237.0
19
+ version: 0.239.0
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.237.0
26
+ version: 0.239.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.57.2
117
+ version: 1.58.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.57.2
124
+ version: 1.58.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rubocop-performance
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -258,7 +258,7 @@ licenses:
258
258
  - Nonstandard
259
259
  metadata:
260
260
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
261
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.237.0
261
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.239.0
262
262
  post_install_message:
263
263
  rdoc_options: []
264
264
  require_paths: