Skip to content

Commit

Permalink
Update changelog for 1.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Feb 3, 2025
1 parent e4b4e05 commit 63ed71d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 16 deletions.
17 changes: 5 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
#### stdlib

- *(networking)* Disable directory path redirect when `directory_listing=false` ([#15393], thanks @straight-shoota)
- *(runtime)* **[regression]** Fix: abstract `EventLoop::Polling#system_add` invalid signature ([#15380], thanks @github-actions)
- *(system)* **[regression]** Fix GC `sig_suspend`, `sig_resume` for `gc_none` ([#15382], backported from [#15349], thanks @ysbaddaden)

[#15393]: https://github.com/crystal-lang/crystal/pull/15393
[#15380]: https://github.com/crystal-lang/crystal/pull/15380
[#15382]: https://github.com/crystal-lang/crystal/pull/15382
[#15349]: https://github.com/crystal-lang/crystal/pull/15349

### Documentation

Expand Down Expand Up @@ -41,18 +46,6 @@
[#15366]: https://github.com/crystal-lang/crystal/pull/15366
[#15394]: https://github.com/crystal-lang/crystal/pull/15394

### other

#### stdlib

- *(runtime)* **[regression]** Fix: abstract `EventLoop::Polling#system_add` invalid signature ([#15380], backported from [#15358], thanks @straight-shoota)
- *(system)* **[regression]** Fix GC `sig_suspend`, `sig_resume` for `gc_none` ([#15382], backported from [#15349], thanks @ysbaddaden)

[#15380]: https://github.com/crystal-lang/crystal/pull/15380
[#15358]: https://github.com/crystal-lang/crystal/pull/15358
[#15382]: https://github.com/crystal-lang/crystal/pull/15382
[#15349]: https://github.com/crystal-lang/crystal/pull/15349

## [1.15.0] (2025-01-09)

[1.15.0]: https://github.com/crystal-lang/crystal/releases/1.15.0
Expand Down
48 changes: 44 additions & 4 deletions scripts/github-changelog.cr
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ record PullRequest,
md = title.match(/\[fixup #(.\d+)/) || return
md[1]?.try(&.to_i)
end

def clean_title
title.sub(/^\[?(?:#{type}|#{sub_topic})(?::|\]:?) /i, "").sub(/\s*\[Backport [^\]]+\]\s*/, "")
end

def backported?
labels.any?(&.starts_with?("backport"))
end

def backport?
title.includes?("[Backport ")
end
end

def query_milestone(api_token, repository, number)
Expand Down Expand Up @@ -312,8 +324,9 @@ end

milestone = query_milestone(api_token, repository, milestone)

struct ChangelogEntry
class ChangelogEntry
getter pull_requests : Array(PullRequest)
property backported_from : PullRequest?

def initialize(pr : PullRequest)
@pull_requests = [pr]
Expand Down Expand Up @@ -342,13 +355,18 @@ struct ChangelogEntry
if pr.deprecated?
io << "**[deprecation]** "
end
io << pr.title.sub(/^\[?(?:#{pr.type}|#{pr.sub_topic})(?::|\]:?) /i, "")
io << pr.clean_title

io << " ("
pull_requests.join(io, ", ") do |pr|
pr.link_ref(io)
end

if backported_from = self.backported_from
io << ", backported from "
backported_from.link_ref(io)
end

authors = collect_authors
if authors.present?
io << ", thanks "
Expand All @@ -361,15 +379,26 @@ struct ChangelogEntry

def collect_authors
authors = [] of String
pull_requests.each do |pr|

if backported_from = self.backported_from
if author = backported_from.author
authors << author
end
end

pull_requests.each_with_index do |pr, i|
next if backported_from && i.zero?

author = pr.author || next
authors << author unless authors.includes?(author)
end

authors
end

def print_ref_labels(io)
pull_requests.each { |pr| print_ref_label(io, pr) }
backported_from.try { |pr| print_ref_label(io, pr) }
end

def print_ref_label(io, pr)
Expand All @@ -380,7 +409,7 @@ struct ChangelogEntry
end

entries = milestone.pull_requests.compact_map do |pr|
ChangelogEntry.new(pr) unless pr.fixup?
ChangelogEntry.new(pr) unless pr.fixup? || pr.backported?
end

milestone.pull_requests.each do |pr|
Expand All @@ -394,6 +423,17 @@ milestone.pull_requests.each do |pr|
end
end

milestone.pull_requests.each do |pr|
next unless pr.backported?

backport = entries.find { |entry| entry.pr.backport? && entry.pr.clean_title == pr.clean_title }
if backport
backport.backported_from = pr
else
STDERR.puts "Unresolved backport: #{pr.clean_title.inspect} (##{pr.number})"
end
end

sections = entries.group_by(&.pr.section)

SECTION_TITLES = {
Expand Down

0 comments on commit 63ed71d

Please sign in to comment.