Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/config/presets/github/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import is from '@sindresorhus/is';
import { logger } from '../../../logger';
import { ExternalHostError } from '../../../types/errors/external-host-error';
import { memCacheProvider } from '../../../util/http/cache/memory-http-cache-provider';
import { GithubHttp } from '../../../util/http/github';
import { fromBase64 } from '../../../util/string';
import type { Preset, PresetConfig } from '../types';
Expand All @@ -24,7 +25,9 @@ export async function fetchJSONFile(
logger.trace({ url }, `Preset URL`);
let res: { body: { content: string } };
try {
res = await http.getJsonUnchecked(url);
res = await http.getJsonUnchecked(url, {
cacheProvider: memCacheProvider,
});
} catch (err) {
if (err instanceof ExternalHostError) {
throw err;
Expand Down
3 changes: 2 additions & 1 deletion lib/config/presets/http/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { logger } from '../../../logger';
import { ExternalHostError } from '../../../types/errors/external-host-error';
import { Http } from '../../../util/http';
import { memCacheProvider } from '../../../util/http/cache/memory-http-cache-provider';
import type { HttpResponse } from '../../../util/http/types';
import { parseUrl } from '../../../util/url';
import type { Preset, PresetConfig } from '../types';
Expand All @@ -20,7 +21,7 @@ export async function getPreset({
}

try {
response = await http.getText(url);
response = await http.getText(url, { cacheProvider: memCacheProvider });
} catch (err) {
if (err instanceof ExternalHostError) {
throw err;
Expand Down
7 changes: 6 additions & 1 deletion lib/config/presets/npm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {
NpmResponseVersion,
} from '../../../modules/datasource/npm/types';
import { Http } from '../../../util/http';
import { memCacheProvider } from '../../../util/http/cache/memory-http-cache-provider';
import type { Preset, PresetConfig } from '../types';
import {
PRESET_DEP_NOT_FOUND,
Expand All @@ -31,7 +32,11 @@ export async function getPreset({
'Using npm packages for Renovate presets is now deprecated. Please migrate to repository-based presets instead.',
);
const packageUrl = resolvePackageUrl(registryUrl, pkg);
const body = (await http.getJsonUnchecked<NpmResponse>(packageUrl)).body;
const body = (
await http.getJsonUnchecked<NpmResponse>(packageUrl, {
cacheProvider: memCacheProvider,
})
).body;
// TODO: check null #22198
dep = body.versions![body['dist-tags']!.latest];
} catch {
Expand Down
2 changes: 2 additions & 0 deletions lib/modules/datasource/docker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { logger } from '../../../logger';
import { ExternalHostError } from '../../../types/errors/external-host-error';
import { cache } from '../../../util/cache/package/decorator';
import { HttpError } from '../../../util/http';
import { memCacheProvider } from '../../../util/http/cache/memory-http-cache-provider';
import type { HttpResponse } from '../../../util/http/types';
import { hasKey } from '../../../util/object';
import { regEx } from '../../../util/regex';
Expand Down Expand Up @@ -123,6 +124,7 @@ export class DockerDatasource extends Datasource {
const manifestResponse = await this.http[mode](url, {
headers,
noAuth: true,
cacheProvider: memCacheProvider,
});
return manifestResponse;
} catch (err) /* istanbul ignore next */ {
Expand Down
5 changes: 4 additions & 1 deletion lib/modules/datasource/github-tags/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { queryReleases, queryTags } from '../../../util/github/graphql';
import type { GithubReleaseItem } from '../../../util/github/graphql/types';
import { findCommitOfTag } from '../../../util/github/tags';
import { getApiBaseUrl, getSourceUrl } from '../../../util/github/url';
import { memCacheProvider } from '../../../util/http/cache/memory-http-cache-provider';
import { GithubHttp } from '../../../util/http/github';
import { Datasource } from '../datasource';
import type {
Expand Down Expand Up @@ -43,7 +44,9 @@ export class GithubTagsDatasource extends Datasource {
let digest: string | null = null;
try {
const url = `${apiBaseUrl}repos/${githubRepo}/commits?per_page=1`;
const res = await this.http.getJsonUnchecked<{ sha: string }[]>(url);
const res = await this.http.getJsonUnchecked<{ sha: string }[]>(url, {
cacheProvider: memCacheProvider,
});
digest = res.body[0].sha;
} catch (err) {
logger.debug(
Expand Down
4 changes: 3 additions & 1 deletion lib/modules/datasource/nuget/v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ export class NugetV3Api {
// TODO: types (#22198)
latestStable
}/${pkgName.toLowerCase()}.nuspec`;
const metaresult = await http.getText(nuspecUrl);
const metaresult = await http.getText(nuspecUrl, {
cacheProvider: memCacheProvider,
});
const nuspec = new XmlDocument(metaresult.body);
const sourceUrl = nuspec.valueWithPath('metadata.repository@url');
if (sourceUrl) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
"lint-staged": "15.5.1",
"markdownlint-cli2": "0.17.2",
"memfs": "4.17.0",
"nock": "14.0.3",
"nock": "14.0.4",
"npm-run-all2": "7.0.2",
"nyc": "17.1.0",
"rimraf": "6.0.1",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

Loading