Skip to content

Commit 70730a0

Browse files
committed
Stop propagating quality-queries input
1 parent c779590 commit 70730a0

File tree

6 files changed

+19
-108
lines changed

6 files changed

+19
-108
lines changed

lib/config-utils.js

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

lib/config-utils.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.test.js

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

lib/config-utils.test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-utils.test.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -763,15 +763,13 @@ const calculateAugmentationMacro = test.macro({
763763
_title: string,
764764
rawPacksInput: string | undefined,
765765
rawQueriesInput: string | undefined,
766-
rawQualityQueriesInput: string | undefined,
767766
languages: Language[],
768767
expectedAugmentationProperties: configUtils.AugmentationProperties,
769768
) => {
770769
const actualAugmentationProperties =
771770
await configUtils.calculateAugmentation(
772771
rawPacksInput,
773772
rawQueriesInput,
774-
rawQualityQueriesInput,
775773
languages,
776774
);
777775
t.deepEqual(actualAugmentationProperties, expectedAugmentationProperties);
@@ -784,7 +782,6 @@ test(
784782
"All empty",
785783
undefined,
786784
undefined,
787-
undefined,
788785
[KnownLanguage.javascript],
789786
{
790787
...configUtils.defaultAugmentationProperties,
@@ -796,7 +793,6 @@ test(
796793
"With queries",
797794
undefined,
798795
" a, b , c, d",
799-
undefined,
800796
[KnownLanguage.javascript],
801797
{
802798
...configUtils.defaultAugmentationProperties,
@@ -809,7 +805,6 @@ test(
809805
"With queries combining",
810806
undefined,
811807
" + a, b , c, d ",
812-
undefined,
813808
[KnownLanguage.javascript],
814809
{
815810
...configUtils.defaultAugmentationProperties,
@@ -818,49 +813,11 @@ test(
818813
},
819814
);
820815

821-
test(
822-
calculateAugmentationMacro,
823-
"With quality queries",
824-
undefined,
825-
undefined,
826-
" a, b , c, d",
827-
[KnownLanguage.javascript],
828-
{
829-
...configUtils.defaultAugmentationProperties,
830-
qualityQueriesInput: [
831-
{ uses: "a" },
832-
{ uses: "b" },
833-
{ uses: "c" },
834-
{ uses: "d" },
835-
],
836-
},
837-
);
838-
839-
test(
840-
calculateAugmentationMacro,
841-
"With security and quality queries",
842-
undefined,
843-
" a, b , c, d",
844-
"e, f , g,h",
845-
[KnownLanguage.javascript],
846-
{
847-
...configUtils.defaultAugmentationProperties,
848-
queriesInput: [{ uses: "a" }, { uses: "b" }, { uses: "c" }, { uses: "d" }],
849-
qualityQueriesInput: [
850-
{ uses: "e" },
851-
{ uses: "f" },
852-
{ uses: "g" },
853-
{ uses: "h" },
854-
],
855-
},
856-
);
857-
858816
test(
859817
calculateAugmentationMacro,
860818
"With packs",
861819
" codeql/a , codeql/b , codeql/c , codeql/d ",
862820
undefined,
863-
undefined,
864821
[KnownLanguage.javascript],
865822
{
866823
...configUtils.defaultAugmentationProperties,
@@ -873,7 +830,6 @@ test(
873830
"With packs combining",
874831
" + codeql/a, codeql/b, codeql/c, codeql/d",
875832
undefined,
876-
undefined,
877833
[KnownLanguage.javascript],
878834
{
879835
...configUtils.defaultAugmentationProperties,
@@ -888,7 +844,6 @@ const calculateAugmentationErrorMacro = test.macro({
888844
_title: string,
889845
rawPacksInput: string | undefined,
890846
rawQueriesInput: string | undefined,
891-
rawQualityQueriesInput: string | undefined,
892847
languages: Language[],
893848
expectedError: RegExp | string,
894849
) => {
@@ -897,7 +852,6 @@ const calculateAugmentationErrorMacro = test.macro({
897852
configUtils.calculateAugmentation(
898853
rawPacksInput,
899854
rawQueriesInput,
900-
rawQualityQueriesInput,
901855
languages,
902856
),
903857
{ message: expectedError },
@@ -911,7 +865,6 @@ test(
911865
"Plus (+) with nothing else (queries)",
912866
undefined,
913867
" + ",
914-
undefined,
915868
[KnownLanguage.javascript],
916869
/The workflow property "queries" is invalid/,
917870
);
@@ -921,7 +874,6 @@ test(
921874
"Plus (+) with nothing else (packs)",
922875
" + ",
923876
undefined,
924-
undefined,
925877
[KnownLanguage.javascript],
926878
/The workflow property "packs" is invalid/,
927879
);
@@ -931,7 +883,6 @@ test(
931883
"Packs input with multiple languages",
932884
" + a/b, c/d ",
933885
undefined,
934-
undefined,
935886
[KnownLanguage.javascript, KnownLanguage.java],
936887
/Cannot specify a 'packs' input in a multi-language analysis/,
937888
);
@@ -941,7 +892,6 @@ test(
941892
"Packs input with no languages",
942893
" + a/b, c/d ",
943894
undefined,
944-
undefined,
945895
[],
946896
/No languages specified/,
947897
);
@@ -951,7 +901,6 @@ test(
951901
"Invalid packs",
952902
" a-pack-without-a-scope ",
953903
undefined,
954-
undefined,
955904
[KnownLanguage.javascript],
956905
/"a-pack-without-a-scope" is not a valid pack/,
957906
);

src/config-utils.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,6 @@ export interface AugmentationProperties {
183183
*/
184184
queriesInput?: Array<{ uses: string }>;
185185

186-
/**
187-
* The quality queries input from the `with` block of the action declaration.
188-
*/
189-
qualityQueriesInput?: Array<{ uses: string }>;
190-
191186
/**
192187
* Whether or not the packs input combines with the packs in the config.
193188
*/
@@ -230,7 +225,6 @@ export const defaultAugmentationProperties: AugmentationProperties = {
230225
packsInputCombines: false,
231226
packsInput: undefined,
232227
queriesInput: undefined,
233-
qualityQueriesInput: undefined,
234228
extraQueryExclusions: [],
235229
overlayDatabaseMode: OverlayDatabaseMode.None,
236230
useOverlayDatabaseCaching: false,
@@ -567,7 +561,6 @@ export async function getDefaultConfig({
567561
const augmentationProperties = await calculateAugmentation(
568562
packsInput,
569563
queriesInput,
570-
qualityQueriesInput,
571564
languages,
572565
);
573566

@@ -661,7 +654,6 @@ async function loadUserConfig(
661654
export async function calculateAugmentation(
662655
rawPacksInput: string | undefined,
663656
rawQueriesInput: string | undefined,
664-
rawQualityQueriesInput: string | undefined,
665657
languages: Language[],
666658
): Promise<AugmentationProperties> {
667659
const packsInputCombines = shouldCombine(rawPacksInput);
@@ -676,17 +668,11 @@ export async function calculateAugmentation(
676668
queriesInputCombines,
677669
);
678670

679-
const qualityQueriesInput = parseQueriesFromInput(
680-
rawQualityQueriesInput,
681-
false,
682-
);
683-
684671
return {
685672
packsInputCombines,
686673
packsInput: packsInput?.[languages[0]],
687674
queriesInput,
688675
queriesInputCombines,
689-
qualityQueriesInput,
690676
extraQueryExclusions: [],
691677
overlayDatabaseMode: OverlayDatabaseMode.None,
692678
useOverlayDatabaseCaching: false,
@@ -1499,8 +1485,6 @@ export function isCodeScanningEnabled(config: Config): boolean {
14991485
/**
15001486
* Returns `true` if Code Quality analysis is enabled, or `false` if not.
15011487
*/
1502-
export function isCodeQualityEnabled(config: Config): config is Config & {
1503-
augmentationProperties: { qualityQueriesInput: string };
1504-
} {
1488+
export function isCodeQualityEnabled(config: Config): boolean {
15051489
return config.analysisKinds.includes(AnalysisKind.CodeQuality);
15061490
}

0 commit comments

Comments
 (0)