Skip to content

Commit 7171536

Browse files
authored
fix(release): version plan changelogs should contain authors and refs (#27737)
1 parent d46edc4 commit 7171536

File tree

13 files changed

+579
-169
lines changed

13 files changed

+579
-169
lines changed

e2e/release/src/conventional-commits-config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ describe('nx release conventional commits config', () => {
371371
- ⚠️ **{project-name}:** this is a breaking change
372372
373373
374-
#### ⚠️ Breaking Changes
374+
### ⚠️ Breaking Changes
375375
376376
- ⚠️ **{project-name}:** this is a breaking change
377377
`);

e2e/release/src/create-github-release.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe('nx release create github release', () => {
125125
expect(result.match(new RegExp(`### 🚀 Features`, 'g')).length).toEqual(2);
126126
expect(result.match(new RegExp(`### 🩹 Fixes`, 'g')).length).toEqual(2);
127127
expect(
128-
result.match(new RegExp(`#### ⚠️ Breaking Changes`, 'g')).length
128+
result.match(new RegExp(`### ⚠️ Breaking Changes`, 'g')).length
129129
).toEqual(2);
130130
});
131131

@@ -159,7 +159,7 @@ describe('nx release create github release', () => {
159159
expect(result.match(new RegExp(`### 🚀 Features`, 'g')).length).toEqual(2);
160160
expect(result.match(new RegExp(`### 🩹 Fixes`, 'g')).length).toEqual(1);
161161
expect(
162-
result.match(new RegExp(`#### ⚠️ Breaking Changes`, 'g')).length
162+
result.match(new RegExp(`### ⚠️ Breaking Changes`, 'g')).length
163163
).toEqual(1);
164164
});
165165
});

e2e/release/src/version-plans.test.ts

