dependabot-common 0.262.0 → 0.263.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: '08b81e6c1e571457e794fa62147845a9e154ff6ea8a9f0d7fbab11b2c9bbb476'
4
- data.tar.gz: aeffcec5729d490fea8e7048c4b359befd8cd800ca97b9ac5a6a0751c7b47435
3
+ metadata.gz: 22016be70b3847889c81eabf845be31526245c9236559a27b5109d47018d7235
4
+ data.tar.gz: 13cd4ef806fe2f7e9d3957a053a221282098c1246802b1973900b0679a13911d
5
5
  SHA512:
6
- metadata.gz: 1f7687bb71080b85780d5d0672de40730c590076da5511cc17295271258f80965645a6e468e5254e5eea1d0188f5c76be592c760d617b9688d8d3c321b5b2e40
7
- data.tar.gz: 9dc8d8c488bb81d85a16db553d2acae1b6fba9fef1543a763aa6850fff23a94923118f773164a991a05b02f1a935fe61ca1e2c772397a090abbec5aef015473e
6
+ metadata.gz: bf3a197a93951f0296ea1258ee4a8a941732a2cc4a72fb319a31fc9561fa2e661c4079bbc8f3771c7a8d1d774ef38912fbc2c2abf23cad7565929eda505a77b4
7
+ data.tar.gz: 0d8b54e3ff114cc8a3bb58eb8843d781befcf111df3261ac814aa77b262ccda2131aedfe46acd3e556a86e220c90457b3475598d2431bbaf581f954d21e83ddc
@@ -191,6 +191,11 @@ module Dependabot
191
191
  "error-type": "private_source_authentication_failure",
192
192
  "error-detail": { source: error.source }
193
193
  }
194
+ when Dependabot::DependencyNotFound
195
+ {
196
+ "error-type": "dependency_not_found",
197
+ "error-detail": { source: error.source }
198
+ }
194
199
  when Dependabot::PrivateSourceTimedOut
195
200
  {
196
201
  "error-type": "private_source_timed_out",
@@ -511,6 +516,20 @@ module Dependabot
511
516
  end
512
517
  end
513
518
 
519
+ class DependencyNotFound < DependabotError
520
+ extend T::Sig
521
+
522
+ sig { returns(String) }
523
+ attr_reader :source
524
+
525
+ sig { params(source: T.nilable(String)).void }
526
+ def initialize(source)
527
+ @source = T.let(sanitize_source(T.must(source)), String)
528
+ msg = "The following dependency could not be found : #{@source}"
529
+ super(msg)
530
+ end
531
+ end
532
+
514
533
  # Useful for JS file updaters, where the registry API sometimes returns
515
534
  # different results to the actual update process
516
535
  class InconsistentRegistryResponse < DependabotError; end
@@ -25,6 +25,10 @@ module Dependabot
25
25
  TEAM_MENTION_REGEX = %r{(?<![A-Za-z0-9`~])@(?<org>#{GITHUB_USERNAME})/(?<team>#{GITHUB_USERNAME})/?}
26
26
  # End of string
27
27
  EOS_REGEX = /\z/
28
+
29
+ # regex to match markdown headers or links
30
+ MARKDOWN_REGEX = /\[(.+?)\]\(([^)]+)\)|\[(.+?)\]|\A#+\s+([^\s].*)/
31
+
28
32
  COMMONMARKER_OPTIONS = T.let(
29
33
  %i(GITHUB_PRE_LANG FULL_INFO_STRING).freeze,
30
34
  T::Array[Symbol]
@@ -53,10 +57,16 @@ module Dependabot
53
57
  sanitize_links(doc)
54
58
  sanitize_nwo_text(doc)
55
59
 
60
+ render_options = if text.match?(MARKDOWN_REGEX)
61
+ COMMONMARKER_OPTIONS
62
+ else
63
+ COMMONMARKER_OPTIONS + [:HARDBREAKS]
64
+ end
65
+
56
66
  mode = unsafe ? :UNSAFE : :DEFAULT
57
- return doc.to_commonmark([mode] + COMMONMARKER_OPTIONS) unless format_html
67
+ return doc.to_commonmark([mode] + render_options) unless format_html
58
68
 
59
- doc.to_html(([mode] + COMMONMARKER_OPTIONS), COMMONMARKER_EXTENSIONS)
69
+ doc.to_html(([mode] + render_options), COMMONMARKER_EXTENSIONS)
60
70
  end
61
71
 
62
72
  private
@@ -9,5 +9,12 @@ module Dependabot
9
9
  LockfileOnly = new("lockfile_only")
10
10
  WidenRanges = new("widen_ranges")
11
11
  end
12
+
13
+ extend T::Sig
14
+
15
+ sig { returns(T::Boolean) }
16
+ def lockfile_only?
17
+ self == LockfileOnly
18
+ end
12
19
  end
13
20
  end
@@ -258,13 +258,16 @@ module Dependabot
258
258
  FileUtils.mkdir_p(Utils::BUMP_TMP_DIR_PATH)
259
259
 
260
260
  previous_config = ENV.fetch("GIT_CONFIG_GLOBAL", nil)
261
+ previous_terminal_prompt = ENV.fetch("GIT_TERMINAL_PROMPT", nil)
261
262
 
262
263
  begin
263
264
  ENV["GIT_CONFIG_GLOBAL"] = GIT_CONFIG_GLOBAL_PATH
265
+ ENV["GIT_TERMINAL_PROMPT"] = "false"
264
266
  configure_git_to_use_https_with_credentials(credentials, safe_directories)
265
267
  yield
266
268
  ensure
267
269
  ENV["GIT_CONFIG_GLOBAL"] = previous_config
270
+ ENV["GIT_TERMINAL_PROMPT"] = previous_terminal_prompt
268
271
  end
269
272
  rescue Errno::ENOSPC => e
270
273
  raise Dependabot::OutOfDisk, e.message
data/lib/dependabot.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Dependabot
5
- VERSION = "0.262.0"
5
+ VERSION = "0.263.0"
6
6
  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.262.0
4
+ version: 0.263.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-20 00:00:00.000000000 Z
11
+ date: 2024-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-codecommit
@@ -597,7 +597,7 @@ licenses:
597
597
  - MIT
598
598
  metadata:
599
599
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
600
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.262.0
600
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.263.0
601
601
  post_install_message:
602
602
  rdoc_options: []
603
603
  require_paths: