Skip to content

Commit

Permalink
fix(release): version plan changelogs should contain authors and refs (
Browse files Browse the repository at this point in the history
…#27737)

(cherry picked from commit 7171536)
  • Loading branch information
JamesHenry authored and FrozenPandaz committed Sep 3, 2024
1 parent 55e2fff commit 454efb7
Show file tree
Hide file tree
Showing 13 changed files with 579 additions and 169 deletions.
2 changes: 1 addition & 1 deletion e2e/release/src/conventional-commits-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ describe('nx release conventional commits config', () => {
- ⚠️ **{project-name}:** this is a breaking change
#### ⚠️ Breaking Changes
### ⚠️ Breaking Changes
- ⚠️ **{project-name}:** this is a breaking change
`);
Expand Down
4 changes: 2 additions & 2 deletions e2e/release/src/create-github-release.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('nx release create github release', () => {
expect(result.match(new RegExp(`### 🚀 Features`, 'g')).length).toEqual(2);
expect(result.match(new RegExp(`### 🩹 Fixes`, 'g')).length).toEqual(2);
expect(
result.match(new RegExp(`#### ⚠️ Breaking Changes`, 'g')).length
result.match(new RegExp(`### ⚠️ Breaking Changes`, 'g')).length
).toEqual(2);
});

Expand Down Expand Up @@ -159,7 +159,7 @@ describe('nx release create github release', () => {
expect(result.match(new RegExp(`### 🚀 Features`, 'g')).length).toEqual(2);
expect(result.match(new RegExp(`### 🩹 Fixes`, 'g')).length).toEqual(1);
expect(
result.match(new RegExp(`#### ⚠️ Breaking Changes`, 'g')).length
result.match(new RegExp(`### ⚠️ Breaking Changes`, 'g')).length
).toEqual(1);
});
});
150 changes: 127 additions & 23 deletions e2e/release/src/version-plans.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ describe('nx release version plans', () => {
pkg5 = uniq('my-pkg-5');
runCLI(`generate @nx/workspace:npm-package ${pkg5}`);

// Normalize git committer information so it is deterministic in snapshots
await runCommandAsync(`git config user.email "[email protected]"`);
await runCommandAsync(`git config user.name "Test"`);

await runCommandAsync(`git add .`);
await runCommandAsync(`git commit -m "chore: initial commit"`);
await runCommandAsync(`git tag -a v0.0.0 -m "v0.0.0"`);
Expand Down Expand Up @@ -174,7 +178,12 @@ Here is another line in the message.
+
+ ### 🚀 Features
+
+ - Update the fixed packages with a minor release.`
+ - Update the fixed packages with a minor release.
+
+
+ ### ❤️ Thank You
+
+ - Test`
);
expect(resultWithoutDate).toContain(
`NX Generating an entry in ${pkg2}/CHANGELOG.md for v0.1.0
Expand All @@ -185,7 +194,12 @@ Here is another line in the message.
+
+ ### 🚀 Features
+
+ - Update the fixed packages with a minor release.`
+ - Update the fixed packages with a minor release.
+
+
+ ### ❤️ Thank You
+
+ - Test`
);
expect(resultWithoutDate).toContain(
`NX Generating an entry in ${pkg3}/CHANGELOG.md for ${pkg3}@0.0.1
Expand All @@ -196,9 +210,14 @@ Here is another line in the message.
+
+ ### 🩹 Fixes
+
+ - **${pkg3}:** Update the independent packages with a patch, preminor, and prerelease.
+ - Update the independent packages with a patch, preminor, and prerelease.
+
+ Here is another line in the message.`
+ Here is another line in the message.
+
+
+ ### ❤️ Thank You
+
+ - Test`
);

expect(resultWithoutDate).toContain(
Expand All @@ -210,9 +229,14 @@ Here is another line in the message.
+
+ ### 🚀 Features
+
+ - **${pkg4}:** Update the independent packages with a patch, preminor, and prerelease.
+ - Update the independent packages with a patch, preminor, and prerelease.
+
+ Here is another line in the message.
+
+
+ Here is another line in the message.`
+ ### ❤️ Thank You
+
+ - Test`
);

expect(resultWithoutDate).toContain(
Expand All @@ -224,9 +248,14 @@ Here is another line in the message.
+
+ ### 🩹 Fixes
+
+ - **${pkg5}:** Update the independent packages with a patch, preminor, and prerelease.
+ - Update the independent packages with a patch, preminor, and prerelease.
+
+ Here is another line in the message.
+
+
+ ### ❤️ Thank You
+
+ Here is another line in the message.`
+ - Test`
);

await writeFile(
Expand Down Expand Up @@ -298,12 +327,17 @@ Update packages in both groups with a mix #2
+
+ ### 🚀 Features
+
+ - **${pkg1}:** Update packages in both groups with a mix #1
+ - Update packages in both groups with a mix #1
+
+
+ ### 🩹 Fixes
+
+ - Update packages in both groups with a mix #2`
+ - Update packages in both groups with a mix #2
+
+
+ ### ❤️ Thank You
+
+ - Test`
);
expect(result2WithoutDate).toContain(
`NX Generating an entry in ${pkg2}/CHANGELOG.md for v0.2.0
Expand All @@ -316,6 +350,11 @@ Update packages in both groups with a mix #2
+ ### 🩹 Fixes
+
+ - Update packages in both groups with a mix #2
+
+
+ ### ❤️ Thank You
+
+ - Test
`
);
expect(result2WithoutDate).toContain(
Expand All @@ -328,7 +367,12 @@ Update packages in both groups with a mix #2
+
+ ### 🩹 Fixes
+
+ - **${pkg3}:** Update packages in both groups with a mix #1`
+ - Update packages in both groups with a mix #1
+
+
+ ### ❤️ Thank You
+
+ - Test`
);

expect(result2WithoutDate).toContain(
Expand All @@ -341,7 +385,12 @@ Update packages in both groups with a mix #2
+
+ ### 🚀 Features
+
+ - **${pkg4}:** Update packages in both groups with a mix #2`
+ - Update packages in both groups with a mix #2
+
+
+ ### ❤️ Thank You
+
+ - Test`
);

expect(result2WithoutDate).toContain(
Expand All @@ -354,7 +403,12 @@ Update packages in both groups with a mix #2
+
+ ### 🩹 Fixes
+
+ - **${pkg5}:** Update packages in both groups with a mix #2`
+ - Update packages in both groups with a mix #2
+
+
+ ### ❤️ Thank You
+
+ - Test`
);

expect(exists(join(versionPlansDir, 'bump-mixed1.md'))).toBeFalsy();
Expand Down Expand Up @@ -512,7 +566,12 @@ const yargs = require('yargs');
+
+ ### 🚀 Features
+
+ - Update the fixed packages with a minor release.`
+ - Update the fixed packages with a minor release.
+
+
+ ### ❤️ Thank You
+
+ - Test`
);
expect(resultWithoutDate).toContain(
`NX Generating an entry in ${pkg2}/CHANGELOG.md for v0.1.0
Expand All @@ -523,7 +582,12 @@ const yargs = require('yargs');
+
+ ### 🚀 Features
+
+ - Update the fixed packages with a minor release.`
+ - Update the fixed packages with a minor release.
+
+
+ ### ❤️ Thank You
+
+ - Test`
);
expect(resultWithoutDate).toContain(
`NX Generating an entry in ${pkg3}/CHANGELOG.md for ${pkg3}@0.0.1
Expand All @@ -534,7 +598,12 @@ const yargs = require('yargs');
+
+ ### 🩹 Fixes
+
+ - **${pkg3}:** Update the independent packages with a patch, preminor, and prerelease.`
+ - Update the independent packages with a patch, preminor, and prerelease.
+
+
+ ### ❤️ Thank You
+
+ - Test`
);

expect(resultWithoutDate).toContain(
Expand All @@ -546,7 +615,12 @@ const yargs = require('yargs');
+
+ ### 🚀 Features
+
+ - **${pkg4}:** Update the independent packages with a patch, preminor, and prerelease.`
+ - Update the independent packages with a patch, preminor, and prerelease.
+
+
+ ### ❤️ Thank You
+
+ - Test`
);

expect(resultWithoutDate).toContain(
Expand All @@ -558,7 +632,12 @@ const yargs = require('yargs');
+
+ ### 🩹 Fixes
+
+ - **${pkg5}:** Update the independent packages with a patch, preminor, and prerelease.`
+ - Update the independent packages with a patch, preminor, and prerelease.
+
+
+ ### ❤️ Thank You
+
+ - Test`
);

expect(exists(join(versionPlansDir, 'bump-fixed.md'))).toBeFalsy();
Expand Down Expand Up @@ -633,12 +712,17 @@ Update packages in both groups with a mix #2
+
+ ### 🚀 Features
+
+ - **${pkg1}:** Update packages in both groups with a mix #1
+ - Update packages in both groups with a mix #1
+
+
+ ### 🩹 Fixes
+
+ - Update packages in both groups with a mix #2`
+ - Update packages in both groups with a mix #2
+
+
+ ### ❤️ Thank You
+
+ - Test`
);
expect(result2WithoutDate).toContain(
`NX Generating an entry in ${pkg2}/CHANGELOG.md for v0.2.0
Expand All @@ -651,6 +735,11 @@ Update packages in both groups with a mix #2
+ ### 🩹 Fixes
+
+ - Update packages in both groups with a mix #2
+
+
+ ### ❤️ Thank You
+
+ - Test
`
);
expect(result2WithoutDate).toContain(
Expand All @@ -663,7 +752,12 @@ Update packages in both groups with a mix #2
+
+ ### 🩹 Fixes
+
+ - **${pkg3}:** Update packages in both groups with a mix #1`
+ - Update packages in both groups with a mix #1
+
+
+ ### ❤️ Thank You
+
+ - Test`
);

expect(result2WithoutDate).toContain(
Expand All @@ -676,7 +770,12 @@ Update packages in both groups with a mix #2
+
+ ### 🚀 Features
+
+ - **${pkg4}:** Update packages in both groups with a mix #2`
+ - Update packages in both groups with a mix #2
+
+
+ ### ❤️ Thank You
+
+ - Test`
);

expect(result2WithoutDate).toContain(
Expand All @@ -689,7 +788,12 @@ Update packages in both groups with a mix #2
+
+ ### 🩹 Fixes
+
+ - **${pkg5}:** Update packages in both groups with a mix #2`
+ - Update packages in both groups with a mix #2
+
+
+ ### ❤️ Thank You
+
+ - Test`
);

expect(exists(join(versionPlansDir, 'bump-mixed1.md'))).toBeFalsy();
Expand Down
Loading

0 comments on commit 454efb7

Please sign in to comment.