# frozen_string_literal: true require 'thor' module Dri module Commands class Fetch < Thor namespace :fetch desc 'featureflags', 'Display feature flag changes for today' method_option :help, aliases: '-h', type: :boolean, desc: 'Display usage information' def featureflags(*) if options[:help] invoke :help, ['featureflags'] else require_relative 'fetch/featureflags' Dri::Commands::Fetch::FeatureFlags.new(options).execute end end desc 'triaged', 'Command description...' method_option :help, aliases: '-h', type: :boolean, desc: 'Display usage information' def triaged(*) if options[:help] invoke :help, ['triaged'] else require_relative 'fetch/triaged' Dri::Commands::Fetch::Triaged.new(options).execute end end desc 'testcases', 'Display failing testcases' method_option :help, aliases: '-h', type: :boolean, desc: 'Display usage information' method_option :filter_pipelines, type: :boolean, desc: 'Filter by pipeline' def testcases(*) if options[:help] invoke :help, ['testcases'] else require_relative 'fetch/testcases' Dri::Commands::Fetch::Testcases.new(options).execute end end desc 'failures', 'Display failures opened today' method_option :help, aliases: '-h', type: :boolean, desc: 'Display usage information' method_option :urgent, type: :boolean, desc: 'Shows failures that quickly escalated' def failures(*) if options[:help] invoke :help, ['failures'] else require_relative 'fetch/failures' Dri::Commands::Fetch::Failures.new(options).execute end end desc 'quarantines', 'Display open quarantine MRs' method_option :help, aliases: '-h', type: :boolean, desc: 'Display usage information' def quarantines(*) if options[:help] invoke :help, ['quarantines'] else require_relative 'fetch/quarantines' Dri::Commands::Fetch::Quarantines.new(options, search: '[QUARANTINE]').execute end end desc 'dequarantines', 'Display open dequarantine MRs' method_option :help, aliases: '-h', type: :boolean, desc: 'Display usage information' def dequarantines(*) return invoke :help, %w[quarantines] if options[:help] require_relative 'fetch/quarantines' Dri::Commands::Fetch::Quarantines.new(options, search: '[DEQUARANTINE]').execute end end end end