Class: Decidim::GithubManager::Querier::ByLabel

Inherits:
Base
  • Object
show all
Defined in:
lib/decidim/github_manager/querier/by_label.rb

Overview

Makes a GET request for the list of Issues or Pull Requests in GitHub. They must comply the following conditions:

  • To be merged in the period between the days to check from and today. (90 days by default)

  • To have the label that we are querying (“type: fix” by default)

  • To not have any of the excluded labels ([“backport”, “no-backport”] by default)

  • To have been merged

Instance Method Summary collapse

Constructor Details

#initialize(token:, days_to_check_from: 90, label: "type: fix", exclude_labels: ["backport", "no-backport"]) ⇒ ByLabel

Returns a new instance of ByLabel.



23
24
25
26
27
28
# File 'lib/decidim/github_manager/querier/by_label.rb', line 23

def initialize(token:, days_to_check_from: 90, label: "type: fix", exclude_labels: ["backport", "no-backport"])
  @label = label
  @exclude_labels = exclude_labels
  @token = token
  @days_to_check_from = days_to_check_from
end

Instance Method Details

#callHash

Makes the GET request and parses the response of an Issue or Pull Request in GitHub

Returns:

  • (Hash)


33
34
35
# File 'lib/decidim/github_manager/querier/by_label.rb', line 33

def call
  parse json_response("https://api.github.com/repos/decidim/decidim/issues")
end