Exception: Dependabot::BlockedDependencyVersion

Inherits:
DependabotError
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/errors.rb

Overview

Raised when regenerating a lockfile would introduce or change a transitive (indirect) dependency to a version that matches a configured blocked version. The offending change is rejected so the blocked version is never shipped, while other dependencies are still allowed to update.

Constant Summary

Constants inherited from DependabotError

DependabotError::BASIC_AUTH_REGEX, DependabotError::FURY_IO_PATH_REGEX

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dependency_name:, blocked_version:, version_requirement:, reason: nil) ⇒ BlockedDependencyVersion

Returns a new instance of BlockedDependencyVersion.



962
963
964
965
966
967
968
969
970
971
972
# File 'lib/dependabot/errors.rb', line 962

def initialize(dependency_name:, blocked_version:, version_requirement:, reason: nil)
  @dependency_name = dependency_name
  @blocked_version = blocked_version
  @version_requirement = version_requirement
  @reason = reason

  msg = "Update blocked: transitive dependency #{dependency_name} #{blocked_version} " \
        "matches blocked version requirement '#{version_requirement}'"
  msg += " (reason: #{reason})" if reason && !reason.empty?
  super(msg)
end

Instance Attribute Details

#blocked_versionObject (readonly)

Returns the value of attribute blocked_version.



946
947
948
# File 'lib/dependabot/errors.rb', line 946

def blocked_version
  @blocked_version
end

#dependency_nameObject (readonly)

Returns the value of attribute dependency_name.



943
944
945
# File 'lib/dependabot/errors.rb', line 943

def dependency_name
  @dependency_name
end

#reasonObject (readonly)

Returns the value of attribute reason.



952
953
954
# File 'lib/dependabot/errors.rb', line 952

def reason
  @reason
end

#version_requirementObject (readonly)

Returns the value of attribute version_requirement.



949
950
951
# File 'lib/dependabot/errors.rb', line 949

def version_requirement
  @version_requirement
end