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.



973
974
975
976
977
978
979
980
981
982
983
# File 'lib/dependabot/errors.rb', line 973

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.



957
958
959
# File 'lib/dependabot/errors.rb', line 957

def blocked_version
  @blocked_version
end

#dependency_nameObject (readonly)

Returns the value of attribute dependency_name.



954
955
956
# File 'lib/dependabot/errors.rb', line 954

def dependency_name
  @dependency_name
end

#reasonObject (readonly)

Returns the value of attribute reason.



963
964
965
# File 'lib/dependabot/errors.rb', line 963

def reason
  @reason
end

#version_requirementObject (readonly)

Returns the value of attribute version_requirement.



960
961
962
# File 'lib/dependabot/errors.rb', line 960

def version_requirement
  @version_requirement
end