Class: Fastlane::Actions::FindTicketsToMoveAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/apadmi_grout/actions/find_tickets_to_move_action.rb

Overview

Move JIRA tickets and generate release notes

Class Method Summary collapse

Class Method Details

.authorsObject



35
36
37
# File 'lib/fastlane/plugin/apadmi_grout/actions/find_tickets_to_move_action.rb', line 35

def self.authors
  ["[email protected]"]
end

.available_optionsObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/fastlane/plugin/apadmi_grout/actions/find_tickets_to_move_action.rb', line 39

def self.available_options
  [
    ########## JIRA Auth ##########
    FastlaneCore::ConfigItem.new(key: :jira_username,
                                 description: "JIRA username for authentication with JIRA",
                                 env_name: "JIRA_USERNAME",
                                 type: String,
                                 verify_block: proc do |value|
                                   UI.user_error!("Didn't pass a valid JIRA username") unless value
                                 end,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :jira_api_token,
                                 description: "JIRA api token for authentication with JIRA",
                                 env_name: "JIRA_API_TOKEN",
                                 type: String,
                                 verify_block: proc do |value|
                                   UI.user_error!("Didn't pass a valid JIRA api token") unless value
                                 end,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :jira_project_key,
                                 description: "JIRA project key",
                                 env_name: "JIRA_PROJECT_KEY",
                                 type: String,
                                 verify_block: proc do |value|
                                   UI.user_error!("Didn't pass a valid JIRA project key, e.g PPT") unless value
                                 end,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :jira_base_url,
                                 description: "JIRA base url for the organisation",
                                 env_name: "JIRA_BASE_URL",
                                 type: String,
                                 verify_block: proc do |value|
                                   UI.user_error!("Didn't pass a valid JIRA base url") unless value
                                 end,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :jira_context_path,
                                 description: "JIRA context path whatever that is ¯\\_(ツ)_/¯",
                                 env_name: "JIRA_CONTEXT_PATH",
                                 default_value: "",
                                 type: String,
                                 optional: true),

    ########## Action Specific ##########
    FastlaneCore::ConfigItem.new(key: :jira_component_name,
                                 description: "The JIRA component by which to filter tickets",
                                 env_name: "JIRA_COMPONENT_NAME",
                                 type: String,
                                 verify_block: proc do |value|
                                   UI.user_error!("Didn't pass a valid JIRA component") unless value
                                 end,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :jira_status_from,
                                 description: "The JIRA status to filter by to find tickets",
                                 env_name: "JIRA_STATUS_FROM",
                                 type: String,
                                 verify_block: proc do |value|
                                   UI.user_error!("Didn't pass a valid JIRA status") unless value
                                 end,
                                 optional: false)
  ]
end

.descriptionObject



31
32
33
# File 'lib/fastlane/plugin/apadmi_grout/actions/find_tickets_to_move_action.rb', line 31

def self.description
  "Convenience lane that finds tickets that are ready to be moved by CI."
end

.is_supported?(_platform) ⇒ Boolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/fastlane/plugin/apadmi_grout/actions/find_tickets_to_move_action.rb', line 101

def self.is_supported?(_platform)
  true
end

.run(params) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fastlane/plugin/apadmi_grout/actions/find_tickets_to_move_action.rb', line 11

def self.run(params)
  logger = FastLane::FastlaneLogger.new
  logger.message("Finding tickets to move")

  build_tools = Apadmi::Grout::DependencyInjector.new(
    params[:jira_username],
    params[:jira_api_token],
    params[:jira_base_url],
    params[:jira_context_path],
    params[:jira_project_key],
    logger
  )

  build_tools.find_tickets_to_move_action.run(
    params[:jira_component_name],
    params[:jira_status_from],
    []
  )
end