Skip to content

Commit c0d5c58

Browse files
committed
guess release notes: special-case cURL (even in MINGW-packages)
In #34, I taught the GitForWindowsHelper GitHub App to generate better release notes for cURL. However, I failed to notice that the code changes would work only for the `component-updates` issues as well as for the MSYS2-packages PRs, but not for the MINGW-packages PRs because the package name that is derived from the latter PRs has the `mingw-w64-` prefix (and must have it, for the "is this already deployed?" check). Let's make sure that that special-casing (as well for cURL as well as for OpenSSL) work even in MINGW-packages PRs. Helped-by: Matthias Aßhauer <mha1993@live.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent e0a5e97 commit c0d5c58

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

GitForWindowsHelper/component-updates.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ const guessReleaseNotes = async (context, issue) => {
102102
}
103103

104104
const matchURL = async () => {
105-
if (package_name === 'perl') return `http://search.cpan.org/dist/perl-${version}/pod/perldelta.pod`
106-
if (package_name === 'curl') return `https://curl.se/changes.html#${version.replaceAll('.', '_')}`
107-
if (package_name === 'openssl') return `https://www.openssl.org/news/openssl-${
105+
switch (package_name.replace(/^mingw-w64-/, '')) {
106+
case 'perl': return `http://search.cpan.org/dist/perl-${version}/pod/perldelta.pod`
107+
case 'curl': return `https://curl.se/changes.html#${version.replaceAll('.', '_')}`
108+
case 'openssl': return `https://www.openssl.org/news/openssl-${
108109
version.replace(/^(1\.1\.1|[3-9]\.\d+).*/, '$1')
109110
}-notes.html`
111+
}
110112

111113
if (!issue.pull_request) return matchURLInIssue(issue)
112114

__tests__/component-updates.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,17 @@ http://www.gnutls.org/news.html#2023-02-10`
150150
version: '8.1.1'
151151
})
152152

153+
expect(await guessReleaseNotes(context, {
154+
pull_request: { "html_url": "https://github.com/git-for-windows/MINGW-packages/pull/120" },
155+
title: 'mingw-w64-curl: update to 8.8.0',
156+
body: `This closes https://github.com/git-for-windows/git/issues/4963`
157+
})).toEqual({
158+
type: 'feature',
159+
message: 'Comes with [cURL v8.8.0](https://curl.se/changes.html#8_8_0).',
160+
package: 'mingw-w64-curl',
161+
version: '8.8.0'
162+
})
163+
153164
expect(await guessReleaseNotes(context, {
154165
labels: [{ name: 'component-update' }],
155166
title: '[New openssl version] OpenSSL 1.1.1u',

0 commit comments

Comments
 (0)