Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix release issue #447

Merged
merged 3 commits into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions scripts/release/__tests__/create-release-issue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,22 +265,37 @@ describe('create release issue', () => {

expect(
getSkippedCommitsText({
commitsWithoutLanguageScope: ['abcdefg fix: something'],
commitsWithUnknownLanguageScope: ['abcdef2 fix(pascal): what'],
commitsWithoutLanguageScope: [
'abcdefg fix: something',
'abcdefg fix: somethin2',
],

commitsWithUnknownLanguageScope: [
'abcdef2 fix(pascal): what',
'abcdef2 fix(pascal): what is that',
],
})
).toMatchInlineSnapshot(`
"<p></p>
<p>It doesn't mean these commits are being excluded from the release. It means they're not taken into account when the release process figured out the next version number, and updated the changelog.</p>
"</p>
<p>It doesn't mean these commits are being excluded from the release. It means they're not taken into account when the release process figured out the next version number, and updated the changelog.</p>

<details>
<summary>
<i>Commits without language scope:</i>
</summary>

- abcdefg fix: something
- abcdefg fix: somethin2
</details>

<p>Commits without language scope:</p>
<ul>
<li>abcdefg fix: something</li>
</ul>
<details>
<summary>
<i>Commits with unknown language scope:</i>
</summary>

<p>Commits with unknown language scope:</p>
<ul>
<li>abcdef2 fix(pascal): what</li>
</ul>"
- abcdef2 fix(pascal): what
- abcdef2 fix(pascal): what is that
</details>"
`);
});
});
34 changes: 20 additions & 14 deletions scripts/release/create-release-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,24 @@ export function getSkippedCommitsText({
return '_(None)_';
}

return `<p></p>
<p>${TEXT.skippedCommitsDesc}</p>

<p>Commits without language scope:</p>
<ul>
${commitsWithoutLanguageScope.map((commit) => `<li>${commit}</li>`)}
</ul>

<p>Commits with unknown language scope:</p>
<ul>
${commitsWithUnknownLanguageScope.map((commit) => `<li>${commit}</li>`)}
</ul>`;
return `</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return `</p>
return `<p></p>

it was that actually, to make a space. (you need to update the tests as well)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you think it look nice on the preview? #446

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when do you open the <p> ?

<p>${TEXT.skippedCommitsDesc}</p>

<details>
<summary>
<i>Commits without language scope:</i>
</summary>

${commitsWithoutLanguageScope.map((commit) => `- ${commit}`).join('\n')}
</details>

<details>
<summary>
<i>Commits with unknown language scope:</i>
</summary>

${commitsWithUnknownLanguageScope.map((commit) => `- ${commit}`).join('\n')}
</details>`;
}

export function parseCommit(commit: string): Commit {
Expand Down Expand Up @@ -278,13 +284,13 @@ async function createReleaseIssue(): Promise<void> {
TEXT.header,
TEXT.versionChangeHeader,
versionChanges,
TEXT.skippedCommitsHeader,
skippedCommits,
TEXT.descriptionVersionChanges,
TEXT.indenpendentVersioning,
TEXT.changelogHeader,
TEXT.changelogDescription,
changelogs,
TEXT.skippedCommitsHeader,
skippedCommits,
TEXT.approvalHeader,
TEXT.approval,
].join('\n\n');
Expand Down