From ac52a1b123045d519049fe3d237b2288c14d835b Mon Sep 17 00:00:00 2001 From: idrissrio Date: Mon, 28 Jul 2025 16:26:27 +0200 Subject: [PATCH] Java: Move `extractorInformationSkipKey` predicate to library pack --- .../ExtractorInformation.ext.yml | 2 +- .../ExtractorInformation.ext.yml | 2 +- java/ql/lib/semmle/code/java/Diagnostics.qll | 6 ++++++ java/ql/src/Telemetry/ExtractorInformation.ql | 2 -- java/ql/src/Telemetry/ExtractorInformation.yml | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/java/ql/integration-tests/kotlin/all-platforms/extractor_information_kotlin1/ExtractorInformation.ext.yml b/java/ql/integration-tests/kotlin/all-platforms/extractor_information_kotlin1/ExtractorInformation.ext.yml index 3b6ffa4a3771..e4f5148ee404 100644 --- a/java/ql/integration-tests/kotlin/all-platforms/extractor_information_kotlin1/ExtractorInformation.ext.yml +++ b/java/ql/integration-tests/kotlin/all-platforms/extractor_information_kotlin1/ExtractorInformation.ext.yml @@ -1,6 +1,6 @@ extensions: - addsTo: - pack: codeql/java-queries + pack: codeql/java-all extensible: extractorInformationSkipKey data: # These will have unstable values, as they are dependent on the diff --git a/java/ql/integration-tests/kotlin/all-platforms/extractor_information_kotlin2/ExtractorInformation.ext.yml b/java/ql/integration-tests/kotlin/all-platforms/extractor_information_kotlin2/ExtractorInformation.ext.yml index be02d9554f81..6d95b68726ae 100644 --- a/java/ql/integration-tests/kotlin/all-platforms/extractor_information_kotlin2/ExtractorInformation.ext.yml +++ b/java/ql/integration-tests/kotlin/all-platforms/extractor_information_kotlin2/ExtractorInformation.ext.yml @@ -1,6 +1,6 @@ extensions: - addsTo: - pack: codeql/java-queries + pack: codeql/java-all extensible: extractorInformationSkipKey data: # These will have unstable values, as they are dependent on the diff --git a/java/ql/lib/semmle/code/java/Diagnostics.qll b/java/ql/lib/semmle/code/java/Diagnostics.qll index c93e6850b3de..8a4b543aa4a1 100644 --- a/java/ql/lib/semmle/code/java/Diagnostics.qll +++ b/java/ql/lib/semmle/code/java/Diagnostics.qll @@ -61,3 +61,9 @@ class Diagnostic extends @diagnostic { /** Gets a textual representation of this diagnostic. */ string toString() { result = this.getMessage() } } + +/** + * Holds for extraction information keys that should be skipped from telemetry reports. + * This predicate can be extended by other packs to filter out specific telemetry keys. + */ +extensible predicate extractorInformationSkipKey(string key); diff --git a/java/ql/src/Telemetry/ExtractorInformation.ql b/java/ql/src/Telemetry/ExtractorInformation.ql index ea6d6fc2d41e..f5bc8b426972 100644 --- a/java/ql/src/Telemetry/ExtractorInformation.ql +++ b/java/ql/src/Telemetry/ExtractorInformation.ql @@ -10,8 +10,6 @@ import java import semmle.code.java.Diagnostics import DatabaseQuality -extensible predicate extractorInformationSkipKey(string key); - predicate compilationInfo(string key, int value) { exists(Compilation c, string infoKey | key = infoKey + ": " + c.getInfo(infoKey) and diff --git a/java/ql/src/Telemetry/ExtractorInformation.yml b/java/ql/src/Telemetry/ExtractorInformation.yml index 74a7f99520b7..18e691a79e99 100644 --- a/java/ql/src/Telemetry/ExtractorInformation.yml +++ b/java/ql/src/Telemetry/ExtractorInformation.yml @@ -1,5 +1,5 @@ extensions: - addsTo: - pack: codeql/java-queries + pack: codeql/java-all extensible: extractorInformationSkipKey data: []