Sha256: 5516448754ac3d5b019dfe16e38b12c82909beafd3201bfa945cc14cffb77cb1

Contents?: true

Size: 1.91 KB

Versions: 23

Compression:

Stored size: 1.91 KB

Contents

# frozen_string_literal: true

module KnapsackPro
  module Client
    module API
      module V1
        class BuildDistributions < Base
          TEST_SUITE_SPLIT_CACHE_MISS_CODE = 'TEST_SUITE_SPLIT_CACHE_MISS'

          class << self
            def subset(args)
              request_hash = {
                :fixed_test_suite_split => KnapsackPro::Config::Env.fixed_test_suite_split,
                :cache_read_attempt => args.fetch(:cache_read_attempt),
                :commit_hash => args.fetch(:commit_hash),
                :branch => args.fetch(:branch),
                :node_total => args.fetch(:node_total),
                :node_index => args.fetch(:node_index),
                :ci_build_id => KnapsackPro::Config::Env.ci_node_build_id,
                :user_seat => KnapsackPro::Config::Env.masked_user_seat,
                :build_author => KnapsackPro::RepositoryAdapters::GitAdapter.new.build_author,
                :commit_authors => KnapsackPro::RepositoryAdapters::GitAdapter.new.commit_authors,
              }

              unless request_hash[:cache_read_attempt]
                request_hash.merge!({
                  :test_files => args.fetch(:test_files)
                })
              end

              action_class.new(
                endpoint_path: '/v1/build_distributions/subset',
                http_method: :post,
                request_hash: request_hash
              )
            end

            def last(args)
              action_class.new(
                endpoint_path: '/v1/build_distributions/last',
                http_method: :get,
                request_hash: {
                  :commit_hash => args.fetch(:commit_hash),
                  :branch => args.fetch(:branch),
                  :node_total => args.fetch(:node_total),
                  :node_index => args.fetch(:node_index),
                }
              )
            end
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
knapsack_pro-7.13.0 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.12.1 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.12.0 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.11.0 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.10.0 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.9.0 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.8.2 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.8.1 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.8.0 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.7.0 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.6.2 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.6.1 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.6.0 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.1.0 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.0.1 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-7.0.0 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-6.0.4 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-6.0.3 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-6.0.2 lib/knapsack_pro/client/api/v1/build_distributions.rb
knapsack_pro-6.0.1 lib/knapsack_pro/client/api/v1/build_distributions.rb