diff --git a/lib/modules/datasource/orb/__snapshots__/index.spec.ts.snap b/lib/modules/datasource/orb/__snapshots__/index.spec.ts.snap index b3583fe0121db5ac01afd2ce3b2fb79f04cb530a..b6f1650795302dc6d8e3e136abf479345c60a77f 100644 --- a/lib/modules/datasource/orb/__snapshots__/index.spec.ts.snap +++ b/lib/modules/datasource/orb/__snapshots__/index.spec.ts.snap @@ -4,7 +4,7 @@ exports[`modules/datasource/orb/index getReleases processes homeUrl 1`] = ` { "homepage": "https://google.com", "isPrivate": false, - "registryUrl": "https://circleci.com/", + "registryUrl": "https://circleci.com", "releases": [ { "releaseTimestamp": "2018-12-11T05:28:14.080Z", @@ -53,7 +53,7 @@ exports[`modules/datasource/orb/index getReleases processes real data 1`] = ` { "homepage": "https://circleci.com/developer/orbs/orb/hyper-expanse/library-release-workflows", "isPrivate": false, - "registryUrl": "https://circleci.com/", + "registryUrl": "https://circleci.com", "releases": [ { "releaseTimestamp": "2018-12-11T05:28:14.080Z", diff --git a/lib/modules/datasource/orb/index.spec.ts b/lib/modules/datasource/orb/index.spec.ts index e2dd13dd7b817c99b5aaf7621b6877b9cb69703e..1cb1e8519d4ac56a118092933e10ff737ddeaf6f 100644 --- a/lib/modules/datasource/orb/index.spec.ts +++ b/lib/modules/datasource/orb/index.spec.ts @@ -92,5 +92,18 @@ describe('modules/datasource/orb/index', () => { expect(res).toMatchSnapshot(); expect(res?.homepage).toBe('https://google.com'); }); + + it('supports other registries', async () => { + httpMock + .scope('https://cci.internal.dev') + .post('/graphql-unstable') + .reply(200, orbData); + const res = await getPkgReleases({ + datasource, + packageName: 'hyper-expanse/library-release-workflows', + registryUrls: ['https://cci.internal.dev'], + }); + expect(res?.registryUrl).toBe('https://cci.internal.dev'); + }); }); }); diff --git a/lib/modules/datasource/orb/index.ts b/lib/modules/datasource/orb/index.ts index 12e3bc834d5eee5eec1c0f0d39c24a124f407169..80fa61e4e93204335a720f52a6f960da1035e916 100644 --- a/lib/modules/datasource/orb/index.ts +++ b/lib/modules/datasource/orb/index.ts @@ -1,5 +1,6 @@ import { logger } from '../../../logger'; import { cache } from '../../../util/cache/package/decorator'; +import { joinUrlParts } from '../../../util/url'; import { Datasource } from '../datasource'; import type { GetReleasesConfig, ReleaseResult } from '../types'; import type { OrbResponse } from './types'; @@ -27,9 +28,10 @@ export class OrbDatasource extends Datasource { super(OrbDatasource.id); } - override readonly customRegistrySupport = false; + override readonly customRegistrySupport = true; override readonly defaultRegistryUrls = ['https://circleci.com/']; + override readonly registryStrategy = 'hunt'; override readonly releaseTimestampSupport = true; override readonly releaseTimestampNote = @@ -47,7 +49,7 @@ export class OrbDatasource extends Datasource { if (!registryUrl) { return null; } - const url = `${registryUrl}graphql-unstable`; + const url = joinUrlParts(registryUrl, 'graphql-unstable'); const body = { query, variables: { packageName, maxVersions: MAX_VERSIONS },