Skip to content

Commit

Permalink
refactor: add option endpoint to global config (#15843)
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh committed Jun 2, 2022
1 parent 5495ab6 commit bd6e422
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/config/global.ts
Expand Up @@ -23,6 +23,7 @@ export class GlobalConfig {
'privateKey',
'privateKeyOld',
'gitTimeout',
'endpoint',
];

private static config: RepoGlobalConfig = {};
Expand Down
2 changes: 2 additions & 0 deletions lib/config/types.ts
Expand Up @@ -95,6 +95,7 @@ export interface GlobalOnlyConfig {
privateKeyPathOld?: string;
redisUrl?: string;
repositories?: RenovateRepository[];
endpoint?: string;
}

// Config options used within the repository worker, but not user configurable
Expand All @@ -120,6 +121,7 @@ export interface RepoGlobalConfig {
privateKeyOld?: string;
localDir?: string;
cacheDir?: string;
endpoint?: string;
}

export interface LegacyAdminConfig {
Expand Down
11 changes: 10 additions & 1 deletion lib/workers/repository/index.spec.ts
Expand Up @@ -19,13 +19,22 @@ describe('workers/repository/index', () => {

beforeEach(() => {
config = getConfig();
GlobalConfig.set({ localDir: '' });
});

it('runs', async () => {
process.extractDependencies.mockResolvedValue(mock<ExtractResult>());
const res = await renovateRepository(config);
expect(res).toBeUndefined();
});

it('shows endpoint', async () => {
process.extractDependencies.mockResolvedValue(mock<ExtractResult>());
const res = await renovateRepository({
...config,
endpoint: 'https://github.com',
});
expect(GlobalConfig.get().endpoint).toBe('https://github.com');
expect(res).toBeUndefined();
});
});
});

0 comments on commit bd6e422

Please sign in to comment.