Lines changed: 127 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ describe('nx release version plans', () => {
7373
pkg5 = uniq('my-pkg-5');
7474
runCLI(`generate @nx/workspace:npm-package ${pkg5}`);
7575

76+
// Normalize git committer information so it is deterministic in snapshots
77+
await runCommandAsync(`git config user.email "[email protected]"`);
78+
await runCommandAsync(`git config user.name "Test"`);
79+
7680
await runCommandAsync(`git add .`);
7781
await runCommandAsync(`git commit -m "chore: initial commit"`);
7882
await runCommandAsync(`git tag -a v0.0.0 -m "v0.0.0"`);
@@ -174,7 +178,12 @@ Here is another line in the message.
174178
+
175179
+ ### 🚀 Features
176180
+
177-
+ - Update the fixed packages with a minor release.`
181+
+ - Update the fixed packages with a minor release.
182+
+
183+
+
184+
+ ### ❤️ Thank You
185+
+
186+
+ - Test`
178187
);
179188
expect(resultWithoutDate).toContain(
180189
`NX Generating an entry in ${pkg2}/CHANGELOG.md for v0.1.0
@@ -185,7 +194,12 @@ Here is another line in the message.
185194
+
186195
+ ### 🚀 Features
187196
+
188-
+ - Update the fixed packages with a minor release.`
197+
+ - Update the fixed packages with a minor release.
198+
+
199+
+
200+
+ ### ❤️ Thank You
201+
+
202+
+ - Test`
189203
);
190204
expect(resultWithoutDate).toContain(
191205
`NX Generating an entry in ${pkg3}/CHANGELOG.md for ${pkg3}@0.0.1
@@ -196,9 +210,14 @@ Here is another line in the message.
196210
+
197211
+ ### 🩹 Fixes
198212
+
199-
+ - **${pkg3}:** Update the independent packages with a patch, preminor, and prerelease.
213+
+ - Update the independent packages with a patch, preminor, and prerelease.
200214
+
201-
+ Here is another line in the message.`
215+
+ Here is another line in the message.
216+
+
217+
+
218+
+ ### ❤️ Thank You
219+
+
220+
+ - Test`
202221
);
203222

204223
expect(resultWithoutDate).toContain(
@@ -210,9 +229,14 @@ Here is another line in the message.
210229
+
211230
+ ### 🚀 Features
212231
+
213-
+ - **${pkg4}:** Update the independent packages with a patch, preminor, and prerelease.
232+
+ - Update the independent packages with a patch, preminor, and prerelease.
233+
+
234+
+ Here is another line in the message.
235+
+
214236
+
215-
+ Here is another line in the message.`
237+
+ ### ❤️ Thank You
238+
+
239+
+ - Test`
216240
);
217241

218242
expect(resultWithoutDate).toContain(
@@ -224,9 +248,14 @@ Here is another line in the message.
224248
+
225249
+ ### 🩹 Fixes
226250
+
227-
+ - **${pkg5}:** Update the independent packages with a patch, preminor, and prerelease.
251+
+ - Update the independent packages with a patch, preminor, and prerelease.
252+
+
253+
+ Here is another line in the message.
254+
+
255+
+
256+
+ ### ❤️ Thank You
228257
+
229-
+ Here is another line in the message.`
258+
+ - Test`
230259
);
231260

232261
await writeFile(
@@ -298,12 +327,17 @@ Update packages in both groups with a mix #2
298327
+
299328
+ ### 🚀 Features
300329
+
301-
+ - **${pkg1}:** Update packages in both groups with a mix #1
330+
+ - Update packages in both groups with a mix #1
302331
+
303332
+
304333
+ ### 🩹 Fixes
305334
+
306-
+ - Update packages in both groups with a mix #2`
335+
+ - Update packages in both groups with a mix #2
336+
+
337+
+
338+
+ ### ❤️ Thank You
339+
+
340+
+ - Test`
307341
);
308342
expect(result2WithoutDate).toContain(
309343
`NX Generating an entry in ${pkg2}/CHANGELOG.md for v0.2.0
@@ -316,6 +350,11 @@ Update packages in both groups with a mix #2
316350
+ ### 🩹 Fixes
317351
+
318352
+ - Update packages in both groups with a mix #2
353+
+
354+
+
355+
+ ### ❤️ Thank You
356+
+
357+
+ - Test
319358
`
320359
);
321360
expect(result2WithoutDate).toContain(
@@ -328,7 +367,12 @@ Update packages in both groups with a mix #2
328367
+
329368
+ ### 🩹 Fixes
330369
+
331-
+ - **${pkg3}:** Update packages in both groups with a mix #1`
370+
+ - Update packages in both groups with a mix #1
371+
+
372+
+
373+
+ ### ❤️ Thank You
374+
+
375+
+ - Test`
332376
);
333377

334378
expect(result2WithoutDate).toContain(
@@ -341,7 +385,12 @@ Update packages in both groups with a mix #2
341385
+
342386
+ ### 🚀 Features
343387
+
344-
+ - **${pkg4}:** Update packages in both groups with a mix #2`
388+
+ - Update packages in both groups with a mix #2
389+
+
390+
+
391+
+ ### ❤️ Thank You
392+
+
393+
+ - Test`
345394
);
346395

347396
expect(result2WithoutDate).toContain(
@@ -354,7 +403,12 @@ Update packages in both groups with a mix #2
354403
+
355404
+ ### 🩹 Fixes
356405
+
357-
+ - **${pkg5}:** Update packages in both groups with a mix #2`
406+
+ - Update packages in both groups with a mix #2
407+
+
408+
+
409+
+ ### ❤️ Thank You
410+
+
411+
+ - Test`
358412
);
359413

360414
expect(exists(join(versionPlansDir, 'bump-mixed1.md'))).toBeFalsy();
@@ -512,7 +566,12 @@ const yargs = require('yargs');
512566
+
513567
+ ### 🚀 Features
514568
+
515-
+ - Update the fixed packages with a minor release.`
569+
+ - Update the fixed packages with a minor release.
570+
+
571+
+
572+
+ ### ❤️ Thank You
573+
+
574+
+ - Test`
516575
);
517576
expect(resultWithoutDate).toContain(
518577
`NX Generating an entry in ${pkg2}/CHANGELOG.md for v0.1.0
@@ -523,7 +582,12 @@ const yargs = require('yargs');
523582
+
524583
+ ### 🚀 Features
525584
+
526-
+ - Update the fixed packages with a minor release.`
585+
+ - Update the fixed packages with a minor release.
586+
+
587+
+
588+
+ ### ❤️ Thank You
589+
+
590+
+ - Test`
527591
);
528592
expect(resultWithoutDate).toContain(
529593
`NX Generating an entry in ${pkg3}/CHANGELOG.md for ${pkg3}@0.0.1
@@ -534,7 +598,12 @@ const yargs = require('yargs');
534598
+
535599
+ ### 🩹 Fixes
536600
+
537-
+ - **${pkg3}:** Update the independent packages with a patch, preminor, and prerelease.`
601+
+ - Update the independent packages with a patch, preminor, and prerelease.
602+
+
603+
+
604+
+ ### ❤️ Thank You
605+
+
606+
+ - Test`
538607
);
539608

540609
expect(resultWithoutDate).toContain(
@@ -546,7 +615,12 @@ const yargs = require('yargs');
546615
+
547616
+ ### 🚀 Features
548617
+
549-
+ - **${pkg4}:** Update the independent packages with a patch, preminor, and prerelease.`
618+
+ - Update the independent packages with a patch, preminor, and prerelease.
619+
+
620+
+
621+
+ ### ❤️ Thank You
622+
+
623+
+ - Test`
550624
);
551625

552626
expect(resultWithoutDate).toContain(
@@ -558,7 +632,12 @@ const yargs = require('yargs');
558632
+
559633
+ ### 🩹 Fixes
560634
+
561-
+ - **${pkg5}:** Update the independent packages with a patch, preminor, and prerelease.`
635+
+ - Update the independent packages with a patch, preminor, and prerelease.
636+
+
637+
+
638+
+ ### ❤️ Thank You
639+
+
640+
+ - Test`
562641
);
563642

564643
expect(exists(join(versionPlansDir, 'bump-fixed.md'))).toBeFalsy();
@@ -633,12 +712,17 @@ Update packages in both groups with a mix #2
633712
+
634713
+ ### 🚀 Features
635714
+
636-
+ - **${pkg1}:** Update packages in both groups with a mix #1
715+
+ - Update packages in both groups with a mix #1
637716
+
638717
+
639718
+ ### 🩹 Fixes
640719
+
641-
+ - Update packages in both groups with a mix #2`
720+
+ - Update packages in both groups with a mix #2
721+
+
722+
+
723+
+ ### ❤️ Thank You
724+
+
725+
+ - Test`
642726
);
643727
expect(result2WithoutDate).toContain(
644728
`NX Generating an entry in ${pkg2}/CHANGELOG.md for v0.2.0
@@ -651,6 +735,11 @@ Update packages in both groups with a mix #2
651735
+ ### 🩹 Fixes
652736
+
653737
+ - Update packages in both groups with a mix #2
738+
+
739+
+
740+
+ ### ❤️ Thank You
741+
+
742+
+ - Test
654743
`
655744
);
656745
expect(result2WithoutDate).toContain(
@@ -663,7 +752,12 @@ Update packages in both groups with a mix #2
663752
+
664753
+ ### 🩹 Fixes
665754
+
666-
+ - **${pkg3}:** Update packages in both groups with a mix #1`
755+
+ - Update packages in both groups with a mix #1
756+
+
757+
+
758+
+ ### ❤️ Thank You
759+
+
760+
+ - Test`
667761
);
668762

669763
expect(result2WithoutDate).toContain(
@@ -676,7 +770,12 @@ Update packages in both groups with a mix #2
676770
+
677771
+ ### 🚀 Features
678772
+
679-
+ - **${pkg4}:** Update packages in both groups with a mix #2`
773+
+ - Update packages in both groups with a mix #2
774+
+
775+
+
776+
+ ### ❤️ Thank You
777+
+
778+
+ - Test`
680779
);
681780

682781
expect(result2WithoutDate).toContain(
@@ -689,7 +788,12 @@ Update packages in both groups with a mix #2
689788
+
690789
+ ### 🩹 Fixes
691790
+
692-
+ - **${pkg5}:** Update packages in both groups with a mix #2`
791+
+ - Update packages in both groups with a mix #2
792+
+
793+
+
794+
+ ### ❤️ Thank You
795+
+
796+
+ - Test`
693797
);
694798

695799
expect(exists(join(versionPlansDir, 'bump-mixed1.md'))).toBeFalsy();

0 commit comments

Comments
 (0)