Skip to content

Commit

Permalink
chore: update types reference
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Aug 15, 2023
1 parent 52d942d commit 36e2b32
Show file tree
Hide file tree
Showing 197 changed files with 412 additions and 412 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ module.exports = {

// TODO: fix lint
'@typescript-eslint/no-explicit-any': 0,
// TODO: https://github.com/renovatebot/renovate/issues/7154
// TODO: https://github.com/renovatebot/renovate/discussions/22198
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-unused-vars': [
2,
Expand Down
2 changes: 1 addition & 1 deletion lib/config/decrypt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('config/decrypt', () => {
},
'backend/package.json',
];
// TODO: fix types #7154
// TODO: fix types #22198
const res = (await decryptConfig(config, repository)) as any;
expect(res.encrypted).toBeUndefined();
expect(res.packageFiles[0].devDependencies.encrypted).toBeUndefined();
Expand Down
2 changes: 1 addition & 1 deletion lib/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function getManagerConfig(
if (categories) {
managerConfig.categories = categories;
}
// TODO: fix types #7154
// TODO: fix types #22198
managerConfig = mergeChildConfig(managerConfig, config[manager] as any);
for (const i of getManagerList()) {
delete managerConfig[i];
Expand Down
2 changes: 1 addition & 1 deletion lib/config/migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ describe('config/migration', () => {
expect(isMigrated).toBeTrue();
expect(migratedConfig).toMatchSnapshot();
expect(migratedConfig.lockFileMaintenance?.packageRules).toHaveLength(1);
// TODO: fix types #7154
// TODO: fix types #22198
expect(
(migratedConfig.lockFileMaintenance as RenovateConfig)
?.packageRules?.[0].respectLatest
Expand Down
2 changes: 1 addition & 1 deletion lib/config/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function migrateConfig(config: RenovateConfig): MigratedConfig {
logger.debug('Flattening nested packageRules');
// merge each subrule and add to the parent list
for (const subrule of packageRule.packageRules) {
// TODO: fix types #7154
// TODO: fix types #22198
const combinedRule = mergeChildConfig(
packageRule,
subrule as PackageRule
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/gitea/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function fetchJSONFile(
throw new Error(PRESET_DEP_NOT_FOUND);
}

// TODO: null check #7154
// TODO: null check #22198
return parsePreset(fromBase64(res.content!));
}

Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function replaceArgs(
): Record<string, any>[];

/**
* TODO: fix me #7154
* TODO: fix me #22198
* @param obj
* @param argMapping
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/local/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function getPreset({
repo,
presetName,
presetPath,
// TODO: fix type #7154
// TODO: fix type #22198
endpoint!,
tag
);
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/npm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function getPreset({
);
const packageUrl = resolvePackageUrl(registryUrl, pkg);
const body = (await http.getJson<NpmResponse>(packageUrl)).body;
// TODO: check null #7154
// TODO: check null #22198
dep = body.versions![body['dist-tags']!.latest];
} catch (err) {
throw new Error(PRESET_DEP_NOT_FOUND);
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function fetchPreset({
tag,
fetch,
}: FetchPresetConfig): Promise<Preset | undefined> {
// TODO: fix me, can be undefiend #7154
// TODO: fix me, can be undefiend #22198
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
const endpoint = ensureTrailingSlash(_endpoint!);
const [fileName, presetName, subPresetName] = filePreset.split('/');
Expand Down
2 changes: 1 addition & 1 deletion lib/config/secrets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('config/secrets', () => {
secrets: { SECRET_MANAGER: 'npm' },
allowedManagers: ['{{ secrets.SECRET_MANAGER }}'],
};
// TODO fix me? #7154
// TODO fix me? #22198
expect(() => applySecretsToConfig(config, null as never, false)).toThrow(
CONFIG_VALIDATION
);
Expand Down
8 changes: 4 additions & 4 deletions lib/config/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export async function validateConfig(
];
if ((key.endsWith('Template') || templateKeys.includes(key)) && val) {
try {
// TODO: validate string #7154
// TODO: validate string #22198
let res = template.compile((val as string).toString(), config, false);
res = template.compile(res, config, false);
template.compile(res, config, false);
Expand All @@ -188,7 +188,7 @@ export async function validateConfig(
optionParents[key] &&
optionParents[key] !== parentName
) {
// TODO: types (#7154)
// TODO: types (#22198)
const message = `${key} should only be configured within a "${optionParents[key]}" object. Was found in ${parentName}`;
warnings.push({
topic: `${parentPath ? `${parentPath}.` : ''}${key}`,
Expand Down Expand Up @@ -415,7 +415,7 @@ export async function validateConfig(
'autoReplaceStringTemplate',
'depTypeTemplate',
];
// TODO: fix types #7154
// TODO: fix types #22198
for (const regexManager of val as any[]) {
if (
Object.keys(regexManager).some(
Expand Down Expand Up @@ -532,7 +532,7 @@ export async function validateConfig(
(selectors.includes(key) ||
key === 'matchCurrentVersion' ||
key === 'matchCurrentValue') &&
// TODO: can be undefined ? #7154
// TODO: can be undefined ? #22198
!rulesRe.test(parentPath!) && // Inside a packageRule
(is.string(parentPath) || !isPreset) // top level in a preset
) {
Expand Down
2 changes: 1 addition & 1 deletion lib/logger/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('logger/utils', () => {
// Mock when the function exits
const mockExit = jest.spyOn(process, 'exit');
mockExit.mockImplementationOnce((number) => {
// TODO: types (#7154)
// TODO: types (#22198)
throw new Error(`process.exit: ${number}`);
});
expect(() => {
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/artifactory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class ArtifactoryDatasource extends Datasource {
@cache({
namespace: `datasource-${datasource}`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
// TODO: types (#7154)
// TODO: types (#22198)
`${registryUrl}:${packageName}`,
})
async getReleases({
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/datasource/conan/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class ConanDatasource extends Datasource {
@cache({
namespace: `datasource-${datasource}-revisions`,
key: ({ registryUrl, packageName }: DigestConfig, newValue?: string) =>
// TODO: types (#7154)
// TODO: types (#22198)
`${registryUrl!}:${packageName}:${newValue!}`,
})
override async getDigest(
Expand Down Expand Up @@ -101,7 +101,7 @@ export class ConanDatasource extends Datasource {
@cache({
namespace: `datasource-${datasource}`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
// TODO: types (#7154)
// TODO: types (#22198)
`${registryUrl}:${packageName}`,
})
async getReleases({
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/conda/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class CondaDatasource extends Datasource {
@cache({
namespace: `datasource-${datasource}`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
// TODO: types (#7154)
// TODO: types (#22198)
`${registryUrl}:${packageName}`,
})
async getReleases({
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/crate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class CrateDatasource extends Datasource {
@cache({
namespace: `datasource-${CrateDatasource.id}`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
// TODO: types (#7154)
// TODO: types (#22198)
`${registryUrl}/${packageName}`,
cacheable: ({ registryUrl }: GetReleasesConfig) =>
CrateDatasource.areReleasesCacheable(registryUrl),
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/deno/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class DenoDatasource extends Datasource {
@cache({
namespace: `datasource-${DenoDatasource.id}`,
key: ({ packageName, registryUrl }: GetReleasesConfig) =>
// TODO: types (#7154)
// TODO: types (#22198)
`${registryUrl}:${packageName}`,
})
async getReleases({
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/datasource/docker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ export class DockerDatasource extends Datasource {
registryUrl!
);
logger.debug(
// TODO: types (#7154)
// TODO: types (#22198)
`getDigest(${registryHost}, ${dockerRepository}, ${newValue})`
);
const newTag = newValue ?? 'latest';
Expand Down Expand Up @@ -800,7 +800,7 @@ export class DockerDatasource extends Datasource {
}

if (manifestResponse) {
// TODO: fix types (#7154)
// TODO: fix types (#22198)
logger.debug(`Got docker digest ${digest!}`);
}
} catch (err) /* istanbul ignore next */ {
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/endoflife-date/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class EndoflifeDatePackagesource extends Datasource {
@cache({
namespace: `datasource-${datasource}`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
// TODO: types (#7154)
// TODO: types (#22198)
`${registryUrl!}:${packageName}`,
})
async getReleases({
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/galaxy-collection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class GalaxyCollectionDatasource extends Datasource {
}: GetReleasesConfig): Promise<ReleaseResult | null> {
const [namespace, projectName] = packageName.split('.');

// TODO: types (#7154)
// TODO: types (#22198)
const baseUrl = `${registryUrl}api/v2/collections/${namespace}/${projectName}/`;

let baseUrlResponse: HttpResponse<BaseProjectResult>;
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/galaxy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class GalaxyDatasource extends Datasource {
const userName = lookUp[0];
const projectName = lookUp[1];

// TODO: types (#7154)
// TODO: types (#22198)
const galaxyAPIUrl = `${registryUrl}api/v1/roles/?owner__username=${userName}&name=${projectName}`;
const galaxyProjectUrl = `${registryUrl}${userName}/${projectName}`;

Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/gitlab-packages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class GitlabPackagesDatasource extends Datasource {
@cache({
namespace: `datasource-${datasource}`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
// TODO: types (#7154)
// TODO: types (#22198)
`${registryUrl}-${packageName}`,
})
async getReleases({
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/gitlab-releases/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class GitlabReleasesDatasource extends Datasource {
@cache({
namespace: `datasource-${GitlabReleasesDatasource.id}`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
// TODO: types (#7154)
// TODO: types (#22198)
`${registryUrl}/${packageName}`,
})
async getReleases({
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/go/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// TODO: types (#7154)
// TODO: types (#22198)
import URL from 'node:url';
import { logger } from '../../../logger';
import { detectPlatform } from '../../../util/common';
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/go/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class GoDatasource extends Datasource {
);
@cache({
namespace: `datasource-${GoDatasource.id}`,
// TODO: types (#7154)
// TODO: types (#22198)
key: ({ packageName }: Partial<DigestConfig>) => `${packageName}-digest`,
})
getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/go/releases-goproxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export class GoProxyDatasource extends Datasource {
static getCacheKey({ packageName }: GetReleasesConfig): string {
const goproxy = process.env.GOPROXY;
const noproxy = GoProxyDatasource.parseNoproxy();
// TODO: types (#7154)
// TODO: types (#22198)
return `${packageName}@@${goproxy}@@${noproxy?.toString()}`;
}
}
2 changes: 1 addition & 1 deletion lib/modules/datasource/gradle-version/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class GradleVersionDatasource extends Datasource {

@cache({
namespace: `datasource-${GradleVersionDatasource.id}`,
// TODO: types (#7154)
// TODO: types (#22198)
key: ({ registryUrl }: GetReleasesConfig) => `${registryUrl}`,
})
async getReleases({
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/datasource/helm/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('modules/datasource/helm/index', () => {
expect(
await getPkgReleases({
datasource: HelmDatasource.id,
packageName: undefined as never, // #7154
packageName: undefined as never, // #22198
registryUrls: ['https://example-repository.com'],
})
).toBeNull();
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/datasource/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ describe('modules/datasource/index', () => {
it('returns null for null datasource', async () => {
expect(
await getPkgReleases({
datasource: null as never, // #7154
datasource: null as never, // #22198
packageName: 'some/dep',
})
).toBeNull();
Expand All @@ -182,7 +182,7 @@ describe('modules/datasource/index', () => {
expect(
await getPkgReleases({
datasource,
packageName: null as never, // #7154
packageName: null as never, // #22198
})
).toBeNull();
});
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/datasource/java-version/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class JavaVersionDatasource extends Datasource {
@cache({
namespace: `datasource-${datasource}`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
// TODO: types (#7154)
// TODO: types (#22198)
`${registryUrl!}:${getImageType(packageName)}`,
})
async getReleases({
Expand All @@ -66,7 +66,7 @@ export class JavaVersionDatasource extends Datasource {
{ registryUrl, packageName, imageType },
'fetching java release'
);
// TODO: types (#7154)
// TODO: types (#22198)
const url = `${registryUrl!}v3/info/release_versions?page_size=${pageSize}&image_type=${imageType}&project=jdk&release_type=ga&sort_method=DATE&sort_order=DESC`;

const result: ReleaseResult = {
Expand Down
12 changes: 6 additions & 6 deletions lib/modules/datasource/maven/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ describe('modules/datasource/maven/util', () => {
describe('downloadMavenXml', () => {
it('returns empty object for unsupported protocols', async () => {
const res = await downloadMavenXml(
null as never, // #7154
null as never, // #22198
parseUrl('unsupported://server.com/')
);
expect(res).toEqual({});
});

it('returns empty object for invalid URLs', async () => {
const res = await downloadMavenXml(
null as never, // #7154
null as never, // #22198
null
);
expect(res).toEqual({});
Expand All @@ -31,7 +31,7 @@ describe('modules/datasource/maven/util', () => {

describe('downloadS3Protocol', () => {
it('returns null for non-S3 URLs', async () => {
// #7154
// #22198
const res = await downloadS3Protocol(parseUrl('http://not-s3.com/')!);
expect(res).toBeNull();
});
Expand Down Expand Up @@ -82,15 +82,15 @@ describe('modules/datasource/maven/util', () => {
describe('checkResource', () => {
it('returns not found for unsupported protocols', async () => {
const res = await checkResource(
null as never, // #7154
null as never, // #22198
'unsupported://server.com/'
);
expect(res).toBe('not-found');
});

it('returns error for invalid URLs', async () => {
const res = await checkResource(
null as never, // #7154
null as never, // #22198
'not-a-valid-url'
);
expect(res).toBe('error');
Expand All @@ -99,7 +99,7 @@ describe('modules/datasource/maven/util', () => {

describe('checkS3Resource', () => {
it('returns error for non-S3 URLs', async () => {
// #7154
// #22198
const res = await checkS3Resource(parseUrl('http://not-s3.com/')!);
expect(res).toBe('error');
});
Expand Down
Loading

0 comments on commit 36e2b32

Please sign in to comment.