Class: Decidim::GitBackportChecker
- Inherits:
-
Object
- Object
- Decidim::GitBackportChecker
- Defined in:
- lib/decidim/git_backport_checker.rb
Overview
Extracts the status of the Pull Requests on the decidim repository with the label “type: fix” and shows the status of the related Pull Requests, so we can check which PRs have pending backports
Instance Method Summary collapse
- #call ⇒ Object
- #cli_report ⇒ Object
- #csv_report ⇒ Object
-
#initialize(token:, days_to_check_from:, last_version_number:) ⇒ GitBackportChecker
constructor
A new instance of GitBackportChecker.
Constructor Details
#initialize(token:, days_to_check_from:, last_version_number:) ⇒ GitBackportChecker
Returns a new instance of GitBackportChecker.
16 17 18 19 20 |
# File 'lib/decidim/git_backport_checker.rb', line 16 def initialize(token:, days_to_check_from:, last_version_number:) @token = token @days_to_check_from = days_to_check_from @last_version_number = last_version_number end |
Instance Method Details
#call ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/decidim/git_backport_checker.rb', line 22 def call @report = by_label( label: "type: fix", exclude_labels: ["backport", "no-backport"], days_to_check_from: @days_to_check_from ).map do |pull_request| { id: pull_request[:id], title: pull_request[:title], related_issues: (pull_request[:id]) } end end |
#cli_report ⇒ Object
43 44 45 46 47 48 |
# File 'lib/decidim/git_backport_checker.rb', line 43 def cli_report Decidim::BackportsReporter::CLIReport.new( report: @report, last_version_number: @last_version_number ).call end |
#csv_report ⇒ Object
36 37 38 39 40 41 |
# File 'lib/decidim/git_backport_checker.rb', line 36 def csv_report Decidim::BackportsReporter::CSVReport.new( report: @report, last_version_number: @last_version_number ).call end |