github_changelog_generator 1.18.0 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitHubChangelogGenerator
4
- VERSION = "1.18.0"
4
+ VERSION = "1.18.1"
5
5
  end
@@ -115,6 +115,17 @@ RSpec.describe GitHubChangelogGenerator::Generator do
115
115
  end
116
116
  end
117
117
 
118
+ it "leaves a PR with no merge event and incomplete comments unassociated" do
119
+ pr = { "number" => "23" }
120
+ allow(fake_fetcher).to receive(:fetch_comments_async).with([pr]) do
121
+ pr["comments"] = []
122
+ pr["comments_incomplete"] = true
123
+ end
124
+
125
+ expect(generator.send(:add_first_occurring_tag_to_prs, [], [pr])).to eq([pr])
126
+ expect(fake_fetcher).to have_received(:fetch_comments_async).once
127
+ end
128
+
118
129
  it "detects closed prs marked as rebased in the release branch" do
119
130
  prs = [{ "number" => "23", "comments" => [{ "body" => "rebased commit: #{sha(4)}" }] }]
120
131
  tags = [{ "name" => "v1.0", "shas_in_tag" => [sha(1), sha(2)] }]
@@ -13,6 +13,42 @@ describe GitHubChangelogGenerator::OctoFetcher do
13
13
 
14
14
  let(:fetcher) { GitHubChangelogGenerator::OctoFetcher.new(options) }
15
15
 
16
+ describe "#fetch_comments_async" do
17
+ let(:client) { instance_double(Octokit::Client) }
18
+ let(:pr) { { "number" => 123 } }
19
+ let(:next_page) { instance_double(Sawyer::Relation) }
20
+
21
+ before do
22
+ allow(fetcher).to receive(:client).and_return(client)
23
+ allow(client).to receive(:issue_comments)
24
+ allow(client).to receive(:last_response).and_return(
25
+ instance_double(Sawyer::Response, status: 200, data: [{ body: "older comment" }], rels: { next: next_page })
26
+ )
27
+ end
28
+
29
+ it "discards partial comments when a later page is missing" do
30
+ allow(next_page).to receive(:get).and_return(
31
+ instance_double(Sawyer::Response, data: nil, rels: {})
32
+ )
33
+
34
+ fetcher.fetch_comments_async([pr])
35
+
36
+ expect(pr["comments"]).to eq([])
37
+ expect(pr["comments_incomplete"]).to be(true)
38
+ end
39
+
40
+ it "keeps complete comment pages in order" do
41
+ allow(next_page).to receive(:get).and_return(
42
+ instance_double(Sawyer::Response, data: [{ body: "newer comment" }], rels: {})
43
+ )
44
+
45
+ fetcher.fetch_comments_async([pr])
46
+
47
+ expect(pr["comments"]).to eq([{ "body" => "older comment" }, { "body" => "newer comment" }])
48
+ expect(pr["comments_incomplete"]).to be(false)
49
+ end
50
+ end
51
+
16
52
  describe "#check_github_response" do
17
53
  context "when returns successfully" do
18
54
  it "returns block value" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_changelog_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.0
4
+ version: 1.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Korolev
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2026-03-18 00:00:00.000000000 Z
13
+ date: 2026-12-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport