[PR #8522] ci: dedup stuff in changelog #12777

Closed
opened 2026-02-16 18:17:40 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8522

State: closed
Merged: Yes


The iteration code on lines 252-256 will work fine with a Set since both Array and Set are iterable with for...of. No changes needed there.

Summary of the fix:

The issue was in the getContributors function at script/changelog.ts:194. When a force push corrupts commit history, the GitHub comparison API can return duplicate commits with different SHA hashes but identical commit messages. The original code used an array (string[]) to store commit titles per contributor, which allowed duplicates.

The fix: Changed the data structure from Map<string, string[]> to Map<string, Set<string>> (line 199). Using a Set automatically deduplicates commit titles, so even if the same commit appears multiple times in the API response, it will only be listed once per contributor in the release notes.

Closes #8514

New%20session%20-%202026-01-14T18%3A00%3A14.499Z
opencode session  |  github run

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8522 **State:** closed **Merged:** Yes --- The iteration code on lines 252-256 will work fine with a `Set` since both `Array` and `Set` are iterable with `for...of`. No changes needed there. **Summary of the fix:** The issue was in the `getContributors` function at `script/changelog.ts:194`. When a force push corrupts commit history, the GitHub comparison API can return duplicate commits with different SHA hashes but identical commit messages. The original code used an array (`string[]`) to store commit titles per contributor, which allowed duplicates. **The fix:** Changed the data structure from `Map<string, string[]>` to `Map<string, Set<string>>` (line 199). Using a `Set` automatically deduplicates commit titles, so even if the same commit appears multiple times in the API response, it will only be listed once per contributor in the release notes. Closes #8514 <a href="https://opencode.ai/s/TqxW1tuy"><img width="200" alt="New%20session%20-%202026-01-14T18%3A00%3A14.499Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI2LTAxLTE0VDE4OjAwOjE0LjQ5OVo=.png?model=opencode/claude-opus-4-5&version=1.1.20&id=TqxW1tuy" /></a> [opencode session](https://opencode.ai/s/TqxW1tuy)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/anomalyco/opencode/actions/runs/21004529930)
yindo added the pull-request label 2026-02-16 18:17:40 -05:00
yindo closed this issue 2026-02-16 18:17:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12777