no longer filtering to well-known database sources (#22864)

This commit is contained in:
Benjin Dubishar
2023-04-26 13:31:15 -07:00
committed by GitHub
parent abff6a0a34
commit 62255fe4dd
5 changed files with 8 additions and 50 deletions

View File

@@ -635,36 +635,6 @@ export function getFoldersAlongPath(startFolder: string, endFolder: string): str
return folders;
}
/**
* Determines whether provided value is a well-known database source and therefore is allowed to be sent in telemetry.
*
* @param value Value to check if it is a well-known database source
* @returns Normalized database source value if it is well-known, otherwise returns undefined
*/
export function getWellKnownDatabaseSource(value: string): string | undefined {
const upperCaseValue = value.toUpperCase();
return constants.WellKnownDatabaseSources
.find(wellKnownSource => wellKnownSource.toUpperCase() === upperCaseValue);
}
/**
* Filters an array of specified database project sources to only those that are well-known.
*
* @param databaseSourceValues Array of database source values to filter
* @returns Array of well-known database sources
*/
export function getWellKnownDatabaseSources(databaseSourceValues: string[]): string[] {
const databaseSourceSet = new Set<string>();
for (let databaseSourceValue of databaseSourceValues) {
const wellKnownDatabaseSourceValue = getWellKnownDatabaseSource(databaseSourceValue);
if (wellKnownDatabaseSourceValue) {
databaseSourceSet.add(wellKnownDatabaseSourceValue);
}
}
return Array.from(databaseSourceSet);
}
/**
* Returns SQL version number from docker image name which is in the beginning of the image name
* @param imageName docker image name