Class: Aid::Scripts::Review

Inherits:
Aid::Script show all
Includes:
GitConfig
Defined in:
lib/aid/scripts/review.rb

Defined Under Namespace

Classes: PullRequest

Constant Summary

Constants included from Colorize

Colorize::COLOR_CODES

Instance Attribute Summary

Attributes inherited from Aid::Script

#argv

Class Method Summary collapse

Instance Method Summary collapse

Methods included from GitConfig

#git_config, #prompt, #prompt_for_config!

Methods inherited from Aid::Script

#description, #exit_code, #exit_with_help!, #help, #initialize, name, #project_root, run, #step, #system!

Methods included from Inheritable

included

Methods included from Colorize

colorize, included

Constructor Details

This class inherits a constructor from Aid::Script

Class Method Details

.descriptionObject



12
13
14
# File 'lib/aid/scripts/review.rb', line 12

def self.description
  "Requests a review from one or more team members"
end

.helpObject



16
17
18
19
20
21
# File 'lib/aid/scripts/review.rb', line 16

def self.help
  <<~HELP
    Usage: $ aid review
    Type aid review from your feature branch and follow the prompts
  HELP
end

Instance Method Details

#runObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/aid/scripts/review.rb', line 23

def run
  check_for_minimum_version_of_hub!

  prompt_for_reviewers!
  run_aid_finish_if_needed!

  change_wip_to_reviewable_label!
  move_asana_task_to_pull_request_column!

  step "Marking PR ready for review" do
    pull_request.mark_ready_for_review!
    puts "✅ done"
  end

  add_reviewers_to_pr!
  ping_reviewers_on_slack!
end