dependabot-common 0.353.0 → 0.354.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: 67a7fe7744d8ef3f8ef01aeeb66b9a673a821c8165bcc4450d9d94b34c974e22
4
- data.tar.gz: 6f0d5f8625e35b1a94be21c3e70dc0d87cfd2e7b9382b607bcf2913828f511a8
3
+ metadata.gz: 706b10e32381ce400b4fdd4979f30065ac2e47b42dfa7b6889b4293651688551
4
+ data.tar.gz: 8e9a2b06dbac39075652dd24a29ab30f3de74fe34421d328cf57df31af338f36
5
5
  SHA512:
6
- metadata.gz: 5bcb903c2e83a426808e8b417c889f9f5b0c53cf3809a62c7dc9e97353445d5fa7cf4ee22f4056a919996841cdb297ce699f8eacba7556c0c90b673d0a19eda6
7
- data.tar.gz: 0e310dae91c687f4d2bfb5d63ffee3720786502c3161c2fdc6a0b464877d4badcb4128e172c4b4af3fb379e91b6358b0f6fb41fcbb6f50a557ff98064f2c7465
6
+ metadata.gz: 3eccc4f6f6d6eae7b07e2f38f14d55fdc909433618f30b9837a970309567cd74da80afbc66086a369aacf851d264c8e1b92dfbe330aab26b298ebaac7ad5e2ff
7
+ data.tar.gz: 78ed07bab036f349532ced55d3e40acc08a0dd4c0e15afd94f601b64e54391e9f40efe19a2933cbb48f3ec3df61d4f6f52977e764e04109cc5a8b6acb52293af
@@ -95,7 +95,12 @@ module Dependabot
95
95
  begin
96
96
  T.unsafe(Open3).popen3(*env_cmd) do |stdin, stdout_io, stderr_io, wait_thr| # rubocop:disable Metrics/BlockLength
97
97
  pid = wait_thr.pid
98
- Dependabot.logger.info("Started process PID: #{pid} with command: #{env_cmd.join(' ')}")
98
+ sanitized_env_cmd = if env_cmd.first.is_a?(Hash)
99
+ [SharedHelpers.send(:sanitize_env_for_logging, env_cmd.first), *env_cmd[1..]]
100
+ else
101
+ env_cmd
102
+ end
103
+ Dependabot.logger.info("Started process PID: #{pid} with command: #{sanitized_env_cmd.join(' ')}")
99
104
 
100
105
  # Write to stdin if input data is provided
101
106
  stdin&.write(stdin_data) if stdin_data
@@ -109,6 +109,7 @@ module Dependabot
109
109
  @source = source
110
110
  @credentials = credentials
111
111
  @repo_contents_path = repo_contents_path
112
+ @update_config = T.let(update_config, T.nilable(Dependabot::Config::UpdateConfig))
112
113
  @exclude_paths = T.let(update_config&.exclude_paths || [], T::Array[String])
113
114
  @linked_paths = T.let({}, T::Hash[T.untyped, T.untyped])
114
115
  @submodules = T.let([], T::Array[T.untyped])
@@ -928,6 +929,18 @@ module Dependabot
928
929
  next path if type == DependencyFile::Mode::SUBMODULE
929
930
  end
930
931
  end
932
+
933
+ # Check if a dependency name matches any ignore condition patterns
934
+ # This is a simplified check that matches by name pattern (with wildcards)
935
+ # without checking version requirements
936
+ sig { params(dependency_name: String).returns(T::Boolean) }
937
+ def dependency_ignored?(dependency_name)
938
+ return false unless @update_config
939
+
940
+ @update_config.ignore_conditions.any? do |ic|
941
+ Dependabot::Config::UpdateConfig.wildcard_match?(ic.dependency_name, dependency_name)
942
+ end
943
+ end
931
944
  end
932
945
  end
933
946
  end
@@ -175,7 +175,8 @@ module Dependabot
175
175
  time_taken = Time.now - start
176
176
 
177
177
  if ENV["DEBUG_HELPERS"] == "true"
178
- puts env_cmd
178
+ sanitized_env_cmd = [sanitize_env_for_logging(env), cmd].compact
179
+ puts sanitized_env_cmd
179
180
  puts function
180
181
  puts stdout
181
182
  puts stderr
@@ -542,5 +543,19 @@ module Dependabot
542
543
  "$ cd #{Dir.pwd} && echo \"#{escaped_stdin_data}\" | #{env_keys}#{command}"
543
544
  end
544
545
  private_class_method :helper_subprocess_bash_command
546
+
547
+ sig { params(env: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
548
+ def self.sanitize_env_for_logging(env)
549
+ return nil if env.nil?
550
+
551
+ env.transform_keys(&:to_s).each_with_object({}) do |(key, value), result|
552
+ # Only redact if the key contains "TOKEN" (case-insensitive)
553
+ result[key] = if key.match?(/TOKEN/i)
554
+ "<redacted>"
555
+ else
556
+ value
557
+ end
558
+ end
559
+ end
545
560
  end
546
561
  end
data/lib/dependabot.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Dependabot
5
- VERSION = "0.353.0"
5
+ VERSION = "0.354.0"
6
6
  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.353.0
4
+ version: 0.354.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -629,7 +629,7 @@ licenses:
629
629
  - MIT
630
630
  metadata:
631
631
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
632
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.353.0
632
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.354.0
633
633
  rdoc_options: []
634
634
  require_paths:
635
635
  - lib