def badge_url
if pacticipant && version && environment
badge_service.can_i_deploy_badge_url(identifier_from_path[:branch_name], identifier_from_path[:environment_name], label, results.deployable?)
elsif pacticipant.nil?
badge_service.error_badge_url("pacticipant", "not found")
elsif version.nil?
if branch_service.find_branch(**identifier_from_path.slice(:pacticipant_name, :branch_name)).nil?
badge_service.error_badge_url("branch", "not found")
else
badge_service.error_badge_url("version", "not found")
end
else
badge_service.error_badge_url("environment", "not found")
end
end