Skip to content

Commit

Permalink
Merge pull request #81 from rimrul/clang-renamed
Browse files Browse the repository at this point in the history
/deploy: adjust for new mingw-w64-clang name
  • Loading branch information
dscho authored Jun 3, 2024
2 parents d226e9d + 9f7b963 commit 391e9ab
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
1 change: 1 addition & 0 deletions GitForWindowsHelper/component-updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const guessComponentUpdateDetails = (title, body) => {
else if (['git-credential-manager', 'gcm-core', 'gcm'].includes(package_name)) package_name = 'mingw-w64-git-credential-manager'
else if (package_name === 'cygwin') package_name = 'msys2-runtime'
else if (package_name === 'gpg') package_name = 'gnupg'
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-)/, '')
Expand Down
2 changes: 1 addition & 1 deletion GitForWindowsHelper/slash-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ module.exports = async (context, req) => {
)
}
} else {
if (package_name !== 'mingw-w64-clang') {
if (package_name !== 'mingw-w64-llvm') {
toTrigger.push(
{ displayArchitecture: 'i686/x86_64' }
)
Expand Down
37 changes: 30 additions & 7 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ let mockGitHubApiRequest = jest.fn((_context, _token, method, requestPath, paylo
if (method === 'GET' && requestPath.endsWith('/pulls/74')) return {
head: { sha: 'a7e4b90' }
}
if (method === 'GET' && requestPath.endsWith('/pulls/75')) return {
head: { sha: '45b8fd0' }
}
if (method === 'GET' && requestPath.endsWith('/pulls/90')) return {
head: { sha: '265d07e' }
}
if (method === 'GET' && requestPath.endsWith('/pulls/96')) return {
head: { sha: 'b7b0dfc' }
}
if (method === 'GET' && requestPath.endsWith('/pulls/115')) return {
head: { sha: '9bc59bd' }
}
if (method === 'GET' && requestPath.endsWith('/pulls/153')) return {
head: { sha: 'b197f8f' }
}
Expand Down Expand Up @@ -526,13 +526,35 @@ The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`)
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['i686'])
})

testIssueComment('/deploy mingw-w64-clang', {
testIssueComment('/deploy mingw-w64-llvm', {
issue: {
number: 115,
title: 'clang: update to 18.1.6',
body: '',
pull_request: {
html_url: 'https://github.com/git-for-windows/MINGW-packages/pull/115'
}
},
repository: {
name: 'MINGW-packages'
}
}, async (context) => {
expect(await index(context, context.req)).toBeUndefined()
expect(context.res.body).toEqual(`I edited the comment: appended-comment-body-existing comment body
The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`)
expect(mockQueueCheckRun).toHaveBeenCalledTimes(1)
expect(mockUpdateCheckRun).toHaveBeenCalledTimes(1)
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['aarch64'])
})

testIssueComment('/deploy', {
issue: {
number: 75,
title: 'shrink LLVM',
number: 115,
title: 'clang: update to 18.1.6',
body: '',
pull_request: {
html_url: 'https://github.com/git-for-windows/MINGW-packages/pull/75'
html_url: 'https://github.com/git-for-windows/MINGW-packages/pull/115'
}
},
repository: {
Expand All @@ -546,6 +568,7 @@ The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`)
expect(mockQueueCheckRun).toHaveBeenCalledTimes(1)
expect(mockUpdateCheckRun).toHaveBeenCalledTimes(1)
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['aarch64'])
expect(dispatchedWorkflows.map(e => e.payload.inputs.package)).toEqual(['mingw-w64-llvm'])
})

testIssueComment('/deploy libkbsa', {
Expand Down

0 comments on commit 391e9ab

Please sign in to comment.