Skip to content

Commit 9f7b963

Browse files
committed
/deploy: adjust for new mingw-w64-clang name
MSYS2 renamed the mingw-w64-clang folder to mingw-w64-llvm [1], adjust the /deploy command to handle this change gracefully. [1] msys2/MINGW-packages@2ad570c Signed-off-by: Matthias Aßhauer <mha1993@live.de>
1 parent 3a3af31 commit 9f7b963

3 files changed

Lines changed: 32 additions & 8 deletions

File tree

GitForWindowsHelper/component-updates.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const guessComponentUpdateDetails = (title, body) => {
1010
else if (['git-credential-manager', 'gcm-core', 'gcm'].includes(package_name)) package_name = 'mingw-w64-git-credential-manager'
1111
else if (package_name === 'cygwin') package_name = 'msys2-runtime'
1212
else if (package_name === 'gpg') package_name = 'gnupg'
13+
else if (['clang', 'llvm', 'mingw-w64-clang'].includes(package_name)) package_name = 'mingw-w64-llvm'
1314

1415
version = version
1516
.replace(/^(GCM |openssl-|OpenSSL_|v|V_|GnuTLS |tig-|Heimdal |cygwin-|PCRE2-|Bash-|curl-|gnupg-)/, '')

GitForWindowsHelper/slash-commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ module.exports = async (context, req) => {
200200
)
201201
}
202202
} else {
203-
if (package_name !== 'mingw-w64-clang') {
203+
if (package_name !== 'mingw-w64-llvm') {
204204
toTrigger.push(
205205
{ displayArchitecture: 'i686/x86_64' }
206206
)

__tests__/index.test.js

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ let mockGitHubApiRequest = jest.fn((_context, _token, method, requestPath, paylo
112112
if (method === 'GET' && requestPath.endsWith('/pulls/74')) return {
113113
head: { sha: 'a7e4b90' }
114114
}
115-
if (method === 'GET' && requestPath.endsWith('/pulls/75')) return {
116-
head: { sha: '45b8fd0' }
117-
}
118115
if (method === 'GET' && requestPath.endsWith('/pulls/90')) return {
119116
head: { sha: '265d07e' }
120117
}
121118
if (method === 'GET' && requestPath.endsWith('/pulls/96')) return {
122119
head: { sha: 'b7b0dfc' }
123120
}
121+
if (method === 'GET' && requestPath.endsWith('/pulls/115')) return {
122+
head: { sha: '9bc59bd' }
123+
}
124124
if (method === 'GET' && requestPath.endsWith('/pulls/153')) return {
125125
head: { sha: 'b197f8f' }
126126
}
@@ -526,13 +526,35 @@ The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`)
526526
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['i686'])
527527
})
528528

529-
testIssueComment('/deploy mingw-w64-clang', {
529+
testIssueComment('/deploy mingw-w64-llvm', {
530+
issue: {
531+
number: 115,
532+
title: 'clang: update to 18.1.6',
533+
body: '',
534+
pull_request: {
535+
html_url: 'https://github.com/git-for-windows/MINGW-packages/pull/115'
536+
}
537+
},
538+
repository: {
539+
name: 'MINGW-packages'
540+
}
541+
}, async (context) => {
542+
expect(await index(context, context.req)).toBeUndefined()
543+
expect(context.res.body).toEqual(`I edited the comment: appended-comment-body-existing comment body
544+
545+
The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`)
546+
expect(mockQueueCheckRun).toHaveBeenCalledTimes(1)
547+
expect(mockUpdateCheckRun).toHaveBeenCalledTimes(1)
548+
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['aarch64'])
549+
})
550+
551+
testIssueComment('/deploy', {
530552
issue: {
531-
number: 75,
532-
title: 'shrink LLVM',
553+
number: 115,
554+
title: 'clang: update to 18.1.6',
533555
body: '',
534556
pull_request: {
535-
html_url: 'https://github.com/git-for-windows/MINGW-packages/pull/75'
557+
html_url: 'https://github.com/git-for-windows/MINGW-packages/pull/115'
536558
}
537559
},
538560
repository: {
@@ -546,6 +568,7 @@ The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`)
546568
expect(mockQueueCheckRun).toHaveBeenCalledTimes(1)
547569
expect(mockUpdateCheckRun).toHaveBeenCalledTimes(1)
548570
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['aarch64'])
571+
expect(dispatchedWorkflows.map(e => e.payload.inputs.package)).toEqual(['mingw-w64-llvm'])
549572
})
550573

551574
testIssueComment('/deploy libkbsa', {

0 commit comments

Comments
 (0)