Skip to content

Commit 29b1c99

Browse files
authored
Merge pull request #32 from dscho/guess-perl-relnotes
Make a more informed guess at the Perl release notes
2 parents 961ebdb + 823757a commit 29b1c99

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

GitForWindowsHelper/component-updates.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ const guessReleaseNotes = async (context, issue) => {
6666
}
6767

6868
const matchURL = async () => {
69+
if (package_name === 'perl') return `http://search.cpan.org/dist/perl-${version}/pod/perldelta.pod`
70+
6971
if (!issue.pull_request) return matchURLInIssue(issue)
7072

7173
const match = issue.body.match(/See (https:\/\/\S+) for details/)

__tests__/component-updates.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,13 @@ http://www.gnutls.org/news.html#2023-02-10`
7777
type: 'feature',
7878
message: 'Comes with [GNU TLS v3.8.0](https://lists.gnupg.org/pipermail/gnutls-help/2023-February/004816.html).'
7979
})
80+
81+
expect(await guessReleaseNotes(context, {
82+
labels: [{ name: 'component-update' }],
83+
title: '[New perl version] v5.36.1',
84+
body: `\nhttps://github.com/Perl/perl5/releases/tag/v5.36.1`
85+
})).toEqual({
86+
type: 'feature',
87+
message: 'Comes with [Perl v5.36.1](http://search.cpan.org/dist/perl-5.36.1/pod/perldelta.pod).'
88+
})
8089
})

__tests__/index.test.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,13 @@ let mockQueueCheckRun = jest.fn(() => 'check-run-id')
270270
let mockUpdateCheckRun = jest.fn()
271271
let mockListCheckRunsForCommit = jest.fn((_context, _token, _owner, _repo, rev, checkRunName) => {
272272
if (rev === 'this-will-be-rc2') {
273+
const id = checkRunName === 'git-artifacts-x86_64' ? 8664 : 686
273274
const output = {
274275
title: 'Build Git -rc2 artifacts',
275-
summary: 'Build Git -rc2 artifacts from commit this-will-be-rc2 (tag-git run #987)'
276+
summary: 'Build Git -rc2 artifacts from commit this-will-be-rc2 (tag-git run #987)',
277+
text: `For details, see [this run](https://github.com/git-for-windows/git-for-windows-automation/actions/runs/${id})`
276278
}
277-
if (checkRunName === 'git-artifacts-x86_64') return [{ id: 8664, status: 'completed', conclusion: 'success', output }]
278-
if (checkRunName === 'git-artifacts-i686') return [{ id: 686, status: 'completed', conclusion: 'success', output }]
279+
return [{ id, status: 'completed', conclusion: 'success', output }]
279280
}
280281
if (rev === 'dee501d15') {
281282
if (checkRunName === 'tag-git') return [{
@@ -411,7 +412,7 @@ The \`git-artifacts-i686\` workflow run [was started](dispatched-workflow-git-ar
411412
ref: 'main',
412413
inputs: {
413414
architecture: 'i686',
414-
tag_git_workflow_run_id: 4322343196
415+
tag_git_workflow_run_id: "4322343196"
415416
}
416417
}
417418
])
@@ -477,12 +478,12 @@ The \`git-artifacts-i686\` workflow run [was started](dispatched-workflow-git-ar
477478
expect(dispatchedWorkflows[0].html_url).toEqual('dispatched-workflow-git-artifacts.yml')
478479
expect(dispatchedWorkflows[0].payload.inputs).toEqual({
479480
architecture: 'i686',
480-
tag_git_workflow_run_id: 341
481+
tag_git_workflow_run_id: "341"
481482
})
482483
expect(dispatchedWorkflows[1].html_url).toEqual('dispatched-workflow-git-artifacts.yml')
483484
expect(dispatchedWorkflows[1].payload.inputs).toEqual({
484485
architecture: 'x86_64',
485-
tag_git_workflow_run_id: 341
486+
tag_git_workflow_run_id: "341"
486487
})
487488
})
488489

@@ -508,7 +509,7 @@ The \`release-git\` workflow run [was started](dispatched-workflow-release-git.y
508509
expect(dispatchedWorkflows).toHaveLength(1)
509510
expect(dispatchedWorkflows[0].html_url).toEqual('dispatched-workflow-release-git.yml')
510511
expect(dispatchedWorkflows[0].payload.inputs).toEqual({
511-
git_artifacts_x86_64_workflow_run_id: 8664,
512-
git_artifacts_i686_workflow_run_id: 686
512+
git_artifacts_x86_64_workflow_run_id: "8664",
513+
git_artifacts_i686_workflow_run_id: "686"
513514
})
514515
})

0 commit comments

Comments
 (0)