build(release): what's new drafted from the commits' Whats-New trailers, other apps' commits left out
The drafts came from the commits' subjects, which are written for developers: each of the releases of 4 Nov 2026 (Todo 0.2.0, Train 0.3.0, Learn 0.24.0) listed every commit since the last, Meditate's among them where it touched a shared package, more than twice F-Droid's 500 characters, the German all still to translate, and each had to be written again whole. A commit people would notice now says so in its message's trailers, `Whats-New: <sentence>` once a change and `Whats-New-De: <Satz>` in the same order, and the draft is those lines alone, the features' first, a missing translation marked TRANSLATE:. Only where no commit of the release carries one does it fall back to the subjects. A commit whose scope names apps (feat(todo,meditate): ...) counts for those alone, any other for every app it touches. Over a running next.<language>.txt per app, which parallel branches conflict on at every merge, and over an assistant drafting at release time (a key, the commits sent to a provider, a different text each run). ADR 0030, D61. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
3310ffa1cd
commit
4239a1de24
1 changed files with 211 additions and 31 deletions
|
|
@ -11,16 +11,21 @@ import 'fixtures.dart';
|
|||
void main() {
|
||||
test('the drafts list the features, then the fixes, without types, scopes '
|
||||
'and closing references, as sentences; German marked to translate', () {
|
||||
final drafts = draftWhatsNew(const [
|
||||
Commit(hash: 'a', subject: 'fix(sync): no lost rating'),
|
||||
Commit(hash: 'b', subject: 'docs: why'),
|
||||
Commit(
|
||||
hash: 'c',
|
||||
subject: 'feat(train): tabs folding into the title (ADR 0030, D60)',
|
||||
),
|
||||
Commit(hash: 'd', subject: 'perf!: faster library.'),
|
||||
Commit(hash: 'e', subject: 'chore(release): notes-v0.18.0'),
|
||||
], first: false);
|
||||
final drafts = draftWhatsNew(
|
||||
const [
|
||||
Commit(hash: 'a', subject: 'fix(sync): no lost rating'),
|
||||
Commit(hash: 'b', subject: 'docs: why'),
|
||||
Commit(
|
||||
hash: 'c',
|
||||
subject: 'feat(train): tabs folding into the title (ADR 0030, D60)',
|
||||
),
|
||||
Commit(hash: 'd', subject: 'perf!: faster library.'),
|
||||
Commit(hash: 'e', subject: 'chore(release): notes-v0.18.0'),
|
||||
],
|
||||
first: false,
|
||||
app: 'notes',
|
||||
apps: _apps,
|
||||
);
|
||||
|
||||
expect(drafts['en'], '''
|
||||
- Tabs folding into the title.
|
||||
|
|
@ -36,11 +41,87 @@ void main() {
|
|||
|
||||
test('the first release says so', () {
|
||||
expect(
|
||||
draftWhatsNew(const [], first: true)['en'],
|
||||
draftWhatsNew(const [], first: true, app: 'notes', apps: _apps)['en'],
|
||||
'- The first release.\n',
|
||||
);
|
||||
});
|
||||
|
||||
test("commits scoped to other apps don't count; a shared package's do", () {
|
||||
final drafts = draftWhatsNew(
|
||||
const [
|
||||
Commit(hash: 'a', subject: 'feat(diary): the first diary'),
|
||||
Commit(hash: 'b', subject: 'feat(notes,diary): a lock on both'),
|
||||
Commit(hash: 'c', subject: 'feat(app): a profile everywhere'),
|
||||
Commit(hash: 'd', subject: 'fix(deploy): the image builds'),
|
||||
],
|
||||
first: false,
|
||||
app: 'notes',
|
||||
apps: _apps,
|
||||
);
|
||||
|
||||
expect(drafts['en'], '''
|
||||
- A lock on both.
|
||||
- A profile everywhere.
|
||||
- The image builds.
|
||||
''');
|
||||
});
|
||||
|
||||
group('the trailers', () {
|
||||
const commits = [
|
||||
Commit(
|
||||
hash: 'a',
|
||||
subject: 'fix(notes): the sync no longer loses a rating',
|
||||
body:
|
||||
'Why it did.\n\n'
|
||||
'Whats-New: Ratings are kept when syncing.\n'
|
||||
'Whats-New-De: Bewertungen bleiben beim Synchronisieren.\n'
|
||||
'Signed-off-by: A <a@example.org>\n',
|
||||
),
|
||||
Commit(hash: 'b', subject: 'feat(notes): a refactor nobody sees'),
|
||||
Commit(
|
||||
hash: 'c',
|
||||
subject: 'feat(app): tabs folding into the title (ADR 0030, D60)',
|
||||
body:
|
||||
'Whats-New: Tabs fold into the title.\n'
|
||||
'Whats-New: Search: in every list.\n'
|
||||
'Whats-New-De: Tabs falten sich in den Titel.\n',
|
||||
),
|
||||
Commit(
|
||||
hash: 'd',
|
||||
subject: 'feat(diary): a diary',
|
||||
body: 'Whats-New: A diary.\nWhats-New-De: Ein Tagebuch.\n',
|
||||
),
|
||||
];
|
||||
|
||||
test("are what's new where a commit has them: the features' first, "
|
||||
'commits without them left out, those of other apps too', () {
|
||||
final drafts = draftWhatsNew(
|
||||
commits,
|
||||
first: false,
|
||||
app: 'notes',
|
||||
apps: _apps,
|
||||
);
|
||||
|
||||
expect(drafts['en'], '''
|
||||
- Tabs fold into the title.
|
||||
- Search: in every list.
|
||||
- Ratings are kept when syncing.
|
||||
''');
|
||||
expect(drafts['de'], '''
|
||||
- Tabs falten sich in den Titel.
|
||||
- TRANSLATE: Search: in every list.
|
||||
- Bewertungen bleiben beim Synchronisieren.
|
||||
''');
|
||||
});
|
||||
|
||||
test('are left alone in the first release', () {
|
||||
expect(
|
||||
draftWhatsNew(commits, first: true, app: 'notes', apps: _apps)['de'],
|
||||
'- TRANSLATE: The first release.\n',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test("a text's changes are its lines starting with '- '", () {
|
||||
expect(whatsNewChanges('- One\n\n - Two \n'), ['One', 'Two']);
|
||||
expect(whatsNewList('- One\n\n - Two \n'), '- One\n- Two');
|
||||
|
|
@ -110,3 +191,5 @@ void main() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
const _apps = {'notes', 'diary'};
|
||||
|
|
|
|||
Loading…
Reference in a new issue