Skip to content

Commit 741242f

Browse files
authored
Merge pull request #57 from dscho/i686-only-deployments
Prepare `/deploy` for i686-only Pull Requests
2 parents 4a30c1f + 53ba3a8 commit 741242f

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

GitForWindowsHelper/slash-commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ module.exports = async (context, req) => {
188188

189189
const toTrigger = []
190190
if (isMSYSPackage(package_name)) {
191-
if (package_name !== 'msys2-runtime-3.3') {
191+
if (package_name !== 'msys2-runtime-3.3' && !req.body.issue.title.startsWith('i686:')) {
192192
toTrigger.push(
193193
{ architecture: 'x86_64' }
194194
)

__tests__/index.test.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ let mockGitHubApiRequest = jest.fn((_context, _token, method, requestPath, paylo
118118
if (method === 'GET' && requestPath.endsWith('/pulls/96')) return {
119119
head: { sha: 'b7b0dfc' }
120120
}
121+
if (method === 'GET' && requestPath.endsWith('/pulls/153')) return {
122+
head: { sha: 'b197f8f' }
123+
}
121124
if (method === 'GET' && requestPath.endsWith('/pulls/4322')) return {
122125
head: { sha: 'c8edb521bdabec14b07e9142e48cab77a40ba339' }
123126
}
@@ -503,7 +506,6 @@ The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`)
503506
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['i686'])
504507
})
505508

506-
507509
testIssueComment('/deploy mingw-w64-clang', {
508510
issue: {
509511
number: 75,
@@ -526,6 +528,28 @@ The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`)
526528
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['aarch64'])
527529
})
528530

531+
testIssueComment('/deploy libkbsa', {
532+
issue: {
533+
number: 153,
534+
title: 'i686: build newest version of libksba, because gnupg requires at least v1.6.3',
535+
body: 'I just tried to deploy gnupg v2.4.4 but it failed in the deploy-i686 job because of an outdated libksba package. We used to benefit from MSYS2\'s updates, but for the i686 variant there are no more updates of the MSYS packages, therefore we have to build it ourselves now.',
536+
pull_request: {
537+
html_url: 'https://github.com/git-for-windows/MSYS2-packages/pull/153'
538+
}
539+
},
540+
repository: {
541+
name: 'MSYS2-packages'
542+
}
543+
}, async (context) => {
544+
expect(await index(context, context.req)).toBeUndefined()
545+
expect(context.res.body).toEqual(`I edited the comment: appended-comment-body-existing comment body
546+
547+
The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`)
548+
expect(mockQueueCheckRun).toHaveBeenCalledTimes(1)
549+
expect(mockUpdateCheckRun).toHaveBeenCalledTimes(1)
550+
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['i686'])
551+
})
552+
529553
const missingURL = 'https://wingit.blob.core.windows.net/x86-64/mingw-w64-x86_64-git-lfs-3.4.0-1-any.pkg.tar.xz'
530554
const mockDoesURLReturn404 = jest.fn(url => url === missingURL)
531555
jest.mock('../GitForWindowsHelper/https-request', () => {

0 commit comments

Comments
 (0)