Sha256: b6fa7a3d15774748c14889c9bbd56afdfa8ba1f06e4ab8614d71f4181f48bfd6

Contents?: true

Size: 1.89 KB

Versions: 11

Compression:

Stored size: 1.89 KB

Contents

#!/usr/bin/env ruby
require 'hybrid_platforms_conductor/executable'

git_from = 'master'
git_to = nil
smallest_set = false
platform = nil
platforms_handler = nil
executable = HybridPlatformsConductor::Executable.new(nodes_selection_options: false) do |opts|
  opts.on('-f', '--from-commit COMMIT_ID', "Specify the GIT commit from which we look for diffs. Defaults to #{git_from}.") do |commit_id|
    git_from = commit_id
  end
  opts.on('-p', '--platform PLATFORM_NAME', "Specify the repository on which to perform the diff. Possible values are #{platforms_handler.known_platforms.map(&:name).join(', ')}") do |platform_name|
    platform = platform_name
  end
  opts.on('-s', '--smallest-test-sample', 'Display the minimal set of nodes to check that would validate all modifications.') do
    smallest_set = true
  end
  opts.on('-t', '--to-commit COMMIT_ID', 'Specify the GIT commit to which we look for diffs. Defaults to current checked out files.') do |commit_id|
    git_to = commit_id
  end
end
nodes_handler = executable.nodes_handler
platforms_handler = executable.platforms_handler
cmd_runner = executable.cmd_runner
executable.parse_options!
raise 'No platform specified. Please use --platform option' if platform.nil?

all_impacted_nodes, impacted_nodes, impacted_services, impact_global = nodes_handler.impacted_nodes_from_git_diff(
  platform,
  from_commit: git_from,
  to_commit: git_to,
  smallest_set: smallest_set
)

executable.out '* Potentially all nodes of this platform are impacted.' if impact_global
executable.out ''
executable.out "* #{impacted_services.size} impacted services:\n#{impacted_services.join("\n")}"
executable.out ''
executable.out "* #{impacted_nodes.size} impacted nodes (directly):\n#{impacted_nodes.join("\n")}"
executable.out ''
executable.out "* #{all_impacted_nodes.size} impacted nodes (total#{smallest_set ? ' smallest set' : ''}):\n#{all_impacted_nodes.join("\n")}"
executable.out ''

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.0.0 bin/get_impacted_nodes
hybrid_platforms_conductor-32.18.0 bin/get_impacted_nodes
hybrid_platforms_conductor-32.17.1 bin/get_impacted_nodes
hybrid_platforms_conductor-32.17.0 bin/get_impacted_nodes
hybrid_platforms_conductor-32.16.4 bin/get_impacted_nodes
hybrid_platforms_conductor-32.16.3 bin/get_impacted_nodes
hybrid_platforms_conductor-32.16.2 bin/get_impacted_nodes
hybrid_platforms_conductor-32.16.1 bin/get_impacted_nodes
hybrid_platforms_conductor-32.16.0 bin/get_impacted_nodes
hybrid_platforms_conductor-32.15.0 bin/get_impacted_nodes
hybrid_platforms_conductor-32.14.0 bin/get_impacted_nodes