Skip to content

Commit 1300a1b

Browse files
committed
getMissingDeployments(): include the ARM64 packages
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 35cd252 commit 1300a1b

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

GitForWindowsHelper/component-updates.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ const pacmanRepositoryURLs = (package_name, version, architectures) =>
147147
architectures.map(arch => {
148148
const fileName = isMSYSPackage(package_name)
149149
? `${package_name}-${version}-1-${arch}.pkg.tar.xz`
150-
: `${package_name.replace(/^mingw-w64/, `$&-${arch}`)}-${version}-1-any.pkg.tar.xz`
150+
: `${package_name.replace(/^mingw-w64/,
151+
`$&-${arch === 'aarch64' ? `clang-${arch}` : arch}`)}-${version}-1-any.pkg.tar.xz`
151152
return `${pacmanRepositoryBaseURL}${arch.replace(/_/g, '-')}/${fileName}`
152153
})
153154

@@ -163,11 +164,14 @@ const getMissingDeployments = async (package_name, version) => {
163164
if (package_name === 'msys2-runtime') architectures.shift()
164165
else if (package_name === 'msys2-runtime-3.3') architectures.pop()
165166

167+
const mingwArchitectures = [...architectures, 'aarch64']
166168
const urls = []
167169
const msysName = package_name.replace(/^mingw-w64-/, '')
168170
if (packageNeedsBothMSYSAndMINGW(msysName)) {
169171
urls.push(...pacmanRepositoryURLs(msysName, version, architectures))
170-
urls.push(...pacmanRepositoryURLs(`mingw-w64-${msysName}`, version, architectures))
172+
urls.push(...pacmanRepositoryURLs(`mingw-w64-${msysName}`, version, mingwArchitectures))
173+
} else if (package_name !== msysName) {
174+
urls.push(...pacmanRepositoryURLs(package_name, version, mingwArchitectures))
171175
} else {
172176
urls.push(...pacmanRepositoryURLs(package_name, version, architectures))
173177
}

__tests__/component-updates.test.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,20 @@ href="[email protected]/">cygwin 3.4.7-1</a></b>
8484
</pre>[... even more stuff...]</body></html>`
8585
}
8686
const missingURL = 'https://wingit.blob.core.windows.net/x86-64/curl-8.1.2-1-x86_64.pkg.tar.xz'
87+
const missingAarch64URL = 'https://wingit.blob.core.windows.net/aarch64/mingw-w64-clang-aarch64-curl-8.1.2-1-any.pkg.tar.xz'
8788
const missingMinTTYURL = 'https://wingit.blob.core.windows.net/i686/mintty-1~3.6.5-1-i686.pkg.tar.xz'
8889
const bogus32BitMSYS2RuntimeURL = 'https://wingit.blob.core.windows.net/i686/msys2-runtime-3.4.9-1-i686.pkg.tar.xz'
8990
const bogus64BitMSYS2RuntimeURL = 'https://wingit.blob.core.windows.net/x86-64/msys2-runtime-3.3-3.3.7-1-x86_64.pkg.tar.xz'
9091
const missingOpenSSHURL = 'https://wingit.blob.core.windows.net/i686/openssh-9.5p1-1-i686.pkg.tar.xz'
9192
const missingBashURL = 'https://wingit.blob.core.windows.net/x86-64/bash-5.2.020-1-x86_64.pkg.tar.xz'
9293
const mockDoesURLReturn404 = jest.fn(url => [
93-
missingURL, missingMinTTYURL, bogus32BitMSYS2RuntimeURL, bogus64BitMSYS2RuntimeURL, missingOpenSSHURL, missingBashURL
94+
missingURL,
95+
missingAarch64URL,
96+
missingMinTTYURL,
97+
bogus32BitMSYS2RuntimeURL,
98+
bogus64BitMSYS2RuntimeURL,
99+
missingOpenSSHURL,
100+
missingBashURL
94101
].includes(url))
95102
jest.mock('../GitForWindowsHelper/https-request', () => {
96103
return {
@@ -207,7 +214,7 @@ http://www.gnutls.org/news.html#2023-02-10`
207214
})
208215

209216
test('getMissingDeployments()', async () => {
210-
expect(await getMissingDeployments('curl', '8.1.2')).toEqual([missingURL])
217+
expect(await getMissingDeployments('curl', '8.1.2')).toEqual([missingURL, missingAarch64URL])
211218
expect(await getMissingDeployments('mintty', '3.6.5')).toEqual([missingMinTTYURL])
212219
expect(await getMissingDeployments('msys2-runtime', '3.4.9')).toEqual([])
213220
expect(await getMissingDeployments('msys2-runtime-3.3', '3.3.7')).toEqual([])

__tests__/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ The workflow run [was started](dispatched-workflow-add-release-note.yml)`,
737737
})
738738
expect(mockGetInstallationAccessToken).toHaveBeenCalledTimes(1)
739739
expect(mockGitHubApiRequestAsApp).not.toHaveBeenCalled()
740-
expect(mockDoesURLReturn404).toHaveBeenCalledTimes(4)
740+
expect(mockDoesURLReturn404).toHaveBeenCalledTimes(5)
741741
expect(dispatchedWorkflows).toHaveLength(1)
742742
expect(dispatchedWorkflows[0].payload.inputs).toEqual({
743743
message: 'Comes with [GNU TLS v3.8.0](https://lists.gnupg.org/pipermail/gnutls-help/2023-February/004816.html).',
@@ -763,7 +763,7 @@ testIssueComment({ comment: '/add release note', note: 'missing deployment' }, {
763763
})
764764
expect(mockGetInstallationAccessToken).toHaveBeenCalledTimes(1)
765765
expect(mockGitHubApiRequestAsApp).not.toHaveBeenCalled()
766-
expect(mockDoesURLReturn404).toHaveBeenCalledTimes(2)
766+
expect(mockDoesURLReturn404).toHaveBeenCalledTimes(3)
767767
expect(dispatchedWorkflows).toHaveLength(0)
768768
})
769769

0 commit comments

Comments
 (0)