update changelog + fix script to not miss entries

This commit is contained in:
Felix Roos 2026-01-16 09:58:14 +01:00
parent d642c0e12f
commit ae9638c353
No known key found for this signature in database
2 changed files with 977 additions and 24 deletions

File diff suppressed because it is too large Load diff

40
warm.js
View file

@ -1,14 +1,30 @@
fetch('https://codeberg.org/api/v1/repos/uzu/strudel/pulls?state=closed&page=1') // this script loads all merged PRs within the given page range
.then((res) => res.json()) // it can be used to update the CHANGELOG.md file in a semi-automated way
.then((pulls) => { // the problem: codeberg doesn't support loading merged PRs, so we have to filter them in memory
const r = pulls // luckily, we can sort after "recentupdate", which means we can do incremental changelog generation
.filter((pull) => pull.merged) // todo: support setting a "last_updated" date, so the script would automatically check how far it has to go
.sort((a, b) => new Date(b.closed_at) - new Date(a.closed_at))
.map((pull) => `${pull.closed_at} ${pull.title} by ${pull.user.login || '?'} in: [#${pull.number}](${pull.url}) `)
.join('\n');
console.log(r);
});
/* async function main() {
let pageStart = 1;
let pageEnd = 1;
let prs = [];
for (let p = pageStart; p <= pageEnd; p++) {
console.log(`load page ${p}/${pageEnd}`);
const res = await fetch(
`https://codeberg.org/api/v1/repos/uzu/strudel/pulls?state=closed&sort=recentupdate&page=${p}`,
);
const pulls = await res.json();
const merged = pulls.filter((pull) => pull.merged);
prs = prs.concat(merged);
}
const output = prs
.sort((a, b) => new Date(b.closed_at) - new Date(a.closed_at))
.map(
(pull) => `- ${pull.closed_at} ${pull.title} by @${pull.user.login || '?'} in: [#${pull.number}](${pull.url}) `,
)
.join('\n');
console.log('-------------');
console.log(output);
}
*/ main();