Skip to content
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
6 changes: 4 additions & 2 deletions .github/changelog_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def build_entry(api_version, version_number, date)

<<~ENTRY
## [#{version_number}] - #{date_str} (#{api_version} API)

### Changed
- #{message}
ENTRY
Expand Down Expand Up @@ -148,7 +148,9 @@ def insert_entries(changelog, entries)
rest = lines[first_entry_index..]

# Combine: header + new entries + rest
(header + entries.map { |e| e.rstrip } + [''] + rest).join("\n")
# Each entry is separated by a blank line for readability
entry_lines = entries.flat_map { |e| e.rstrip.split("\n") + [''] }
(header + entry_lines + rest).join("\n")
end
end
end
Expand Down
22 changes: 22 additions & 0 deletions .github/spec/changelog_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,28 @@ def read_changelog
changed_count = updated_content.scan(/### Changed/).length
expect(changed_count).to be >= 2 # At least 2 from the new entries
end

it 'separates multiple entries with blank lines' do
setup_changelog
setup_version_directory('v20250224', v20250224_package_fixture)
setup_version_directory('v20111101', v20111101_package_fixture)

result = ChangelogManager.update('v20250224,v20111101')

expect(result).to be true
updated_content = read_changelog

# The v20250224 entry block should be followed by a blank line before the v20111101 entry
# Match: end of v20250224 entry's Changed bullet, blank line, then v20111101 header
expect(updated_content).to match(
/Updated v20250224 API specification.*?\n\n## \[\d+\.\d+\.\d+\] - \d{4}-\d{2}-\d{2} \(v20111101 API\)/m
)

# The v20111101 entry block should be followed by a blank line before existing entries
expect(updated_content).to match(
/Updated v20111101 API specification.*?\n\n## \[2\.0\.0\]/m
)
end
end

describe '.update with date range behavior' do
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-auto-generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
ref: test-auto-generate
- uses: actions/setup-node@v3
with:
node-version: "20"
Expand Down