From 8061e703303c170e0854441e921eb0f8e5ee90bf Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 21 Feb 2025 11:22:23 +0100 Subject: [PATCH] Fix `/add relnote` for PCRE2 issues I tried running `/add relnote` for the most recent PCRE2 issue in https://github.com/git-for-windows/git/issues/5398#issuecomment-2674080159 but it failed: The following deployment(s) are missing: * https://wingit.blob.core.windows.net/i686/pcre2-pcre2-10.45-1-i686.pkg.tar.xz * https://wingit.blob.core.windows.net/x86-64/pcre2-pcre2-10.45-1-x86_64.pkg.tar.xz * https://wingit.blob.core.windows.net/i686/mingw-w64-i686-pcre2-pcre2-10.45-1-any.pkg.tar.xz * https://wingit.blob.core.windows.net/x86-64/mingw-w64-x86_64-pcre2-pcre2-10.45-1-any.pkg.tar.xz Clearly, GitForWindowsHelper was parsing the version incorrectly. Let's fix that. Signed-off-by: Johannes Schindelin --- GitForWindowsHelper/component-updates.js | 2 +- __tests__/component-updates.test.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/GitForWindowsHelper/component-updates.js b/GitForWindowsHelper/component-updates.js index e3114d1..7c5cef5 100644 --- a/GitForWindowsHelper/component-updates.js +++ b/GitForWindowsHelper/component-updates.js @@ -14,7 +14,7 @@ const guessComponentUpdateDetails = (title, body) => { else if (['clang', 'llvm', 'mingw-w64-clang'].includes(package_name)) package_name = 'mingw-w64-llvm' version = version - .replace(/^(GCM |openssl-|OpenSSL_|v|V_|GnuTLS |tig-|Heimdal |cygwin-|PCRE2-|Bash-|curl-|gnupg-|is-)/, '') + .replace(/^(GCM |openssl-|OpenSSL_|v|V_|GnuTLS |tig-|Heimdal |cygwin-|PCRE2-|Bash-|curl-|gnupg-|is-|pcre2-)/, '') .replace(/\s+patch\s+/, '.') .replace(/_/g, '.') .replace(/-release$/, '') diff --git a/__tests__/component-updates.test.js b/__tests__/component-updates.test.js index 13cfa49..d704695 100644 --- a/__tests__/component-updates.test.js +++ b/__tests__/component-updates.test.js @@ -211,6 +211,16 @@ http://www.gnutls.org/news.html#2023-02-10` package: 'msys2-runtime', version: '3.4.7' }) + expect(await guessReleaseNotes(context, { + labels: [{ name: 'component-update' }], + title: '[New pcre2 version] pcre2-10.45', + body: `\n\nhttps://github.com/PCRE2Project/pcre2/releases/tag/pcre2-10.45` + })).toEqual({ + type: 'feature', + message: 'Comes with [PCRE2 v10.45](https://github.com/PCRE2Project/pcre2/releases/tag/pcre2-10.45).', + package: 'pcre2', + version: '10.45' + }) }) test('getMissingDeployments()', async () => {