mirror of
https://github.com/github/codeql-action.git
synced 2026-05-08 14:50:21 +00:00
Remove quality-queries input
This commit is contained in:
@@ -99,9 +99,6 @@ inputs:
|
||||
queries:
|
||||
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
|
||||
required: false
|
||||
quality-queries:
|
||||
description: '[Internal] DEPRECATED. Comma-separated list of code quality queries to run.'
|
||||
required: false
|
||||
packs:
|
||||
description: >-
|
||||
Comma-separated list of packs to run. Reference a pack in the format `scope/name[@version]`. If `version` is not
|
||||
|
||||
Generated
+3
-6
@@ -102359,7 +102359,7 @@ async function parseAnalysisKinds(input) {
|
||||
);
|
||||
}
|
||||
var cachedAnalysisKinds;
|
||||
async function getAnalysisKinds(logger, skipCache = false) {
|
||||
async function getAnalysisKinds(_logger, skipCache = false) {
|
||||
if (!skipCache && cachedAnalysisKinds !== void 0) {
|
||||
return cachedAnalysisKinds;
|
||||
}
|
||||
@@ -102368,13 +102368,10 @@ async function getAnalysisKinds(logger, skipCache = false) {
|
||||
);
|
||||
const qualityQueriesInput = getOptionalInput("quality-queries");
|
||||
if (qualityQueriesInput !== void 0) {
|
||||
logger.warning(
|
||||
"The `quality-queries` input is deprecated and will be removed in a future version of the CodeQL Action. Use the `analysis-kinds` input to configure different analysis kinds instead."
|
||||
throw new ConfigurationError(
|
||||
"The `quality-queries` input is no longer supported. Use `analysis-kinds` instead."
|
||||
);
|
||||
}
|
||||
if (!cachedAnalysisKinds.includes("code-quality" /* CodeQuality */) && qualityQueriesInput !== void 0) {
|
||||
cachedAnalysisKinds.push("code-quality" /* CodeQuality */);
|
||||
}
|
||||
return cachedAnalysisKinds;
|
||||
}
|
||||
var codeQualityQueries = ["code-quality"];
|
||||
|
||||
@@ -52,14 +52,15 @@ test("getAnalysisKinds - returns expected analysis kinds for `analysis-kinds` in
|
||||
t.assert(result.includes(AnalysisKind.CodeQuality));
|
||||
});
|
||||
|
||||
test("getAnalysisKinds - includes `code-quality` when deprecated `quality-queries` input is used", async (t) => {
|
||||
test("getAnalysisKinds - throws ConfigurationError when deprecated `quality-queries` input is used", async (t) => {
|
||||
const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
|
||||
requiredInputStub.withArgs("analysis-kinds").returns("code-scanning");
|
||||
const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
||||
optionalInputStub.withArgs("quality-queries").returns("code-quality");
|
||||
const result = await getAnalysisKinds(getRunnerLogger(true), true);
|
||||
t.assert(result.includes(AnalysisKind.CodeScanning));
|
||||
t.assert(result.includes(AnalysisKind.CodeQuality));
|
||||
|
||||
await t.throwsAsync(getAnalysisKinds(getRunnerLogger(true), true), {
|
||||
instanceOf: ConfigurationError,
|
||||
});
|
||||
});
|
||||
|
||||
test("getAnalysisKinds - throws if `analysis-kinds` input is invalid", async (t) => {
|
||||
|
||||
+5
-17
@@ -50,17 +50,16 @@ let cachedAnalysisKinds: AnalysisKind[] | undefined;
|
||||
|
||||
/**
|
||||
* Initialises the analysis kinds for the analysis based on the `analysis-kinds` input.
|
||||
* This function will also use the deprecated `quality-queries` input as an indicator to enable `code-quality`.
|
||||
* If the `analysis-kinds` input cannot be parsed, a `ConfigurationError` is thrown.
|
||||
*
|
||||
* @param logger The logger to use.
|
||||
* @param _logger The logger to use.
|
||||
* @param skipCache For testing, whether to ignore the cached values (default: false).
|
||||
*
|
||||
* @returns The array of enabled analysis kinds.
|
||||
* @throws A `ConfigurationError` if the `analysis-kinds` input cannot be parsed.
|
||||
*/
|
||||
export async function getAnalysisKinds(
|
||||
logger: Logger,
|
||||
_logger: Logger,
|
||||
skipCache: boolean = false,
|
||||
): Promise<AnalysisKind[]> {
|
||||
if (!skipCache && cachedAnalysisKinds !== undefined) {
|
||||
@@ -71,26 +70,15 @@ export async function getAnalysisKinds(
|
||||
getRequiredInput("analysis-kinds"),
|
||||
);
|
||||
|
||||
// Warn that `quality-queries` is deprecated if there is an argument for it.
|
||||
// Throw if there is an argument for `quality-queries`.
|
||||
const qualityQueriesInput = getOptionalInput("quality-queries");
|
||||
|
||||
if (qualityQueriesInput !== undefined) {
|
||||
logger.warning(
|
||||
"The `quality-queries` input is deprecated and will be removed in a future version of the CodeQL Action. " +
|
||||
"Use the `analysis-kinds` input to configure different analysis kinds instead.",
|
||||
throw new ConfigurationError(
|
||||
"The `quality-queries` input is no longer supported. Use `analysis-kinds` instead.",
|
||||
);
|
||||
}
|
||||
|
||||
// For backwards compatibility, add Code Quality to the enabled analysis kinds
|
||||
// if an input to `quality-queries` was specified. We should remove this once
|
||||
// `quality-queries` is no longer used.
|
||||
if (
|
||||
!cachedAnalysisKinds.includes(AnalysisKind.CodeQuality) &&
|
||||
qualityQueriesInput !== undefined
|
||||
) {
|
||||
cachedAnalysisKinds.push(AnalysisKind.CodeQuality);
|
||||
}
|
||||
|
||||
return cachedAnalysisKinds;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user