Skip to content

Use async-http-faraday. #784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ PATH
specs:
github_changelog_generator (1.15.1)
activesupport
async-http-faraday
faraday-http-cache
multi_json
octokit (~> 4.6)
Expand All @@ -22,19 +23,38 @@ GEM
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.0)
async (1.24.2)
console (~> 1.0)
nio4r (~> 2.3)
timers (~> 4.1)
async-http (0.51.2)
async (~> 1.23)
async-io (~> 1.28)
async-pool (~> 0.2)
protocol-http (~> 0.18.0)
protocol-http1 (~> 0.12.0)
protocol-http2 (~> 0.13.0)
async-http-faraday (0.9.0)
async-http (~> 0.42)
faraday
async-io (1.28.0)
async (~> 1.14)
async-pool (0.2.0)
async (~> 1.8)
backports (3.17.1)
bump (0.9.0)
childprocess (3.0.0)
codeclimate-test-reporter (1.0.7)
simplecov
concurrent-ruby (1.1.6)
console (1.8.2)
crack (0.4.3)
safe_yaml (~> 1.0.0)
diff-lcs (1.3)
docile (1.3.2)
faraday (0.17.3)
multipart-post (>= 1.2, < 3)
faraday-http-cache (2.0.0)
faraday-http-cache (2.1.0)
faraday (~> 0.8)
hashdiff (1.0.1)
i18n (1.8.2)
Expand All @@ -45,6 +65,7 @@ GEM
minitest (5.14.0)
multi_json (1.14.1)
multipart-post (2.1.1)
nio4r (2.5.2)
octokit (4.18.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
Expand All @@ -54,6 +75,13 @@ GEM
parallel (1.19.1)
parser (2.7.1.0)
ast (~> 2.4.0)
protocol-hpack (1.4.2)
protocol-http (0.18.0)
protocol-http1 (0.12.0)
protocol-http (~> 0.18)
protocol-http2 (0.13.3)
protocol-hpack (~> 1.4)
protocol-http (~> 0.18)
public_suffix (4.0.4)
rainbow (3.0.0)
rake (13.0.1)
Expand Down Expand Up @@ -92,6 +120,7 @@ GEM
simplecov-html (~> 0.11)
simplecov-html (0.12.2)
thread_safe (0.3.6)
timers (4.3.0)
tty-color (0.5.1)
tzinfo (1.2.7)
thread_safe (~> 0.1)
Expand Down
1 change: 1 addition & 0 deletions github_changelog_generator.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_runtime_dependency("activesupport")
spec.add_runtime_dependency("async-http-faraday")
spec.add_runtime_dependency("faraday-http-cache")
spec.add_runtime_dependency("multi_json")
spec.add_runtime_dependency("octokit", ["~> 4.6"])
Expand Down
7 changes: 2 additions & 5 deletions lib/github_changelog_generator/generator/generator_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

module GitHubChangelogGenerator
class Generator
MAX_THREAD_NUMBER = 25

# Fetch event for issues and pull requests
# @return [Array] array of fetched issues
def fetch_events_for_issues_and_pr
Expand Down Expand Up @@ -64,7 +62,7 @@ def add_first_occurring_tag_to_prs(tags, prs)
# @param [Array] prs The PRs to associate.
# @return [Array] PRs without their merge_commit_sha in a tag.
def associate_tagged_prs(tags, prs, total)
@fetcher.fetch_tag_shas_async(tags)
@fetcher.fetch_tag_shas(tags)

i = 0
prs.reject do |pr|
Expand Down Expand Up @@ -199,8 +197,7 @@ def set_date_from_event(event, issue)
# @return [Boolean] True if SHA is in the branch git history.
def sha_in_release_branch(sha)
branch = @options[:release_branch] || @fetcher.default_branch
commits_in_branch = @fetcher.fetch_compare(@fetcher.oldest_commit["sha"], branch)
shas_in_branch = commits_in_branch["commits"].collect { |commit| commit["sha"] }
shas_in_branch = @fetcher.commits_in_branch(branch)
shas_in_branch.include?(sha)
end
end
Expand Down
Loading