feat: find release notes for lerna monorepos (#7457)

This commit is contained in:
Misha Kaletsky 2020-10-14 09:26:08 -04:00 committed by GitHub
parent 1c3caa67c9
commit 78c2d6a42f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 2 deletions

View file

@ -208,6 +208,32 @@ Array [
]
`;
exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body 9`] = `
Object {
"body": "some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)
",
"id": undefined,
"name": undefined,
"tag": "other@1.0.1",
"url": "https://github.com/some/other-repository/releases/other@1.0.1",
}
`;
exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body 10`] = `
Array [
Object {
"headers": Object {
"accept": "application/vnd.github.v3+json",
"accept-encoding": "gzip, deflate",
"host": "api.github.com",
"user-agent": "https://github.com/renovatebot/renovate",
},
"method": "GET",
"url": "https://api.github.com/repos/some/other-repository/releases?per_page=100",
},
]
`;
exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body from gitlab repo 1`] = `null`;
exports[`workers/pr/changelog/release-notes getReleaseNotes() gets release notes with body from gitlab repo 2`] = `

View file

@ -146,7 +146,7 @@ describe(getName(__filename), () => {
expect(res).toBeNull();
expect(httpMock.getTrace()).toMatchSnapshot();
});
it.each([[''], ['v'], ['other-'], ['other_v']])(
it.each([[''], ['v'], ['other-'], ['other_v'], ['other@']])(
'gets release notes with body',
async (prefix) => {
httpMock

View file

@ -97,7 +97,8 @@ export async function getReleaseNotes(
release.tag === version ||
release.tag === `v${version}` ||
release.tag === `${depName}-${version}` ||
release.tag === `${depName}_v${version}`
release.tag === `${depName}_v${version}` ||
release.tag === `${depName}@${version}`
) {
releaseNotes = release;
releaseNotes.url = baseUrl.includes('gitlab')