Skip to content

Commit cafc096

Browse files
committed
Remove quality-queries input
1 parent 7deb0a1 commit cafc096

File tree

4 files changed

+13
-30
lines changed

4 files changed

+13
-30
lines changed

init/action.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ inputs:
9999
queries:
100100
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.
101101
required: false
102-
quality-queries:
103-
description: '[Internal] DEPRECATED. Comma-separated list of code quality queries to run.'
104-
required: false
105102
packs:
106103
description: >-
107104
Comma-separated list of packs to run. Reference a pack in the format `scope/name[@version]`. If `version` is not

lib/init-action.js

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyses.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ test("getAnalysisKinds - returns expected analysis kinds for `analysis-kinds` in
5252
t.assert(result.includes(AnalysisKind.CodeQuality));
5353
});
5454

55-
test("getAnalysisKinds - includes `code-quality` when deprecated `quality-queries` input is used", async (t) => {
55+
test("getAnalysisKinds - throws ConfigurationError when deprecated `quality-queries` input is used", async (t) => {
5656
const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
5757
requiredInputStub.withArgs("analysis-kinds").returns("code-scanning");
5858
const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
5959
optionalInputStub.withArgs("quality-queries").returns("code-quality");
60-
const result = await getAnalysisKinds(getRunnerLogger(true), true);
61-
t.assert(result.includes(AnalysisKind.CodeScanning));
62-
t.assert(result.includes(AnalysisKind.CodeQuality));
60+
61+
await t.throwsAsync(getAnalysisKinds(getRunnerLogger(true), true), {
62+
instanceOf: ConfigurationError,
63+
});
6364
});
6465

6566
test("getAnalysisKinds - throws if `analysis-kinds` input is invalid", async (t) => {

src/analyses.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,16 @@ let cachedAnalysisKinds: AnalysisKind[] | undefined;
5050

5151
/**
5252
* Initialises the analysis kinds for the analysis based on the `analysis-kinds` input.
53-
* This function will also use the deprecated `quality-queries` input as an indicator to enable `code-quality`.
5453
* If the `analysis-kinds` input cannot be parsed, a `ConfigurationError` is thrown.
5554
*
56-
* @param logger The logger to use.
55+
* @param _logger The logger to use.
5756
* @param skipCache For testing, whether to ignore the cached values (default: false).
5857
*
5958
* @returns The array of enabled analysis kinds.
6059
* @throws A `ConfigurationError` if the `analysis-kinds` input cannot be parsed.
6160
*/
6261
export async function getAnalysisKinds(
63-
logger: Logger,
62+
_logger: Logger,
6463
skipCache: boolean = false,
6564
): Promise<AnalysisKind[]> {
6665
if (!skipCache && cachedAnalysisKinds !== undefined) {
@@ -71,26 +70,15 @@ export async function getAnalysisKinds(
7170
getRequiredInput("analysis-kinds"),
7271
);
7372

74-
// Warn that `quality-queries` is deprecated if there is an argument for it.
73+
// Throw if there is an argument for `quality-queries`.
7574
const qualityQueriesInput = getOptionalInput("quality-queries");
7675

7776
if (qualityQueriesInput !== undefined) {
78-
logger.warning(
79-
"The `quality-queries` input is deprecated and will be removed in a future version of the CodeQL Action. " +
80-
"Use the `analysis-kinds` input to configure different analysis kinds instead.",
77+
throw new ConfigurationError(
78+
"The `quality-queries` input is no longer supported. Use `analysis-kinds` instead.",
8179
);
8280
}
8381

84-
// For backwards compatibility, add Code Quality to the enabled analysis kinds
85-
// if an input to `quality-queries` was specified. We should remove this once
86-
// `quality-queries` is no longer used.
87-
if (
88-
!cachedAnalysisKinds.includes(AnalysisKind.CodeQuality) &&
89-
qualityQueriesInput !== undefined
90-
) {
91-
cachedAnalysisKinds.push(AnalysisKind.CodeQuality);
92-
}
93-
9482
return cachedAnalysisKinds;
9583
}
9684

0 commit comments

Comments
 (0)