From ec7b3fcc9e57017531ac932d3116973ef8376fa7 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 3 Feb 2024 14:50:54 +0100 Subject: [PATCH 1/2] __tests__: remove extra empty line Signed-off-by: Johannes Schindelin --- __tests__/index.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/__tests__/index.test.js b/__tests__/index.test.js index ecfd1a5..e9964ce 100644 --- a/__tests__/index.test.js +++ b/__tests__/index.test.js @@ -503,7 +503,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, From 53ba3a8a213c2d322f24666b423b8180e2246b74 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 3 Feb 2024 14:43:36 +0100 Subject: [PATCH 2/2] /deploy: respect the `i686:` prefix of PR titles To allow for building i686 packages that are no longer built by the MSYS2 project, let's establish the paradigm that Pull Requests whose titles start with `i686:` are to be deployed only to the 32-bit flavor of the Git for Windows Pacman repository. Note: Since it is not customary to specifically point out each and every such i686 build in the release notes, this commit does not take care of `getMissingDeployments()` nor of the `/add relnote` command. Signed-off-by: Johannes Schindelin --- GitForWindowsHelper/slash-commands.js | 2 +- __tests__/index.test.js | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/GitForWindowsHelper/slash-commands.js b/GitForWindowsHelper/slash-commands.js index af401a0..45131db 100644 --- a/GitForWindowsHelper/slash-commands.js +++ b/GitForWindowsHelper/slash-commands.js @@ -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' } ) diff --git a/__tests__/index.test.js b/__tests__/index.test.js index e9964ce..8a2d286 100644 --- a/__tests__/index.test.js +++ b/__tests__/index.test.js @@ -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' } } @@ -525,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', () => {