mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-25 14:06:27 +00:00
fix(go): Better condition for quitting major versions fetch loop (#33102)
This commit is contained in:
parent
0633b79d18
commit
3d86982ccb
2 changed files with 8 additions and 6 deletions
|
@ -602,8 +602,6 @@ describe('modules/datasource/go/releases-goproxy', () => {
|
|||
.get('/@v/list')
|
||||
.reply(200)
|
||||
.get('/@latest')
|
||||
.reply(404)
|
||||
.get('/v2/@v/list')
|
||||
.reply(404);
|
||||
|
||||
const res = await datasource.getReleases({
|
||||
|
@ -621,9 +619,7 @@ describe('modules/datasource/go/releases-goproxy', () => {
|
|||
.get('/@v/list')
|
||||
.reply(200)
|
||||
.get('/@latest')
|
||||
.reply(200, { Version: 'v0.0.0-20230905200255-921286631fa9' })
|
||||
.get('/v2/@v/list')
|
||||
.reply(404);
|
||||
.reply(200, { Version: 'v0.0.0-20230905200255-921286631fa9' });
|
||||
|
||||
const res = await datasource.getReleases({
|
||||
packageName: 'github.com/google/btree',
|
||||
|
|
|
@ -213,9 +213,11 @@ export class GoProxyDatasource extends Datasource {
|
|||
major += 1; // v0 and v1 are the same module
|
||||
}
|
||||
|
||||
let releases: Release[] = [];
|
||||
|
||||
try {
|
||||
const res = await this.listVersions(baseUrl, pkg);
|
||||
const releases = await p.map(res, async (versionInfo) => {
|
||||
releases = await p.map(res, async (versionInfo) => {
|
||||
const { version, newDigest, releaseTimestamp } = versionInfo;
|
||||
|
||||
if (releaseTimestamp) {
|
||||
|
@ -258,6 +260,10 @@ export class GoProxyDatasource extends Datasource {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!releases.length) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in a new issue