OPENIDE add support sentry for openide plugins

This commit is contained in:
Nikita Iarychenko
2026-08-11 12:44:45 +04:00
parent 6a100a121d
commit 05c16f4bfc
6 changed files with 40 additions and 13 deletions
+1 -1
View File
@@ -34,7 +34,7 @@
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_25">
<component name="ProjectRootManager" version="2" languageLevel="JDK_25" project-jdk-name="jbr-25" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SuppressKotlinCodeStyleNotification">
@@ -72,6 +72,9 @@ object PluginManagerCore {
const val ENABLE: String = "enable"
const val EDIT: String = "edit"
/** Vendors whose plugins are developed as a part of the OpenIDE product, so their exceptions are processed by OpenIDE. */
private val VENDORS_OPENIDE = listOf("OpenIDE", "Haulmont", "GitFlic", "Axiom")
@JvmField val CORE_ID: PluginId = PluginId.getId(CORE_PLUGIN_ID)
@JvmField val JAVA_PLUGIN_ID: PluginId = PluginId.getId("com.intellij.java")
@@ -282,14 +285,22 @@ object PluginManagerCore {
isVendorTrusted(plugin.vendor ?: "") ||
isVendorTrusted(plugin.organization ?: "")
private fun isDevelopedByOpenIde(plugin: PluginDescriptor): Boolean =
isDevelopedByOpenIde(plugin.vendor) ||
isDevelopedByOpenIde(plugin.organization)
@ApiStatus.Internal
@JvmStatic
fun isDevelopedByOpenIde(plugin: PluginDescriptor): Boolean = isDevelopedByOpenIde(plugin.vendor, plugin.organization)
private fun isDevelopedByOpenIde(vendorString: String?): Boolean {
return listOf("openide", "haulmont", "gitflic", "axiom")
.any { it.equals(vendorString, ignoreCase = true) }
}
@ApiStatus.Internal
@JvmStatic
fun isDevelopedByOpenIde(vendor: @NlsSafe String?, organization: @NlsSafe String?): Boolean =
isDevelopedByOpenIde(vendor) ||
isDevelopedByOpenIde(organization)
@ApiStatus.Internal
@JvmStatic
fun isDevelopedByOpenIde(vendorString: String?): Boolean =
vendorString != null && vendorString.splitToSequence(',').any { isVendorOpenIde(it.trim()) }
private fun isVendorOpenIde(vendorItem: String): Boolean = VENDORS_OPENIDE.any { it.equals(vendorItem, ignoreCase = true) }
@JvmStatic
fun isDevelopedByJetBrains(plugin: PluginDescriptor): Boolean = isDevelopedByJetBrains(pluginId = plugin.pluginId, vendor = plugin.vendor, organization = plugin.organization)
@@ -1,4 +1,7 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
//
// Modified by Nikita Iarychenko at 2026 as part of the OpenIDE project(https://openide.ru).
// Any modifications are available on the same license terms as the original source code.
package com.intellij.diagnostic;
import com.intellij.diagnostic.VMOptions.MemoryKind;
@@ -60,7 +63,10 @@ public final class DefaultIdeaErrorLogger {
}
}
if (plugin == null || PluginManagerCore.isDevelopedByJetBrains(plugin.getPluginId(), plugin.getVendor(), plugin.getOrganization())) {
// exceptions in the platform and in plugins developed by JetBrains or OpenIDE are processed by the default (OpenIDE) reporter
if (plugin == null ||
PluginManagerCore.isDevelopedByJetBrains(plugin.getPluginId(), plugin.getVendor(), plugin.getOrganization()) ||
PluginManagerCore.isDevelopedByOpenIde(plugin.getVendor(), plugin.getOrganization())) {
for (var reporter : reporters) {
var descriptor = reporter.getPluginDescriptor();
if (descriptor == null || PluginManagerCore.CORE_ID.equals(descriptor.getPluginId())) {
@@ -1,4 +1,7 @@
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
//
// Modified by Nikita Iarychenko at 2026 as part of the OpenIDE project(https://openide.ru).
// Any modifications are available on the same license terms as the original source code.
package com.intellij.diagnostic
import com.intellij.featureStatistics.fusCollectors.LifecycleUsageTriggerCollector
@@ -119,6 +122,10 @@ class DialogAppender : Handler() {
}
private fun showPluginError(throwable: Throwable, message: String?, plugin: IdeaPluginDescriptor?): Boolean {
// errors in plugins developed by OpenIDE are shown even in release builds, so that a user is able to report them to OpenIDE
if (plugin != null && PluginManagerCore.isDevelopedByOpenIde(plugin)) {
return true
}
val submitter = DefaultIdeaErrorLogger.findSubmitter(throwable, plugin)
return submitter !is ITNReporter || submitter.showErrorInRelease(IdeaLoggingEvent(message, throwable))
}
@@ -65,15 +65,15 @@ object ITNUtils {
}
if (StringUtil.isNotEmpty(error.pluginId)) {
event.setExtra("plugin.id", error.pluginId!!)
event.setTag("plugin.id", error.pluginId!!)
}
if (StringUtil.isNotEmpty(error.pluginVersion)) {
event.setExtra("plugin.version", error.pluginVersion!!)
event.setTag("plugin.version", error.pluginVersion!!)
}
if (StringUtil.isNotEmpty(error.pluginName)) {
event.setExtra("plugin.name", error.pluginName!!)
event.setTag("plugin.name", error.pluginName!!)
}
event.setExtra("Memory", (Runtime.getRuntime().maxMemory() / FileUtilRt.MEGABYTE).toString() + "M")
@@ -1,4 +1,7 @@
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
//
// Modified by Nikita Iarychenko at 2026 as part of the OpenIDE project(https://openide.ru).
// Any modifications are available on the same license terms as the original source code.
package com.intellij.diagnostic
import com.intellij.CommonBundle
@@ -537,7 +540,7 @@ open class IdeErrorsDialog @ApiStatus.Internal @JvmOverloads constructor(
val date = DateFormatUtil.formatPrettyDateTime(cluster.messages[count - 1].date)
myDetailsLabel.text = DiagnosticBundle.message("error.list.message.info", date, count)
val submitter = cluster.submitter
if (submitter == null && pluginInfo != null && !PluginManagerCore.isDevelopedByJetBrains(pluginInfo.pluginId, pluginInfo.vendor, pluginInfo.organization)) {
if (submitter == null && pluginInfo != null && !PluginManagerCore.isDevelopedByJetBrains(pluginInfo.pluginId, pluginInfo.vendor, pluginInfo.organization) && !PluginManagerCore.isDevelopedByOpenIde(pluginInfo.vendor, pluginInfo.organization)) {
myForeignPluginWarningLabel.isVisible = true
val vendor = pluginInfo.vendor
val vendorUrl =