Skip to content

Commit

Permalink
Merge pull request #57 from dscho/i686-only-deployments
Browse files Browse the repository at this point in the history
Prepare `/deploy` for i686-only Pull Requests
  • Loading branch information
dscho authored Feb 3, 2024
2 parents 4a30c1f + 53ba3a8 commit 741242f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GitForWindowsHelper/slash-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ module.exports = async (context, req) => {

const toTrigger = []
if (isMSYSPackage(package_name)) {
if (package_name !== 'msys2-runtime-3.3') {
if (package_name !== 'msys2-runtime-3.3' && !req.body.issue.title.startsWith('i686:')) {
toTrigger.push(
{ architecture: 'x86_64' }
)
Expand Down
26 changes: 25 additions & 1 deletion __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ let mockGitHubApiRequest = jest.fn((_context, _token, method, requestPath, paylo
if (method === 'GET' && requestPath.endsWith('/pulls/96')) return {
head: { sha: 'b7b0dfc' }
}
if (method === 'GET' && requestPath.endsWith('/pulls/153')) return {
head: { sha: 'b197f8f' }
}
if (method === 'GET' && requestPath.endsWith('/pulls/4322')) return {
head: { sha: 'c8edb521bdabec14b07e9142e48cab77a40ba339' }
}
Expand Down Expand Up @@ -503,7 +506,6 @@ 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', {
issue: {
number: 75,
Expand All @@ -526,6 +528,28 @@ The workflow run [was started](dispatched-workflow-build-and-deploy.yml).`)
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['aarch64'])
})

testIssueComment('/deploy libkbsa', {
issue: {
number: 153,
title: 'i686: build newest version of libksba, because gnupg requires at least v1.6.3',
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.',
pull_request: {
html_url: 'https://github.com/git-for-windows/MSYS2-packages/pull/153'
}
},
repository: {
name: 'MSYS2-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(['i686'])
})

const missingURL = 'https://wingit.blob.core.windows.net/x86-64/mingw-w64-x86_64-git-lfs-3.4.0-1-any.pkg.tar.xz'
const mockDoesURLReturn404 = jest.fn(url => url === missingURL)
jest.mock('../GitForWindowsHelper/https-request', () => {
Expand Down

0 comments on commit 741242f

Please sign in to comment.