Skip to content

Commit

Permalink
feat(http): remove dnsCache option (#29449)
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh authored and rarkins committed Jul 23, 2024
1 parent 60b901f commit 79f7463
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 206 deletions.
1 change: 0 additions & 1 deletion lib/types/host-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export interface HostRule {
headers?: Record<string, string>;
maxRetryAfter?: number;

dnsCache?: boolean;
keepAlive?: boolean;
artifactAuth?: string[] | null;
httpsCertificateAuthority?: string;
Expand Down
50 changes: 0 additions & 50 deletions lib/util/http/dns.spec.ts

This file was deleted.

111 changes: 0 additions & 111 deletions lib/util/http/dns.ts

This file was deleted.

17 changes: 0 additions & 17 deletions lib/util/http/host-rules.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { GlobalConfig } from '../../config/global';
import { bootstrap } from '../../proxy';
import type { HostRule } from '../../types';
import * as hostRules from '../host-rules';
import { dnsLookup } from './dns';
import { applyHostRule, findMatchingRule } from './host-rules';
import type { GotOptions } from './types';

Expand Down Expand Up @@ -125,22 +124,6 @@ describe('util/http/host-rules', () => {
});
});

it('uses dnsCache', () => {
hostRules.add({ dnsCache: true });

const opts = { ...options, token: 'xxx' };
const hostRule = findMatchingRule(url, opts);
expect(hostRule).toEqual({
dnsCache: true,
token: 'token',
});
expect(applyHostRule(url, opts, hostRule)).toMatchObject({
hostType: 'github',
lookup: dnsLookup,
token: 'xxx',
});
});

it('uses http keep-alive', () => {
hostRules.add({ keepAlive: true });

Expand Down
5 changes: 0 additions & 5 deletions lib/util/http/host-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import type { HostRule } from '../../types';
import * as hostRules from '../host-rules';
import { matchRegexOrGlobList } from '../string-match';
import { parseUrl } from '../url';
import { dnsLookup } from './dns';
import { keepAliveAgents } from './keep-alive';
import type { GotOptions, InternalHttpOptions } from './types';

Expand Down Expand Up @@ -161,10 +160,6 @@ export function applyHostRule<GotOptions extends HostRulesGotOptions>(
options.timeout = hostRule.timeout;
}

if (hostRule.dnsCache) {
options.lookup = dnsLookup;
}

if (hostRule.headers) {
const allowedHeaders = GlobalConfig.get('allowedHeaders', []);
const filteredHeaders: Record<string, string> = {};
Expand Down
3 changes: 0 additions & 3 deletions lib/workers/repository/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { removeDanglingContainers } from '../../util/exec/docker';
import { deleteLocalFile, privateCacheDir } from '../../util/fs';
import { isCloned } from '../../util/git';
import { detectSemanticCommits } from '../../util/git/semantic';
import { clearDnsCache, printDnsStats } from '../../util/http/dns';
import * as queue from '../../util/http/queue';
import * as throttle from '../../util/http/throttle';
import { addSplit, getSplits, splitInit } from '../../util/split';
Expand Down Expand Up @@ -138,8 +137,6 @@ export async function renovateRepository(
HttpStats.report();
HttpCacheStats.report();
LookupStats.report();
printDnsStats();
clearDnsCache();
const cloned = isCloned();
logger.info({ cloned, durationMs: splits.total }, 'Repository finished');
resetRepositoryLogLevelRemaps();
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@
"azure-devops-node-api": "14.0.1",
"bunyan": "1.8.15",
"cacache": "18.0.4",
"cacheable-lookup": "5.0.4",
"chalk": "4.1.2",
"changelog-filename-regex": "2.0.1",
"clean-git-ref": "2.0.1",
Expand Down Expand Up @@ -213,7 +212,6 @@
"jsonata": "2.0.5",
"jsonc-parser": "3.3.1",
"klona": "2.0.6",
"lru-cache": "10.4.3",
"luxon": "3.4.4",
"markdown-it": "14.1.0",
"markdown-table": "2.0.0",
Expand Down
22 changes: 5 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 79f7463

Please sign in to comment.