mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DO-2480 update FUS reporting lib version to 1.0.226
GitOrigin-RevId: d948984cd7822bfb344eb3b26f640a1e876dd4ad
This commit is contained in:
committed by
intellij-monorepo-bot
parent
78e137fd67
commit
bc9339c6a7
@@ -1,20 +1,20 @@
|
||||
<component name="libraryTable">
|
||||
<library name="com.jetbrains.fus.reporting.ap.validation.all" type="repository">
|
||||
<properties include-transitive-deps="false" maven-id="com.jetbrains.fus.reporting:ap-validation-all:1.0.205">
|
||||
<properties include-transitive-deps="false" maven-id="com.jetbrains.fus.reporting:ap-validation-all:1.0.226">
|
||||
<verification>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/ap-validation-all/1.0.205/ap-validation-all-1.0.205.jar">
|
||||
<sha256sum>9921601d14966cf0f9231fd2b92ba9a5b65b02c92a3a9ebc2049c8b2710a2eea</sha256sum>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/ap-validation-all/1.0.226/ap-validation-all-1.0.226.jar">
|
||||
<sha256sum>ab4e876b971e66217e311205823a626d10fc751999998ea67fe637277151a224</sha256sum>
|
||||
</artifact>
|
||||
</verification>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/ap-validation-all/1.0.205/ap-validation-all-1.0.205.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/ap-validation-all/1.0.226/ap-validation-all-1.0.226.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/ap-validation-all/1.0.205/ap-validation-all-1.0.205-javadoc.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/ap-validation-all/1.0.226/ap-validation-all-1.0.226-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/ap-validation-all/1.0.205/ap-validation-all-1.0.205-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/ap-validation-all/1.0.226/ap-validation-all-1.0.226-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
+6
-6
@@ -1,18 +1,18 @@
|
||||
<component name="libraryTable">
|
||||
<library name="com.jetbrains.fus.reporting.api" type="repository">
|
||||
<properties include-transitive-deps="false" maven-id="com.jetbrains.fus.reporting:api:1.0.205">
|
||||
<library name="com.jetbrains.fus.reporting.fus-api" type="repository">
|
||||
<properties include-transitive-deps="false" maven-id="com.jetbrains.fus.reporting:fus-api:1.0.226">
|
||||
<verification>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/api/1.0.205/api-1.0.205.jar">
|
||||
<sha256sum>bd122fb2110ec009cf3143aef5e2d473611b5e015c0d2701686eb94200e538ca</sha256sum>
|
||||
<artifact url="file://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/fus-api/1.0.226/fus-api-1.0.226.jar">
|
||||
<sha256sum>a0928c000cbffdb10f73966a4e3ee2ca884aede38c9ac908212554b067898a8b</sha256sum>
|
||||
</artifact>
|
||||
</verification>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/api/1.0.205/api-1.0.205.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/fus-api/1.0.226/fus-api-1.0.226.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/api/1.0.205/api-1.0.205-sources.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/jetbrains/fus/reporting/fus-api/1.0.226/fus-api-1.0.226-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
+11
-11
@@ -842,32 +842,32 @@ jvm_import(
|
||||
)
|
||||
|
||||
copy_file(
|
||||
name = "com.jetbrains.fus.reporting/ap-validation-all-1.0.205.jar_copy",
|
||||
src = "@com_jetbrains_fus_reporting-ap-validation-all-1_0_205_http//file",
|
||||
out = "com.jetbrains.fus.reporting/ap-validation-all-1.0.205.jar",
|
||||
name = "com.jetbrains.fus.reporting/ap-validation-all-1.0.226.jar_copy",
|
||||
src = "@com_jetbrains_fus_reporting-ap-validation-all-1_0_226_http//file",
|
||||
out = "com.jetbrains.fus.reporting/ap-validation-all-1.0.226.jar",
|
||||
allow_symlink = True,
|
||||
visibility = ["//visibility:public"]
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "com-jetbrains-fus-reporting-ap-validation-all",
|
||||
jar = "@com_jetbrains_fus_reporting-ap-validation-all-1_0_205_http//file",
|
||||
source_jar = "@com_jetbrains_fus_reporting-ap-validation-all-1_0_205-sources_http//file",
|
||||
jar = "@com_jetbrains_fus_reporting-ap-validation-all-1_0_226_http//file",
|
||||
source_jar = "@com_jetbrains_fus_reporting-ap-validation-all-1_0_226-sources_http//file",
|
||||
visibility = ["//visibility:public"]
|
||||
)
|
||||
|
||||
copy_file(
|
||||
name = "com.jetbrains.fus.reporting/api-1.0.205.jar_copy",
|
||||
src = "@com_jetbrains_fus_reporting-api-1_0_205_http//file",
|
||||
out = "com.jetbrains.fus.reporting/api-1.0.205.jar",
|
||||
name = "com.jetbrains.fus.reporting/fus-api-1.0.226.jar_copy",
|
||||
src = "@com_jetbrains_fus_reporting-fus-api-1_0_226_http//file",
|
||||
out = "com.jetbrains.fus.reporting/fus-api-1.0.226.jar",
|
||||
allow_symlink = True,
|
||||
visibility = ["//visibility:public"]
|
||||
)
|
||||
|
||||
jvm_import(
|
||||
name = "com-jetbrains-fus-reporting-api",
|
||||
jar = "@com_jetbrains_fus_reporting-api-1_0_205_http//file",
|
||||
source_jar = "@com_jetbrains_fus_reporting-api-1_0_205-sources_http//file",
|
||||
name = "com-jetbrains-fus-reporting-fus-api",
|
||||
jar = "@com_jetbrains_fus_reporting-fus-api-1_0_226_http//file",
|
||||
source_jar = "@com_jetbrains_fus_reporting-fus-api-1_0_226-sources_http//file",
|
||||
visibility = ["//visibility:public"]
|
||||
)
|
||||
|
||||
|
||||
+16
-16
@@ -455,31 +455,31 @@ http_file(
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "com_jetbrains_fus_reporting-ap-validation-all-1_0_205_http",
|
||||
url = "https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/ij/intellij-dependencies/com/jetbrains/fus/reporting/ap-validation-all/1.0.205/ap-validation-all-1.0.205.jar",
|
||||
sha256 = "9921601d14966cf0f9231fd2b92ba9a5b65b02c92a3a9ebc2049c8b2710a2eea",
|
||||
downloaded_file_path = "ap-validation-all-1.0.205.jar"
|
||||
name = "com_jetbrains_fus_reporting-ap-validation-all-1_0_226_http",
|
||||
url = "https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/ij/intellij-dependencies/com/jetbrains/fus/reporting/ap-validation-all/1.0.226/ap-validation-all-1.0.226.jar",
|
||||
sha256 = "ab4e876b971e66217e311205823a626d10fc751999998ea67fe637277151a224",
|
||||
downloaded_file_path = "ap-validation-all-1.0.226.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "com_jetbrains_fus_reporting-ap-validation-all-1_0_205-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/ij/intellij-dependencies/com/jetbrains/fus/reporting/ap-validation-all/1.0.205/ap-validation-all-1.0.205-sources.jar",
|
||||
sha256 = "57629ade1163f0c382a38eae0b127eb83e1f8aae36b6ca98242bcb2453f0e7b7",
|
||||
downloaded_file_path = "ap-validation-all-1.0.205-sources.jar"
|
||||
name = "com_jetbrains_fus_reporting-ap-validation-all-1_0_226-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/ij/intellij-dependencies/com/jetbrains/fus/reporting/ap-validation-all/1.0.226/ap-validation-all-1.0.226-sources.jar",
|
||||
sha256 = "c6deada2fac53b8ea6523dbda77597b128006674616f140f04df23264c6d1aa3",
|
||||
downloaded_file_path = "ap-validation-all-1.0.226-sources.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "com_jetbrains_fus_reporting-api-1_0_205_http",
|
||||
url = "https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/ij/intellij-dependencies/com/jetbrains/fus/reporting/api/1.0.205/api-1.0.205.jar",
|
||||
sha256 = "bd122fb2110ec009cf3143aef5e2d473611b5e015c0d2701686eb94200e538ca",
|
||||
downloaded_file_path = "api-1.0.205.jar"
|
||||
name = "com_jetbrains_fus_reporting-fus-api-1_0_226_http",
|
||||
url = "https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/ij/intellij-dependencies/com/jetbrains/fus/reporting/fus-api/1.0.226/fus-api-1.0.226.jar",
|
||||
sha256 = "a0928c000cbffdb10f73966a4e3ee2ca884aede38c9ac908212554b067898a8b",
|
||||
downloaded_file_path = "fus-api-1.0.226.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "com_jetbrains_fus_reporting-api-1_0_205-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/ij/intellij-dependencies/com/jetbrains/fus/reporting/api/1.0.205/api-1.0.205-sources.jar",
|
||||
sha256 = "5ce874a15878312c16eeafc73ff14e28e1fc0b72961eb6156cb8c46c04f66aac",
|
||||
downloaded_file_path = "api-1.0.205-sources.jar"
|
||||
name = "com_jetbrains_fus_reporting-fus-api-1_0_226-sources_http",
|
||||
url = "https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/ij/intellij-dependencies/com/jetbrains/fus/reporting/fus-api/1.0.226/fus-api-1.0.226-sources.jar",
|
||||
sha256 = "26bfa6c94159b402cb0373100e6531c50f1604f9fe802486bbe34412f175c023",
|
||||
downloaded_file_path = "fus-api-1.0.226-sources.jar"
|
||||
)
|
||||
|
||||
http_file(
|
||||
|
||||
@@ -82,7 +82,7 @@ jvm_library(
|
||||
"@lib//:netty-tcnative-boringssl",
|
||||
"//platform/util/coroutines",
|
||||
"@community//build:zip",
|
||||
"@lib//:com-jetbrains-fus-reporting-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-fus-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-ap-validation-all",
|
||||
"@lib//:platform-build_scripts-netty",
|
||||
"@lib//:platform-build_scripts-jetbrains-intellij-deps-coverage-reporter",
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
<orderEntry type="library" name="netty-tcnative-boringssl" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util.coroutines" />
|
||||
<orderEntry type="module" module-name="intellij.idea.community.build.zip" />
|
||||
<orderEntry type="library" name="com.jetbrains.fus.reporting.api" level="project" />
|
||||
<orderEntry type="library" name="com.jetbrains.fus.reporting.fus-api" level="project" />
|
||||
<orderEntry type="library" name="com.jetbrains.fus.reporting.ap.validation.all" level="project" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="netty" type="repository">
|
||||
|
||||
@@ -1410,7 +1410,7 @@ object CommunityLibraryLicenses {
|
||||
jetbrainsLibrary("ai.grazie.spell.hunspell.en"),
|
||||
jetbrainsLibrary("cloud-config-client"),
|
||||
jetbrainsLibrary("com.jetbrains.fus.reporting.ap.validation.all"),
|
||||
jetbrainsLibrary("com.jetbrains.fus.reporting.api"),
|
||||
jetbrainsLibrary("com.jetbrains.fus.reporting.fus-api"),
|
||||
jetbrainsLibrary("completion-log-events"),
|
||||
jetbrainsLibrary("completion-performance-kotlin"),
|
||||
jetbrainsLibrary("completion-ranking-cpp-exp"),
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.experiment.ab.impl.statistic
|
||||
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType;
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule
|
||||
import com.intellij.platform.experiment.ab.impl.ABExperimentOption
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ package com.intellij.execution.impl.statistics;
|
||||
import com.intellij.execution.configurations.ConfigurationType;
|
||||
import com.intellij.execution.impl.statistics.RunConfigurationTypeUsagesCollector.RunConfigurationUtilValidator;
|
||||
import com.intellij.internal.statistic.eventLog.FeatureUsageData;
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType;
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType;
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext;
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule;
|
||||
import com.intellij.openapi.Disposable;
|
||||
|
||||
@@ -200,7 +200,7 @@ jvm_library(
|
||||
"//platform/pluginSystem/parser/impl",
|
||||
"//platform/pluginSystem/parser/impl:impl_test_lib",
|
||||
"//platform/platform-impl/update-checker",
|
||||
"@lib//:com-jetbrains-fus-reporting-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-fus-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-ap-validation-all",
|
||||
"//platform/platform-impl/eel:ide-impl-wsl",
|
||||
"//platform/syntax/syntax-psi-tests:psi-tests_test_lib",
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.testFramework.junit5.projectStructure" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.platform.pluginSystem.parser.impl" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.updateChecker" scope="TEST" />
|
||||
<orderEntry type="library" scope="TEST" name="com.jetbrains.fus.reporting.api" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="com.jetbrains.fus.reporting.fus-api" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="com.jetbrains.fus.reporting.ap.validation.all" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ide.impl.wsl" scope="TEST" />
|
||||
<orderEntry type="module" module-name="intellij.platform.syntax.psi.tests" scope="TEST" />
|
||||
|
||||
+56
@@ -46,6 +46,62 @@ class EventSchemeBuilderTest : BasePlatformTestCase() {
|
||||
doFieldTest(EventFields.String("class", listOf("foo", "bar")), hashSetOf("{enum:foo|bar}"))
|
||||
}
|
||||
|
||||
fun `test generate string field with required true`() {
|
||||
doFieldTest(
|
||||
EventFields.String("status", listOf("open", "closed"), required = true),
|
||||
hashSetOf("{enum:open|closed}", "{required:true}")
|
||||
)
|
||||
}
|
||||
|
||||
fun `test generate string field with required false`() {
|
||||
doFieldTest(
|
||||
EventFields.String("status", listOf("open", "closed"), required = false),
|
||||
hashSetOf("{enum:open|closed}", "{required:false}")
|
||||
)
|
||||
}
|
||||
|
||||
fun `test generate string field with required unspecified`() {
|
||||
doFieldTest(
|
||||
EventFields.String("status", listOf("open", "closed"), required = null),
|
||||
hashSetOf("{enum:open|closed}")
|
||||
)
|
||||
}
|
||||
|
||||
fun `test generate string field with default value`() {
|
||||
doFieldTest(
|
||||
EventFields.String("mode", listOf("auto", "manual"), defaultValue = "auto"),
|
||||
hashSetOf("{enum:auto|manual}", "{default_value:auto}")
|
||||
)
|
||||
}
|
||||
|
||||
fun `test generate string field with explicitly removed default value`() {
|
||||
doFieldTest(
|
||||
EventFields.String("mode", listOf("auto", "manual"), defaultValue = ""),
|
||||
hashSetOf("{enum:auto|manual}", "{default_value:}")
|
||||
)
|
||||
}
|
||||
|
||||
fun `test generate string field with no default value`() {
|
||||
doFieldTest(
|
||||
EventFields.String("mode", listOf("auto", "manual"), defaultValue = null),
|
||||
hashSetOf("{enum:auto|manual}")
|
||||
)
|
||||
}
|
||||
|
||||
fun `test generate string field with required and default value`() {
|
||||
doFieldTest(
|
||||
EventFields.String("type", listOf("A", "B", "C"), required = true, defaultValue = "A"),
|
||||
hashSetOf("{enum:A|B|C}", "{required:true}", "{default_value:A}")
|
||||
)
|
||||
}
|
||||
|
||||
fun `test generate string field with required false and empty default`() {
|
||||
doFieldTest(
|
||||
EventFields.String("type", listOf("A", "B", "C"), required = false, defaultValue = ""),
|
||||
hashSetOf("{enum:A|B|C}", "{required:false}", "{default_value:}")
|
||||
)
|
||||
}
|
||||
|
||||
fun `test generate enum field`() {
|
||||
doFieldTest(EventFields.Enum("enum", TestEnum::class.java), hashSetOf("{enum:FOO|BAR}"))
|
||||
}
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ class TestGroupFilterRulesBuilder {
|
||||
}
|
||||
|
||||
fun build(): EventGroupsFilterRules<EventLogBuild> {
|
||||
val result = HashMap<String, EventGroupFilterRules<EventLogBuild>>()
|
||||
val result = HashMap<String?, EventGroupFilterRules<EventLogBuild>>()
|
||||
for (groupId in groupIds) {
|
||||
val builds: List<BuildRange<EventLogBuild>> = groupBuilds.getOrDefault(groupId, emptyList())
|
||||
val versions: List<VersionRange> = groupVersions.getOrDefault(groupId, emptyList())
|
||||
|
||||
+3
-3
@@ -4,11 +4,11 @@ package com.intellij.internal.statistics.metadata.validator
|
||||
import com.intellij.internal.statistic.eventLog.EventLogBuild
|
||||
import com.intellij.internal.statistic.eventLog.EventLogGroup
|
||||
import com.intellij.internal.statistic.eventLog.FeatureUsageData
|
||||
import com.intellij.internal.statistic.eventLog.validator.IGroupValidators
|
||||
import com.jetbrains.fus.reporting.api.IGroupValidators
|
||||
import com.intellij.internal.statistic.eventLog.validator.IntellijSensitiveDataValidator
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.FUSRule
|
||||
import com.jetbrains.fus.reporting.api.FUSRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.utils.CustomRuleProducer
|
||||
import com.intellij.internal.statistic.eventLog.validator.storage.FusComponentProvider
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.intellij.featureStatistics.ProductivityFeaturesProvider
|
||||
import com.intellij.featureStatistics.ProductivityFeaturesTest
|
||||
import com.intellij.internal.statistic.collectors.fus.FacetTypeUsageCollector
|
||||
import com.intellij.internal.statistic.eventLog.FeatureUsageData
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.internal.statistics.metadata.validator
|
||||
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule
|
||||
import com.intellij.internal.statistic.utils.PluginType
|
||||
@@ -106,7 +106,7 @@ private fun newContext(plugin_type: String?, plugin: String?): EventContext {
|
||||
class TestCheckPluginTypeCustomValidationRule(private val fromJBPlugin: Boolean) : CustomValidationRule() {
|
||||
override fun acceptRuleId(ruleId: String?): Boolean = true
|
||||
|
||||
override fun doValidate(data: String, context: EventContext): ValidationResultType {
|
||||
override fun doValidate(data: String, context: EventContext): com.intellij.internal.statistic.eventLog.validator.ValidationResultType {
|
||||
return if (fromJBPlugin) acceptWhenReportedByJetBrainsPlugin(context) else acceptWhenReportedByPluginFromPluginRepository(context)
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
package com.intellij.internal.statistics.metadata.validator
|
||||
|
||||
import com.intellij.internal.statistic.eventLog.FeatureUsageData
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.LocalFileCustomValidationRule
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.intellij.featureStatistics.GroupDescriptor
|
||||
import com.intellij.featureStatistics.ProductivityFeaturesProvider
|
||||
import com.intellij.featureStatistics.ProductivityFeaturesTest
|
||||
import com.intellij.internal.statistic.eventLog.FeatureUsageData
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
|
||||
+6
-6
@@ -4,13 +4,13 @@ package com.intellij.internal.statistics.metadata.validator
|
||||
import com.intellij.internal.statistic.eventLog.EventLogBuild
|
||||
import com.intellij.internal.statistic.eventLog.EventLogGroup
|
||||
import com.intellij.internal.statistic.eventLog.FeatureUsageData
|
||||
import com.intellij.internal.statistic.eventLog.validator.IGroupValidators
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.emptyGroupValidators
|
||||
import com.jetbrains.fus.reporting.api.IGroupValidators
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType
|
||||
import com.jetbrains.fus.reporting.api.emptyGroupValidators
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.LocalEnumCustomValidationRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.RecorderDataValidationRule
|
||||
import com.jetbrains.fus.reporting.api.RecorderDataValidationRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.storage.FusComponentProvider
|
||||
import com.intellij.openapi.extensions.Extensions
|
||||
import com.intellij.openapi.util.Disposer
|
||||
@@ -663,8 +663,8 @@ class SensitiveDataValidatorTest : BaseSensitiveDataValidatorTest() {
|
||||
internal inner class TestThirdPartyValidationRule : CustomValidationRule() {
|
||||
override fun getRuleId(): String = "third_party_rule"
|
||||
|
||||
override fun doValidate(data: String, context: EventContext): ValidationResultType {
|
||||
return if (data == "FIRST") ValidationResultType.ACCEPTED else ValidationResultType.THIRD_PARTY
|
||||
override fun doValidate(data: String, context: EventContext): com.intellij.internal.statistic.eventLog.validator.ValidationResultType {
|
||||
return if (data == "FIRST") com.intellij.internal.statistic.eventLog.validator.ValidationResultType.ACCEPTED else com.intellij.internal.statistic.eventLog.validator.ValidationResultType.THIRD_PARTY
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,11 +40,11 @@ jvm_library(
|
||||
"//libraries/kotlinx/coroutines/core",
|
||||
"//libraries/kotlinx/serialization/json",
|
||||
"//libraries/kotlinx/serialization/core",
|
||||
"@lib//:com-jetbrains-fus-reporting-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-fus-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-ap-validation-all",
|
||||
],
|
||||
exports = [
|
||||
"@lib//:com-jetbrains-fus-reporting-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-fus-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-ap-validation-all",
|
||||
]
|
||||
)
|
||||
@@ -84,11 +84,11 @@ jvm_library(
|
||||
"@lib//:assert_j",
|
||||
"//libraries/kotlinx/serialization/json",
|
||||
"//libraries/kotlinx/serialization/core",
|
||||
"@lib//:com-jetbrains-fus-reporting-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-fus-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-ap-validation-all",
|
||||
],
|
||||
exports = [
|
||||
"@lib//:com-jetbrains-fus-reporting-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-fus-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-ap-validation-all",
|
||||
]
|
||||
)
|
||||
|
||||
+9
-9
@@ -17,15 +17,15 @@ import com.intellij.internal.statistic.devkit.actions.scheme.EditEventsTestSchem
|
||||
import com.intellij.internal.statistic.eventLog.EventLogListenersManager
|
||||
import com.intellij.internal.statistic.eventLog.EventLogSystemEvents
|
||||
import com.intellij.internal.statistic.eventLog.StatisticsEventLogListener
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.DICTIONARY_NOT_FOUND
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.GENERAL_DICTIONARY_ERROR
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.INCORRECT_RULE
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.PERFORMANCE_ISSUE
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.REJECTED
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.REQUIRED_FIELD_MISSED
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.UNDEFINED_RULE
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.UNREACHABLE_METADATA
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.UNREACHABLE_METADATA_OBSOLETE
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.DICTIONARY_NOT_FOUND
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.GENERAL_DICTIONARY_ERROR
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.INCORRECT_RULE
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.PERFORMANCE_ISSUE
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.REJECTED
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.REQUIRED_FIELD_MISSED
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.UNDEFINED_RULE
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.UNREACHABLE_METADATA
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.UNREACHABLE_METADATA_OBSOLETE
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.actionSystem.ActionManager
|
||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
||||
|
||||
+7
-6
@@ -5,11 +5,12 @@ import com.intellij.execution.process.ProcessOutputType
|
||||
import com.intellij.internal.statistic.devkit.toolwindow.StatisticsEventLogMessageBuilder
|
||||
import com.intellij.internal.statistic.devkit.toolwindow.StatisticsEventLogToolWindow
|
||||
import com.intellij.internal.statistic.devkit.toolwindow.StatisticsLogFilterModel
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.ACCEPTED
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.INCORRECT_RULE
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.THIRD_PARTY
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.UNDEFINED_RULE
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.ACCEPTED
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.INCORRECT_RULE
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.THIRD_PARTY
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.DEFAULT_VALUE_APPLIED
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType.UNDEFINED_RULE
|
||||
import com.intellij.testFramework.fixtures.BasePlatformTestCase
|
||||
import com.intellij.util.text.DateFormatUtil
|
||||
import com.jetbrains.fus.reporting.model.lion3.LogEvent
|
||||
@@ -123,7 +124,7 @@ class StatisticsEventLogToolWindowTest : BasePlatformTestCase() {
|
||||
}
|
||||
|
||||
fun testAllValidationTypesUsed() {
|
||||
val correctValidationTypes = setOf(ACCEPTED, THIRD_PARTY)
|
||||
val correctValidationTypes = setOf(ACCEPTED, THIRD_PARTY, DEFAULT_VALUE_APPLIED)
|
||||
for (resultType in ValidationResultType.entries) {
|
||||
assertTrue("Don't forget to change toolWindow logic in case of a new value ${resultType.name} in ValidationResult",
|
||||
StatisticsEventLogToolWindow.rejectedValidationTypes.contains(resultType) || correctValidationTypes.contains(resultType))
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
package com.intellij.internal.statistic.envTest.scheme
|
||||
|
||||
import com.intellij.internal.statistic.envTest.StatisticsServiceBaseTest
|
||||
import com.intellij.internal.statistic.eventLog.EventLogBuild
|
||||
import com.intellij.internal.statistic.eventLog.EventLogBuild.EVENT_LOG_BUILD_PRODUCER
|
||||
import com.intellij.internal.statistic.eventLog.connection.metadata.EventGroupFilterRules
|
||||
import com.intellij.internal.statistic.eventLog.connection.metadata.EventGroupFilterRules.BuildRange
|
||||
@@ -41,7 +42,7 @@ internal class EventLogMetadataServiceTest : StatisticsServiceBaseTest() {
|
||||
}
|
||||
|
||||
fun `test load and parse metadata`() {
|
||||
val expected = hashMapOf(
|
||||
val expected: MutableMap<String?, EventGroupFilterRules<EventLogBuild>> = hashMapOf(
|
||||
"test.group" to EventGroupFilterRules(emptyList(), listOf(VersionRange.create("3", null))),
|
||||
"second.test.group" to EventGroupFilterRules(listOf(BuildRange.create("191.12345", null, EVENT_LOG_BUILD_PRODUCER)), emptyList())
|
||||
)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<orderEntry type="library" scope="TEST" name="assertJ" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.libraries.kotlinx.serialization.json" />
|
||||
<orderEntry type="module" module-name="intellij.libraries.kotlinx.serialization.core" />
|
||||
<orderEntry type="library" exported="" name="com.jetbrains.fus.reporting.api" level="project" />
|
||||
<orderEntry type="library" exported="" name="com.jetbrains.fus.reporting.fus-api" level="project" />
|
||||
<orderEntry type="library" exported="" name="com.jetbrains.fus.reporting.ap.validation.all" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.internal.statistic.eventLog
|
||||
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType
|
||||
import com.intellij.util.PlatformUtils
|
||||
import java.util.regex.Pattern
|
||||
|
||||
|
||||
+12
-2
@@ -21,6 +21,10 @@ sealed class EventField<T> {
|
||||
open val shouldBeAnonymized: Boolean
|
||||
get() = false
|
||||
|
||||
open val required: Boolean? = null
|
||||
|
||||
open val defaultValue: String? = null
|
||||
|
||||
abstract fun addData(fuData: FeatureUsageData, value: T)
|
||||
|
||||
@Contract(pure = true)
|
||||
@@ -50,11 +54,17 @@ abstract class StringEventField(override val name: String) : PrimitiveEventField
|
||||
|
||||
data class ValidatedByAllowedValues(@NonNls @EventFieldName override val name: String,
|
||||
val allowedValues: List<String>,
|
||||
@NonNls override val description: String? = null) : StringEventField(name) {
|
||||
@NonNls override val description: String? = null,
|
||||
override val required: Boolean? = null,
|
||||
override val defaultValue: String? = null) : StringEventField(name) {
|
||||
constructor(name: String, allowedValues: List<String>) : this(name, allowedValues, null)
|
||||
|
||||
override val validationRule: List<String>
|
||||
get() = listOf("{enum:${allowedValues.joinToString("|")}}")
|
||||
get() = buildList {
|
||||
add("{enum:${allowedValues.joinToString("|")}}")
|
||||
required?.let { value -> add("{required:$value}") }
|
||||
defaultValue?.let { value -> add("{default_value:$value}") }
|
||||
}
|
||||
}
|
||||
|
||||
data class ValidatedByEnum(@NonNls @EventFieldName override val name: String,
|
||||
|
||||
+12
-5
@@ -107,13 +107,20 @@ object EventFields {
|
||||
* Creates a field that allows only a specific list of values
|
||||
* @param name name of the field
|
||||
* @param allowedValues list of allowed values, e.g [ "bool", "int", "float"]
|
||||
* @param description optional description of the field
|
||||
* @param required field whether the field is required
|
||||
* @param defaultValue optional default value for the field
|
||||
*/
|
||||
@JvmStatic
|
||||
fun String(@NonNls @EventFieldName name: String, allowedValues: List<String>, @NonNls description: String?): StringEventField =
|
||||
StringEventField.ValidatedByAllowedValues(name, allowedValues, description)
|
||||
|
||||
@JvmStatic
|
||||
fun String(@NonNls @EventFieldName name: String, allowedValues: List<String>): StringEventField = String(name, allowedValues, null)
|
||||
@JvmOverloads
|
||||
fun String(
|
||||
@NonNls @EventFieldName name: String,
|
||||
allowedValues: List<String>,
|
||||
@NonNls description: String? = null,
|
||||
required: Boolean? = null,
|
||||
defaultValue: String? = null,
|
||||
): StringEventField =
|
||||
StringEventField.ValidatedByAllowedValues(name, allowedValues, description, required, defaultValue)
|
||||
|
||||
@JvmStatic
|
||||
fun Int(@NonNls @EventFieldName name: String, @NonNls description: String?): IntEventField = IntEventField(name, description)
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ object EventLogExternalUploader {
|
||||
findLibraryByClass(IllegalCallableAccessException::class.java), // add kotlin-reflect
|
||||
findLibraryByClass(EventGroupsFilterRules::class.java), // validation library
|
||||
findLibraryByClass(StatsConnectionSettings::class.java), // com.jetbrains.fus.reporting.model
|
||||
findLibraryByClass(MetadataStorage::class.java), // com.jetbrains.fus.reporting.api
|
||||
findLibraryByClass(MetadataStorage::class.java), // com.jetbrains.fus.reporting.fus-api
|
||||
findLibraryByClass(Json::class.java), // kotlinx.serialization.json
|
||||
findLibraryByClass(StringFormat::class.java) // kotlinx.serialization
|
||||
)
|
||||
|
||||
+25
-1
@@ -9,7 +9,7 @@ import com.intellij.internal.statistic.eventLog.validator.rules.beans.EventGroup
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRuleFactory
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.EnumValidationRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.RecorderDataValidationRule
|
||||
import com.jetbrains.fus.reporting.api.RecorderDataValidationRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.RegexpValidationRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.TestModeValidationRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.storage.FusComponentProvider
|
||||
@@ -19,6 +19,10 @@ import com.intellij.internal.statistic.utils.StatisticsUtil
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.jetbrains.fus.reporting.MessageBus
|
||||
import com.jetbrains.fus.reporting.MetadataStorage
|
||||
import com.jetbrains.fus.reporting.api.IEventContext
|
||||
import com.jetbrains.fus.reporting.api.IEventGroupRules
|
||||
import com.jetbrains.fus.reporting.api.IEventGroupsFilterRules
|
||||
import com.jetbrains.fus.reporting.api.IGroupValidators
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Job
|
||||
import org.jetbrains.annotations.ApiStatus.ScheduledForRemoval
|
||||
@@ -236,5 +240,25 @@ private class BlindSensitiveDataValidator(
|
||||
return context.eventData as MutableMap<String, Any>
|
||||
}
|
||||
|
||||
override fun guaranteeRejectedValuesReplacedWithDefaultValuesInEventData(
|
||||
eventData: MutableMap<String, Any>,
|
||||
context: IEventContext,
|
||||
groupRules: IEventGroupRules?,
|
||||
groupVersion: String,
|
||||
): MutableMap<String, Any> {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return context.eventData as MutableMap<String, Any>
|
||||
}
|
||||
|
||||
override fun guaranteeRequiredFieldsInEventData(
|
||||
eventData: MutableMap<String, Any>,
|
||||
context: IEventContext,
|
||||
groupRules: IEventGroupRules?,
|
||||
groupVersion: String,
|
||||
): MutableMap<String, Any> {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return context.eventData as MutableMap<String, Any>
|
||||
}
|
||||
|
||||
override suspend fun isGroupAllowed(group: EventLogGroup): Boolean = true
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.internal.statistic.eventLog.validator
|
||||
|
||||
import org.jetbrains.annotations.NonNls
|
||||
|
||||
enum class ValidationResultType(
|
||||
@field:NonNls val description: String,
|
||||
/**
|
||||
* Indicates if we should return the result or continue iterating through rules list,
|
||||
*
|
||||
* e.g. we want to check other rules if resultType==UNDEFINED_RULE
|
||||
* but we want to stop iterating if resultType==ACCEPTED
|
||||
*/
|
||||
val isFinal: Boolean,
|
||||
) {
|
||||
ACCEPTED("accepted", true),
|
||||
THIRD_PARTY("third.party", false),
|
||||
REJECTED("validation.unmatched_rule", false),
|
||||
INCORRECT_RULE("validation.incorrect_rule", false),
|
||||
UNDEFINED_RULE("validation.undefined_rule", false),
|
||||
UNREACHABLE_METADATA("validation.unreachable_metadata", true),
|
||||
DICTIONARY_NOT_FOUND("validation.dictionary_not_found", true),
|
||||
GENERAL_DICTIONARY_ERROR("validation.general_dictionary_error", true),
|
||||
|
||||
// renamed into UNREACHABLE_METADATA, needed for correct server validation
|
||||
@Deprecated("")
|
||||
UNREACHABLE_METADATA_OBSOLETE("validation.unreachable.whitelist", true),
|
||||
PERFORMANCE_ISSUE("validation.performance_issue", true),
|
||||
REQUIRED_FIELD_MISSED("validation.required_field_missed", true),
|
||||
DEFAULT_VALUE_APPLIED("validation.default_value_applied", true);
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val VALIDATION_TYPES: Set<String> = values().map { obj: ValidationResultType -> obj.description }.toSet()
|
||||
|
||||
@JvmStatic
|
||||
fun toFusApiResultType(
|
||||
resultType: ValidationResultType,
|
||||
): com.jetbrains.fus.reporting.api.ValidationResultType =
|
||||
when (resultType) {
|
||||
ACCEPTED -> com.jetbrains.fus.reporting.api.ValidationResultType.ACCEPTED
|
||||
THIRD_PARTY -> com.jetbrains.fus.reporting.api.ValidationResultType.THIRD_PARTY
|
||||
INCORRECT_RULE -> com.jetbrains.fus.reporting.api.ValidationResultType.INCORRECT_RULE
|
||||
UNDEFINED_RULE -> com.jetbrains.fus.reporting.api.ValidationResultType.UNDEFINED_RULE
|
||||
UNREACHABLE_METADATA -> com.jetbrains.fus.reporting.api.ValidationResultType.UNREACHABLE_METADATA
|
||||
DICTIONARY_NOT_FOUND -> com.jetbrains.fus.reporting.api.ValidationResultType.DICTIONARY_NOT_FOUND
|
||||
GENERAL_DICTIONARY_ERROR -> com.jetbrains.fus.reporting.api.ValidationResultType.GENERAL_DICTIONARY_ERROR
|
||||
UNREACHABLE_METADATA_OBSOLETE -> com.jetbrains.fus.reporting.api.ValidationResultType.UNREACHABLE_METADATA_OBSOLETE
|
||||
PERFORMANCE_ISSUE -> com.jetbrains.fus.reporting.api.ValidationResultType.PERFORMANCE_ISSUE
|
||||
REQUIRED_FIELD_MISSED -> com.jetbrains.fus.reporting.api.ValidationResultType.REQUIRED_FIELD_MISSED
|
||||
DEFAULT_VALUE_APPLIED -> com.jetbrains.fus.reporting.api.ValidationResultType.DEFAULT_VALUE_APPLIED
|
||||
REJECTED -> com.jetbrains.fus.reporting.api.ValidationResultType.REJECTED
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun fromFusApiResultType(
|
||||
resultType: com.jetbrains.fus.reporting.api.ValidationResultType,
|
||||
): ValidationResultType =
|
||||
when (resultType) {
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.ACCEPTED -> ACCEPTED
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.THIRD_PARTY -> THIRD_PARTY
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.INCORRECT_RULE -> INCORRECT_RULE
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.UNDEFINED_RULE -> UNDEFINED_RULE
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.UNREACHABLE_METADATA -> UNREACHABLE_METADATA
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.DICTIONARY_NOT_FOUND -> DICTIONARY_NOT_FOUND
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.GENERAL_DICTIONARY_ERROR -> GENERAL_DICTIONARY_ERROR
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.UNREACHABLE_METADATA_OBSOLETE -> UNREACHABLE_METADATA_OBSOLETE
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.PERFORMANCE_ISSUE -> PERFORMANCE_ISSUE
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.REQUIRED_FIELD_MISSED -> REQUIRED_FIELD_MISSED
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.DEFAULT_VALUE_APPLIED -> DEFAULT_VALUE_APPLIED
|
||||
com.jetbrains.fus.reporting.api.ValidationResultType.REJECTED -> REJECTED
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -3,14 +3,14 @@ package com.intellij.internal.statistic.eventLog.validator.rules.impl
|
||||
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.FUSRule
|
||||
import com.jetbrains.fus.reporting.api.FUSRule
|
||||
|
||||
class ComposerValidationRule(val rules: List<FUSRule>) {
|
||||
|
||||
fun doValidate(data: String, context: EventContext): ValidationResultType {
|
||||
for (rule in rules) {
|
||||
val validationResultType = rule.validate(data, context)
|
||||
if (validationResultType == ValidationResultType.ACCEPTED)
|
||||
if (ValidationResultType.fromFusApiResultType(validationResultType) == ValidationResultType.ACCEPTED)
|
||||
return ValidationResultType.ACCEPTED
|
||||
}
|
||||
return ValidationResultType.REJECTED
|
||||
|
||||
+14
-7
@@ -1,12 +1,12 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.internal.statistic.eventLog.validator.rules.impl;
|
||||
|
||||
import com.intellij.internal.statistic.eventLog.validator.IEventContext;
|
||||
import com.jetbrains.fus.reporting.api.IEventContext;
|
||||
import com.intellij.internal.statistic.eventLog.validator.IntellijSensitiveDataValidator;
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType;
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext;
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.FUSRule;
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.PayloadKey;
|
||||
import com.jetbrains.fus.reporting.api.FUSRule;
|
||||
import com.jetbrains.fus.reporting.api.PayloadKey;
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.PerformanceCareRule;
|
||||
import com.intellij.internal.statistic.utils.PluginInfo;
|
||||
import com.intellij.internal.statistic.utils.PluginInfoDetectorKt;
|
||||
@@ -127,14 +127,21 @@ public abstract class CustomValidationRule extends PerformanceCareRule implement
|
||||
return context.eventData.containsKey(name) ? context.eventData.get(name).toString() : null;
|
||||
}
|
||||
|
||||
protected abstract @NotNull ValidationResultType doValidate(@NotNull String data, @NotNull EventContext context);
|
||||
/**
|
||||
* @deprecated This method was added for compatibility with existing custom rules.
|
||||
* Use {@link #doValidate(String, IEventContext)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
protected @NotNull ValidationResultType doValidate(@NotNull String data, @NotNull EventContext context) {
|
||||
return ValidationResultType.REJECTED;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @NotNull ValidationResultType doValidate(@NotNull String data, @NotNull IEventContext context) {
|
||||
protected @NotNull com.jetbrains.fus.reporting.api.ValidationResultType doValidate(@NotNull String data, @NotNull IEventContext context) {
|
||||
if (context instanceof EventContext) {
|
||||
return this.doValidate(data, (EventContext)context);
|
||||
return ValidationResultType.toFusApiResultType(this.doValidate(data, (EventContext)context));
|
||||
} else {
|
||||
return ValidationResultType.REJECTED;
|
||||
return com.jetbrains.fus.reporting.api.ValidationResultType.REJECTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.internal.statistic.eventLog.validator.rules.utils;
|
||||
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.FUSRule;
|
||||
import com.jetbrains.fus.reporting.api.FUSRule;
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.beans.EventGroupContextData;
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule;
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRuleFactory;
|
||||
|
||||
+4
-4
@@ -2,10 +2,10 @@
|
||||
package com.intellij.internal.statistic.eventLog.validator.storage
|
||||
|
||||
import com.intellij.internal.statistic.eventLog.EventLogBuild
|
||||
import com.intellij.internal.statistic.eventLog.validator.IEventGroupRules
|
||||
import com.intellij.internal.statistic.eventLog.validator.IEventGroupsFilterRules
|
||||
import com.intellij.internal.statistic.eventLog.validator.IGroupValidators
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.RecorderDataValidationRule
|
||||
import com.jetbrains.fus.reporting.api.IEventGroupRules
|
||||
import com.jetbrains.fus.reporting.api.IEventGroupsFilterRules
|
||||
import com.jetbrains.fus.reporting.api.IGroupValidators
|
||||
import com.jetbrains.fus.reporting.api.RecorderDataValidationRule
|
||||
import com.jetbrains.fus.reporting.MetadataStorage
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Job
|
||||
|
||||
+4
-4
@@ -21,10 +21,10 @@ import com.intellij.internal.statistic.eventLog.connection.metadata.EventLogMeta
|
||||
import com.intellij.internal.statistic.eventLog.connection.metadata.EventLogMetadataParseException
|
||||
import com.intellij.internal.statistic.eventLog.connection.metadata.EventLogMetadataUpdateError
|
||||
import com.intellij.internal.statistic.eventLog.connection.metadata.EventLogMetadataUpdateStage
|
||||
import com.intellij.internal.statistic.eventLog.validator.IEventGroupRules
|
||||
import com.intellij.internal.statistic.eventLog.validator.IEventGroupsFilterRules
|
||||
import com.intellij.internal.statistic.eventLog.validator.IGroupValidators
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.RecorderDataValidationRule
|
||||
import com.jetbrains.fus.reporting.api.IEventGroupRules
|
||||
import com.jetbrains.fus.reporting.api.IEventGroupsFilterRules
|
||||
import com.jetbrains.fus.reporting.api.IGroupValidators
|
||||
import com.jetbrains.fus.reporting.api.RecorderDataValidationRule
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.utils.CustomRuleProducer
|
||||
import com.intellij.internal.statistic.eventLog.validator.storage.persistence.EventLogMetadataSettingsPersistence
|
||||
import com.intellij.internal.statistic.utils.StatisticsUploadAssistant
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ public final class ValidationRulesStorageProvider {
|
||||
public static @NotNull IntellijValidationRulesStorage newStorage(@NotNull String recorderId) {
|
||||
return new IntellijValidationRulesStorage() {
|
||||
@Override
|
||||
public @Nullable EventGroupRules getGroupRules(@NotNull String groupId) { return EventGroupRules.EMPTY; }
|
||||
public @Nullable EventGroupRules getGroupRules(@NotNull String groupId) { return EventGroupRules.Companion.getEMPTY(); }
|
||||
|
||||
@Override
|
||||
public boolean update() { return false; }
|
||||
|
||||
@@ -20,7 +20,7 @@ jvm_library(
|
||||
"//libraries/jackson/jackson",
|
||||
"//libraries/jackson/databind",
|
||||
"//libraries/jackson/module-kotlin:libraries-jackson-module-kotlin",
|
||||
"@lib//:com-jetbrains-fus-reporting-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-fus-api",
|
||||
"@lib//:com-jetbrains-fus-reporting-ap-validation-all",
|
||||
],
|
||||
exports = ["//platform/statistics/config"]
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<orderEntry type="module" module-name="intellij.libraries.jackson" />
|
||||
<orderEntry type="module" module-name="intellij.libraries.jackson.databind" />
|
||||
<orderEntry type="module" module-name="intellij.libraries.jackson.module.kotlin" />
|
||||
<orderEntry type="library" name="com.jetbrains.fus.reporting.api" level="project" />
|
||||
<orderEntry type="library" name="com.jetbrains.fus.reporting.fus-api" level="project" />
|
||||
<orderEntry type="library" name="com.jetbrains.fus.reporting.ap.validation.all" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
+1
-1
@@ -137,7 +137,7 @@ public final class EventLogMetadataUtils {
|
||||
}
|
||||
|
||||
Map<String, Long> lastModifiedMap = new HashMap<>();
|
||||
for(String dictionary : dictionaryList.dictionaries) {
|
||||
for(String dictionary : dictionaryList.getDictionaries()) {
|
||||
try {
|
||||
StatsRequestResult<Long> result = StatsHttpRequests.head(baseUrl + dictionary, settings).send(r -> r.lastModified());
|
||||
lastModifiedMap.put(dictionary, result.getResult());
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@ import com.intellij.internal.statistic.eventLog.events.EventFields.String
|
||||
import com.intellij.internal.statistic.eventLog.events.EventFields.StringListValidatedByCustomRule
|
||||
import com.intellij.internal.statistic.eventLog.events.EventId
|
||||
import com.intellij.internal.statistic.eventLog.events.EventId1
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType.ACCEPTED
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule
|
||||
@@ -98,7 +99,7 @@ internal class FrameTypeValidator : CustomValidationRule() {
|
||||
|
||||
override fun doValidate(data: String, context: EventContext) = when (data) {
|
||||
UNKNOWN_TYPE -> ACCEPTED
|
||||
else -> fileTypeValidator.validate(data, context)
|
||||
else -> ValidationResultType.fromFusApiResultType(fileTypeValidator.validate(data, context))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
package com.intellij.filePrediction.predictor
|
||||
|
||||
import com.intellij.filePrediction.logger.FilePredictionFeaturesValidator
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.testFramework.builders.ModuleFixtureBuilder
|
||||
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
package org.jetbrains.idea.maven.statistics
|
||||
|
||||
import com.intellij.internal.statistic.FUCollectorTestCase.collectProjectStateCollectorEvents
|
||||
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
|
||||
import com.jetbrains.fus.reporting.api.ValidationResultType
|
||||
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
|
||||
import com.intellij.maven.testFramework.MavenImportingTestCase
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ internal class TerminalFocusRule : CustomValidationRule() {
|
||||
return ValidationResultType.ACCEPTED
|
||||
}
|
||||
else {
|
||||
return toolWindowRule.validate(data, context)
|
||||
return ValidationResultType.fromFusApiResultType(toolWindowRule.validate(data, context))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user