Class: Apadmi::Grout::FindTicketsToMoveJiraAction
- Inherits:
-
FindTicketsToMoveAction
- Object
- FindTicketsToMoveAction
- Apadmi::Grout::FindTicketsToMoveJiraAction
- Defined in:
- lib/apadmi/grout/actions/find_tickets_to_move_action/find_tickets_to_move_jira_action.rb
Overview
Finds and returns a list of all the issues that are ready to be moved Any tickets found that have the given status but *don't* appear ready to be moved will be flagged.
Instance Method Summary collapse
-
#initialize(jira_board_service, git_utils, issues_from_chnglg, logger) ⇒ FindTicketsToMoveJiraAction
constructor
A new instance of FindTicketsToMoveJiraAction.
-
#run(component, status, excluded_ticket_keys, custom_flag_messages = nil, options = nil) ⇒ Array<Apadmi::Grout::Issue>
The issues ready to move.
Constructor Details
#initialize(jira_board_service, git_utils, issues_from_chnglg, logger) ⇒ FindTicketsToMoveJiraAction
Returns a new instance of FindTicketsToMoveJiraAction.
21 22 23 24 25 26 |
# File 'lib/apadmi/grout/actions/find_tickets_to_move_action/find_tickets_to_move_jira_action.rb', line 21 def initialize(jira_board_service, git_utils, issues_from_chnglg, logger) @jira_board_service = jira_board_service @git_utils = git_utils @issues_from_changelog_action = issues_from_chnglg @logger = logger end |
Instance Method Details
#run(component, status, excluded_ticket_keys, custom_flag_messages = nil, options = nil) ⇒ Array<Apadmi::Grout::Issue>
Returns the issues ready to move.
34 35 36 37 38 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 |
# File 'lib/apadmi/grout/actions/find_tickets_to_move_action/find_tickets_to_move_jira_action.rb', line 34 def run( component, status, excluded_ticket_keys, = nil, = nil ) ||= Apadmi::Grout::FlagMessages.default(status) ||= Apadmi::Grout::JiraFindTicketsOptions.new(include_no_sprint_tickets: false) issues = @jira_board_service.search_unblocked_issues( component, status, [], ).reject do |issue| excluded_ticket_keys.include? issue.key end issue_keys = issues.map(&:key) @logger.("Found issues to consider #{issue_keys.join(", ")}") # Get the issues in the git changelog, filtered for the issues being considered changelog_ids = @issues_from_changelog_action.issue_ids_from_changelog( @git_utils.merge_changelog(issue_keys) ) final_list = issues.filter do |issue| # Decide whether to include this ticket based on PRs status = process_prs(issue, ) decide_should_include(issue, status, changelog_ids) end @logger.("Final list: #{final_list.map(&:key).join(", ")}") final_list end |