aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMike Glazer <[email protected]>2024-12-20 08:07:28 -0800
committerGitHub <[email protected]>2024-12-20 16:07:28 +0000
commit7eef0d3ed0acd1c67224c55b87395df06bde9753 (patch)
treeca5694a2e87a75f528ff275dbd4761c253f6815e
parent91c0483543576e60a3af3cf858c931147f7c850e (diff)
downloadrenovate-39.79.0.tar.gz
renovate-39.79.0.zip
feat(datasource/orb): Add support for internal CircleCI Registries (#33213)39.79.0
Co-authored-by: Michael Kriese <[email protected]>
-rw-r--r--lib/modules/datasource/orb/__snapshots__/index.spec.ts.snap4
-rw-r--r--lib/modules/datasource/orb/index.spec.ts13
-rw-r--r--lib/modules/datasource/orb/index.ts6
3 files changed, 19 insertions, 4 deletions
diff --git a/lib/modules/datasource/orb/__snapshots__/index.spec.ts.snap b/lib/modules/datasource/orb/__snapshots__/index.spec.ts.snap
index b3583fe0121..b6f16507953 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 e2dd13dd7b8..1cb1e8519d4 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 12e3bc834d5..80fa61e4e93 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 },