Skip to content

Commit 2085119

Browse files
committed
guess release notes: support GNU TLS tickets better
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent b0ffada commit 2085119

2 files changed

Lines changed: 23 additions & 6 deletions

File tree

GitForWindowsHelper/component-updates.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ const guessReleaseNotes = async (context, issue) => {
5656
&&issue.labels.filter(label => label.name === 'component-update').length !== 1) throw new Error(`Cannot determine release note from issue ${issue.number}`)
5757
let { package_name, version } = guessComponentUpdateDetails(issue.title, issue.body)
5858

59-
package_name = prettyPackageName(package_name.replace(/^mingw-w64-/, ''))
60-
6159
const matchURLInIssue = (issue) => {
62-
const match = issue.body.match(package_name.toLowerCase() === 'bash'
63-
? /(?:^|\n)(https:\/\/\S+)/ // for `bash`, use the first URL
64-
: /(?:^|\n)(https:\/\/\S+)$/)
60+
const pattern = {
61+
bash: /(?:^|\n)(https:\/\/\S+)/, // use the first URL
62+
gnutls: /(https:\/\/[^\s)]+)/
63+
}[package_name.toLowerCase()] || /(?:^|\n)(https:\/\/\S+)$/
64+
const match = issue.body.match(pattern)
6565
return match && match[1]
6666
}
6767

@@ -86,6 +86,9 @@ const guessReleaseNotes = async (context, issue) => {
8686

8787
const url = await matchURL()
8888
if (!url) throw new Error(`Could not determine URL from issue ${issue.number}`)
89+
90+
package_name = prettyPackageName(package_name.replace(/^mingw-w64-/, ''))
91+
8992
return {
9093
type: 'feature',
9194
message: `Comes with [${package_name} v${version}](${url}).`

__tests__/component-updates.test.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ test('guessComponentUpdateDetails()', () => {
3232
['[New mintty version] 3.6.3', 'mintty', '3.6.3'],
3333
['[New pcre2 version] PCRE2-10.42', 'pcre2', '10.42'],
3434
['[New git-lfs version] v3.3.0', 'mingw-w64-git-lfs', '3.3.0'],
35-
['[New heimdal version] Heimdal 7.7.1 - Security Fix Release', 'heimdal', '7.7.1']
35+
['[New heimdal version] Heimdal 7.7.1 - Security Fix Release', 'heimdal', '7.7.1'],
36+
['[New gnutls version] GnuTLS 3.8.0', 'gnutls', '3.8.0']
3637
]
3738
for (const [title, package_name, version] of titles) {
3839
expect(guessComponentUpdateDetails(title)).toEqual({ package_name, version })
@@ -62,4 +63,17 @@ test('guessReleaseNotes()', async () => {
6263
type: 'feature',
6364
message: 'Comes with [Bash v5.2.15](https://git.savannah.gnu.org/cgit/bash.git/commit/?id=ec8113b9861375e4e17b3307372569d429dec814).'
6465
})
66+
67+
expect(await guessReleaseNotes(context, {
68+
labels: [{ name: 'component-update' }],
69+
title: '[New gnutls version] GnuTLS 3.8.0',
70+
body: `Released a bug-fix and enhancement release on the 3.8.x branch.[GnuTLS 3.8.0](https://lists.gnupg.org/pipermail/gnutls-help/2023-February/004816.html)
71+
72+
Added the security advisory.[GNUTLS-SA-2020-07-14](security-new.html#GNUTLS-SA-2020-07-14)
73+
74+
http://www.gnutls.org/news.html#2023-02-10`
75+
})).toEqual({
76+
type: 'feature',
77+
message: 'Comes with [GNU TLS v3.8.0](https://lists.gnupg.org/pipermail/gnutls-help/2023-February/004816.html).'
78+
})
6579
})

0 commit comments

Comments
 (0)