Skip to content

Commit

Permalink
refactor: Replace some TODO items with issue ids (#9596)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Apr 26, 2021
1 parent fb50312 commit 38620be
Show file tree
Hide file tree
Showing 40 changed files with 75 additions and 68 deletions.
2 changes: 1 addition & 1 deletion lib/config/admin.ts
Expand Up @@ -2,7 +2,7 @@ import type { RenovateConfig, RepoAdminConfig } from './types';

let adminConfig: RepoAdminConfig = {};

// TODO: once admin config work is complete, add a test to make sure this list includes all options with admin=true
// TODO: once admin config work is complete, add a test to make sure this list includes all options with admin=true (#9603)
export const repoAdminOptions = [
'allowCustomCrateRegistries',
'allowPostUpgradeCommandTemplating',
Expand Down
2 changes: 1 addition & 1 deletion lib/config/migration.ts
Expand Up @@ -46,7 +46,7 @@ interface MigratedRenovateConfig extends RenovateConfig {
// Returns a migrated config
export function migrateConfig(
config: RenovateConfig,
// TODO: remove any type
// TODO: remove any type (#9611)
parentKey?: string | any
): MigratedConfig {
try {
Expand Down
8 changes: 4 additions & 4 deletions lib/datasource/docker/index.ts
Expand Up @@ -16,8 +16,8 @@ import * as dockerVersioning from '../../versioning/docker';
import type { GetReleasesConfig, ReleaseResult } from '../types';
import { Image, ImageList, MediaType } from './types';

// TODO: add got typings when available
// TODO: replace www-authenticate with https://www.npmjs.com/package/auth-header ?
// TODO: add got typings when available (#9646)
// TODO: replace www-authenticate with https://www.npmjs.com/package/auth-header (#9645)

export const id = 'docker';
export const customRegistrySupport = true;
Expand Down Expand Up @@ -198,7 +198,7 @@ async function getAuthHeaders(
};
} catch (err) /* istanbul ignore next */ {
if (err.host === 'quay.io') {
// TODO: debug why quay throws errors
// TODO: debug why quay throws errors (#9604)
return null;
}
if (err.statusCode === 401) {
Expand Down Expand Up @@ -251,7 +251,7 @@ function extractDigestFromResponse(manifestResponse: HttpResponse): string {
return manifestResponse.headers['docker-content-digest'] as string;
}

// TODO: make generic to return json object
// TODO: debug why quay throws errors (#9612)
async function getManifestResponse(
registry: string,
dockerRepository: string,
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/npm/get.ts
Expand Up @@ -133,7 +133,7 @@ export async function getDependency(
const cacheMinutes = process.env.RENOVATE_CACHE_NPM_MINUTES
? parseInt(process.env.RENOVATE_CACHE_NPM_MINUTES, 10)
: 15;
// TODO: use dynamic detection of public repos instead of a static list
// TODO: use dynamic detection of public repos instead of a static list (#9587)
const whitelistedPublicScopes = [
'@graphql-codegen',
'@storybook',
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/npm/npmrc.ts
Expand Up @@ -36,7 +36,7 @@ function envReplace(value: any, env = process.env): any {
}

const envRe = /(\\*)\$\{([^}]+)\}/;
// TODO: better add to host rules
// TODO: better add to host rules (#9588)
function sanitize(key: string, val: string): void {
if (!val || envRe.test(val)) {
return;
Expand Down
4 changes: 2 additions & 2 deletions lib/datasource/packagist/index.ts
Expand Up @@ -229,7 +229,7 @@ async function packagistOrgLookup(name: string): Promise<ReleaseResult> {
let dep: ReleaseResult = null;
const regUrl = 'https://packagist.org';
const pkgUrl = URL.resolve(regUrl, `/p/${name}.json`);
// TODO: fix types
// TODO: fix types (#9610)
const res = (await http.getJson<any>(pkgUrl)).body.packages[name];
if (res) {
dep = extractDepReleases(res);
Expand Down Expand Up @@ -278,7 +278,7 @@ async function packageLookup(
return null;
}
const opts = getHostOpts(regUrl);
// TODO: fix types
// TODO: fix types (#9610)
const versions = (await http.getJson<any>(pkgUrl, opts)).body.packages[
name
];
Expand Down
2 changes: 1 addition & 1 deletion lib/datasource/terraform-provider/index.ts
Expand Up @@ -70,7 +70,7 @@ async function queryRegistry(
return dep;
}

// TODO: add long term cache
// TODO: add long term cache (#9590)
async function queryReleaseBackend(
lookupName: string,
registryURL: string,
Expand Down
2 changes: 1 addition & 1 deletion lib/logger/index.ts
Expand Up @@ -29,7 +29,7 @@ const stdout: bunyan.Stream = {

// istanbul ignore else: not testable
if (process.env.LOG_FORMAT !== 'json') {
// TODO: typings
// TODO: typings (#9615)
const prettyStdOut = new RenovateStream() as any;
prettyStdOut.pipe(process.stdout);
stdout.stream = prettyStdOut;
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/bazel/extract.ts
Expand Up @@ -242,7 +242,7 @@ export function extractPackageFile(
if (commit) {
dep.currentDigest = commit;
}
// TODO: Check if we really need to use parse here or if it should always be a plain https url
// TODO: Check if we really need to use parse here or if it should always be a plain https url (#9605)
const githubURL = parse(remote);
if (githubURL) {
const repo = githubURL.substring('https://github.com/'.length);
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/docker-compose/extract.ts
Expand Up @@ -46,7 +46,7 @@ export function extractPackageFile(
logger.debug('docker-compose.extractPackageFile()');
let config: DockerComposeConfig;
try {
// TODO: fix me
// TODO: fix me (#9610)
config = safeLoad(content, { json: true }) as unknown;
if (!config) {
logger.debug(
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/gitlabci-include/extract.ts
Expand Up @@ -30,7 +30,7 @@ export function extractPackageFile(
): PackageFile | null {
const deps: PackageDependency[] = [];
try {
// TODO: fix me
// TODO: fix me (#9610)
const doc = yaml.safeLoad(content, { json: true }) as any;
if (doc?.include && is.array(doc.include)) {
for (const includeObj of doc.include) {
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/helm-values/extract.ts
Expand Up @@ -60,7 +60,7 @@ export function extractPackageFile(content: string): PackageFile {
try {
// a parser that allows extracting line numbers would be preferable, with
// the current approach we need to match anything we find again during the update
// TODO: fix me
// TODO: fix me (#9610)
parsedContent = yaml.safeLoad(content, { json: true }) as any;
} catch (err) {
logger.debug({ err }, 'Failed to parse helm-values YAML');
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/helmv3/extract.ts
Expand Up @@ -18,7 +18,7 @@ export async function extractPackageFile(
dependencies: Array<{ name: string; version: string; repository: string }>;
};
try {
// TODO: fix me
// TODO: fix me (#9610)
chart = yaml.safeLoad(content, { json: true }) as any;
if (!(chart?.apiVersion && chart.name && chart.version)) {
logger.debug(
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/homebrew/extract.ts
Expand Up @@ -130,7 +130,7 @@ function extractClassName(content: string): string | null {
return parseClassHeader(i, content);
}

// TODO: Maybe check if quotes/double-quotes are balanced
// TODO: Maybe check if quotes/double-quotes are balanced (#9591)
export function extractPackageFile(content: string): PackageFile | null {
logger.trace('extractPackageFile()');
/*
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/homebrew/update.ts
Expand Up @@ -135,7 +135,7 @@ function updateSha256(
return newContent;
}

// TODO: Refactor
// TODO: Refactor (#9591)
export async function updateDependency({
fileContent,
upgrade,
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/npm/extract/type.ts
Expand Up @@ -11,6 +11,6 @@ export function mightBeABrowserLibrary(packageJson: NpmPackage): boolean {
return false;
}
// TODO: how can we know if it's a node.js library only, and not browser?
// Otherwise play it safe and return true
// Otherwise play it safe and return true (#9616)
return true;
}
2 changes: 1 addition & 1 deletion lib/manager/npm/post-update/yarn.spec.ts
Expand Up @@ -19,7 +19,7 @@ const yarnHelper = mocked(_yarnHelper);

delete process.env.NPM_CONFIG_CACHE;

// TODO: figure out snapshot similarity for each CI platform
// TODO: figure out snapshot similarity for each CI platform (#9617)
const fixSnapshots = (snapshots: ExecSnapshots): ExecSnapshots =>
snapshots.map((snapshot) => ({
...snapshot,
Expand Down
4 changes: 2 additions & 2 deletions lib/manager/pip_setup/index.spec.ts
Expand Up @@ -29,7 +29,7 @@ const pythonVersionCallResults = [
{ stdout: 'Python 3.7.5\\n', stderr: '' },
];

// TODO: figure out snapshot similarity for each CI platform
// TODO: figure out snapshot similarity for each CI platform (#9617)
const fixSnapshots = (snapshots: ExecSnapshots): ExecSnapshots =>
snapshots.map((snapshot) => ({
...snapshot,
Expand Down Expand Up @@ -79,7 +79,7 @@ describe(getName(), () => {
binarySource: BinarySource.Docker,
})
).toMatchSnapshot();
expect(execSnapshots).toHaveLength(1); // TODO: figure out volume arguments in Windows
expect(execSnapshots).toHaveLength(1); // TODO: figure out volume arguments in Windows (#9617)
});

it('returns no deps', async () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/pipenv/extract.ts
Expand Up @@ -126,7 +126,7 @@ export async function extractPackageFile(

let pipfile: PipFile;
try {
// TODO: fix type
// TODO: fix type (#9610)
pipfile = toml.parse(content) as any;
} catch (err) {
logger.debug({ err }, 'Error parsing Pipfile');
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/pub/extract.ts
Expand Up @@ -40,7 +40,7 @@ export function extractPackageFile(
packageFile: string
): PackageFile | null {
try {
// TODO: fix me
// TODO: fix me (#9610)
const doc = safeLoad(content, { json: true }) as any;
const deps = [
...getDeps(doc.dependencies, {
Expand Down
1 change: 0 additions & 1 deletion lib/manager/travis/package.spec.ts
Expand Up @@ -10,7 +10,6 @@ jest.mock('../../datasource');

describe(getName(), () => {
describe('getPackageUpdates', () => {
// TODO: should be `PackageUpdateConfig`
let config: any;
const RealDate = Date;

Expand Down
1 change: 0 additions & 1 deletion lib/manager/travis/package.ts
Expand Up @@ -45,7 +45,6 @@ export async function getPackageUpdates(
}
newValue.sort((a, b) => a - b);

// TODO: `config.currentValue` is a string!
(config.currentValue as any).sort((a, b) => a - b);
if (dequal(config.currentValue, newValue)) {
return { updates: [] };
Expand Down
4 changes: 0 additions & 4 deletions lib/manager/travis/update.spec.ts
Expand Up @@ -6,7 +6,6 @@ const content = loadFixture('travis.yml');
describe(getName(), () => {
describe('updateDependency', () => {
it('updates values', () => {
// TODO: should be `Upgrade`
const upgrade: any = {
currentValue: ['8', '6', '4'],
newValue: '6,8',
Expand All @@ -15,7 +14,6 @@ describe(getName(), () => {
expect(res).toMatchSnapshot();
});
it('falls back to 2 spaces', () => {
// TODO: should be `Upgrade`
const upgrade: any = {
currentValue: [8, 6, 4],
newValue: '6,8',
Expand All @@ -27,7 +25,6 @@ describe(getName(), () => {
expect(res).toMatchSnapshot();
});
it('uses double quotes', () => {
// TODO: should be `Upgrade`
const upgrade: any = {
currentValue: ['6'],
newValue: '6,8',
Expand All @@ -39,7 +36,6 @@ describe(getName(), () => {
expect(res).toMatchSnapshot();
});
it('returns null if error', () => {
// TODO: should be `Upgrade`
const upgrade: any = {
currentValue: [8, 6, 4],
newValue: 6,
Expand Down
1 change: 0 additions & 1 deletion lib/manager/travis/update.ts
Expand Up @@ -20,7 +20,6 @@ export function updateDependency({
quote = '';
}
let newString = `node_js:\n`;
// TODO: `newValue` is a string!
upgrade.newValue.split(',').forEach((version) => {
newString += `${indent}- ${quote}${version}${quote}\n`;
});
Expand Down
4 changes: 2 additions & 2 deletions lib/platform/azure/index.ts
Expand Up @@ -89,7 +89,7 @@ export function initPlatform({
'Init: You must configure an Azure DevOps token, or a username and password'
);
}
// TODO: Add a connection check that endpoint/token combination are valid
// TODO: Add a connection check that endpoint/token combination are valid (#9593)
const res = {
endpoint: ensureTrailingSlash(endpoint),
};
Expand Down Expand Up @@ -703,7 +703,7 @@ export function ensureIssueClosing(): Promise<void> {
/* istanbul ignore next */
export function getIssueList(): Promise<Issue[]> {
logger.debug(`getIssueList()`);
// TODO: Needs implementation
// TODO: Needs implementation (#9592)
return Promise.resolve([]);
}

Expand Down

0 comments on commit 38620be

Please sign in to comment.