dependabot-npm_and_yarn 0.125.3 → 0.126.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -73,7 +73,7 @@ module Dependabot
73
73
  next unless semver_version_for(details["version"])
74
74
  next if alias_package?(req)
75
75
 
76
- # Note: The DependencySet will de-dupe our dependencies, so they
76
+ # NOTE: The DependencySet will de-dupe our dependencies, so they
77
77
  # end up unique by name. That's not a perfect representation of
78
78
  # the nested nature of JS resolution, but it makes everything work
79
79
  # comparably to other flat-resolution strategies
@@ -92,7 +92,7 @@ module Dependabot
92
92
  def package_lock_dependencies
93
93
  dependency_set = Dependabot::NpmAndYarn::FileParser::DependencySet.new
94
94
 
95
- # Note: The DependencySet will de-dupe our dependencies, so they
95
+ # NOTE: The DependencySet will de-dupe our dependencies, so they
96
96
  # end up unique by name. That's not a perfect representation of
97
97
  # the nested nature of JS resolution, but it makes everything work
98
98
  # comparably to other flat-resolution strategies
@@ -108,7 +108,7 @@ module Dependabot
108
108
  def shrinkwrap_dependencies
109
109
  dependency_set = Dependabot::NpmAndYarn::FileParser::DependencySet.new
110
110
 
111
- # Note: The DependencySet will de-dupe our dependencies, so they
111
+ # NOTE: The DependencySet will de-dupe our dependencies, so they
112
112
  # end up unique by name. That's not a perfect representation of
113
113
  # the nested nature of JS resolution, but it makes everything work
114
114
  # comparably to other flat-resolution strategies
@@ -286,7 +286,7 @@ module Dependabot
286
286
  lockfile)
287
287
  lockfile_dir = Pathname.new(lockfile.name).dirname
288
288
  modules_path = lockfile_dir.join("node_modules")
289
- # Note: don't include the dependency names to prevent opening
289
+ # NOTE: don't include the dependency names to prevent opening
290
290
  # multiple issues for each dependency that fails because we unique
291
291
  # issues on the error message (issue detail) on the backend
292
292
  #
@@ -43,7 +43,7 @@ module Dependabot
43
43
 
44
44
  def lowest_resolvable_security_fix_version
45
45
  raise "Dependency not vulnerable!" unless vulnerable?
46
- # Note: we currently don't resolve transitive/sub-dependencies as
46
+ # NOTE: we currently don't resolve transitive/sub-dependencies as
47
47
  # npm/yarn don't provide any control over updating to a specific
48
48
  # sub-dependency
49
49
  return latest_resolvable_version unless dependency.top_level?
@@ -36,16 +36,22 @@ module Dependabot
36
36
  )
37
37
  dependency_files_builder.write_temporary_dependency_files
38
38
 
39
- if dependency_files_builder.yarn_locks.any?
39
+ # TODO: Look into using npm/arborist for parsing yarn lockfiles (there's currently partial yarn support)
40
+ #
41
+ # Prefer the npm conflicting dependency parser if there's both a npm lockfile and a yarn.lock file as the
42
+ # npm parser handles edge cases where the package.json is out of sync with the lockfile, something the yarn
43
+ # parser doesn't deal with at the moment.
44
+ if dependency_files_builder.package_locks.any? ||
45
+ dependency_files_builder.shrinkwraps.any?
40
46
  SharedHelpers.run_helper_subprocess(
41
47
  command: NativeHelpers.helper_path,
42
- function: "yarn:findConflictingDependencies",
48
+ function: "npm:findConflictingDependencies",
43
49
  args: [Dir.pwd, dependency.name, target_version.to_s]
44
50
  )
45
51
  else
46
52
  SharedHelpers.run_helper_subprocess(
47
53
  command: NativeHelpers.helper_path,
48
- function: "npm:findConflictingDependencies",
54
+ function: "yarn:findConflictingDependencies",
49
55
  args: [Dir.pwd, dependency.name, target_version.to_s]
50
56
  )
51
57
  end
@@ -361,7 +361,9 @@ module Dependabot
361
361
  idempotent: true,
362
362
  **SharedHelpers.excon_defaults
363
363
  )
364
- return web_response.body.include?("Forgot password?")
364
+ # NOTE: returns 429 when the login page is rate limited
365
+ return web_response.body.include?("Forgot password?") ||
366
+ web_response.status == 429
365
367
  end
366
368
 
367
369
  true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-npm_and_yarn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.125.3
4
+ version: 0.126.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-16 00:00:00.000000000 Z
11
+ date: 2020-12-08 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.125.3
19
+ version: 0.126.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.125.3
26
+ version: 0.126.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,28 +100,28 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.93.0
103
+ version: 1.5.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.93.0
110
+ version: 1.5.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.19.0
117
+ version: 0.20.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: 0.19.0
124
+ version: 0.20.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov-console
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -204,6 +204,15 @@ files:
204
204
  - helpers/test/npm/fixtures/updater/updated/package-lock.json
205
205
  - helpers/test/npm/helpers.js
206
206
  - helpers/test/npm/updater.test.js
207
+ - helpers/test/yarn/conflicting-dependency-parser.test.js
208
+ - helpers/test/yarn/fixtures/conflicting-dependency-parser/deeply-nested/package.json
209
+ - helpers/test/yarn/fixtures/conflicting-dependency-parser/deeply-nested/yarn.lock
210
+ - helpers/test/yarn/fixtures/conflicting-dependency-parser/dev-dependencies/package.json
211
+ - helpers/test/yarn/fixtures/conflicting-dependency-parser/dev-dependencies/yarn.lock
212
+ - helpers/test/yarn/fixtures/conflicting-dependency-parser/nested/package.json
213
+ - helpers/test/yarn/fixtures/conflicting-dependency-parser/nested/yarn.lock
214
+ - helpers/test/yarn/fixtures/conflicting-dependency-parser/simple/package.json
215
+ - helpers/test/yarn/fixtures/conflicting-dependency-parser/simple/yarn.lock
207
216
  - helpers/test/yarn/fixtures/updater/original/package.json
208
217
  - helpers/test/yarn/fixtures/updater/original/yarn.lock
209
218
  - helpers/test/yarn/fixtures/updater/updated/yarn.lock