Class: Dependabot::Bundler::UpdateChecker::ConflictingDependencyResolver

Inherits:
Object
  • Object
show all
Includes:
SharedBundlerHelpers
Defined in:
lib/dependabot/bundler/update_checker/conflicting_dependency_resolver.rb

Constant Summary

Constants included from SharedBundlerHelpers

SharedBundlerHelpers::GIT_REF_REGEX, SharedBundlerHelpers::GIT_REGEX, SharedBundlerHelpers::PATH_REGEX, SharedBundlerHelpers::RETRYABLE_ERRORS, SharedBundlerHelpers::RETRYABLE_PRIVATE_REGISTRY_ERRORS

Instance Attribute Summary

Attributes included from SharedBundlerHelpers

#credentials, #dependency_files, #repo_contents_path

Instance Method Summary collapse

Methods included from SharedBundlerHelpers

#base_directory, #gemfile, #git_source_credentials, #handle_bundler_errors, #in_a_native_bundler_context, #inaccessible_git_dependencies, #jfrog_source, #lockfile, #private_registry_credentials, #relevant_credentials, #retryable_error?, #sanitized_lockfile_body, #using_bundler_2?, #write_temporary_dependency_files

Constructor Details

#initialize(dependency_files:, repo_contents_path:, credentials:) ⇒ ConflictingDependencyResolver

Returns a new instance of ConflictingDependencyResolver.



14
15
16
17
18
# File 'lib/dependabot/bundler/update_checker/conflicting_dependency_resolver.rb', line 14

def initialize(dependency_files:, repo_contents_path:, credentials:)
  @dependency_files = dependency_files
  @repo_contents_path = repo_contents_path
  @credentials = credentials
end

Instance Method Details

#conflicting_dependencies(dependency:, target_version:) ⇒ Array<Hash{String => String}] * name [String] the blocking dependencies name * version [String] the version of the blocking dependency * requirement [String] the requirement on the target_dependency

Finds any dependencies in the lockfile that have a subdependency on the given dependency that does not satisfly the target_version.

Parameters:

  • dependency (Dependabot::Dependency)

    the dependency to check

  • target_version (String)

    the version to check

Returns:

  • (Array<Hash{String => String}] * name [String] the blocking dependencies name * version [String] the version of the blocking dependency * requirement [String] the requirement on the target_dependency)

    Array<Hash=> String]

    • name [String] the blocking dependencies name

    • version [String] the version of the blocking dependency

    • requirement [String] the requirement on the target_dependency



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/dependabot/bundler/update_checker/conflicting_dependency_resolver.rb', line 29

def conflicting_dependencies(dependency:, target_version:)
  in_a_native_bundler_context(error_handling: false) do |tmp_dir|
    SharedHelpers.run_helper_subprocess(
      command: NativeHelpers.helper_path,
      function: "conflicting_dependencies",
      args: {
        dir: tmp_dir,
        dependency_name: dependency.name,
        target_version: target_version,
        credentials: relevant_credentials,
        lockfile_name: lockfile.name,
        using_bundler_2: using_bundler_2?
      }
    )
  end
end