Skip to content

Commit

Permalink
Fix compatibility problems in future IntelliJ releases (#431)
Browse files Browse the repository at this point in the history
* Use the Apache Commons Lang dependency directly, instead of calling it transitively via IntelliJ (it's already directly imported, but was used only in part of its usages).

* Verify the plugin against all versions of IntelliJ since "sinceBuild" configured in build.gradle.
  • Loading branch information
asafgabai authored Oct 22, 2023
1 parent 160027e commit 72a836e
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 22 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
schedule:
- cron: '0 6 * * *' # Runs every day at 6:00 AM GMT

# Ensures that only the latest commit is running for each PR at a time.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
if: github.event_name == 'schedule' || github.event_name == 'push' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test'))
Expand All @@ -20,6 +25,10 @@ jobs:
- os: windows-latest
gradlew_suffix: .bat
steps:
- name: Remove 'safe to test' label
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "safe to test"
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
testCommand: [ "verifyPlugin runPluginVerifier test", "pythonTests" ]
testCommand: [ "test", "pythonTests" ]
include:
- os: windows-latest
gradlewSuffix: .bat
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/verification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Compatibility verification"

on: [ push, pull_request ]

jobs:
test:
runs-on: macOS-latest
name: Compatibility verification
steps:
- uses: actions/checkout@v3

# Install required tools
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6

# Run compatibility verification
- name: Compatibility verification
run: ./gradlew clean verifyPlugin runPluginVerifier
14 changes: 8 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import java.net.http.HttpResponse
import java.nio.file.Paths

plugins {
id "org.jetbrains.intellij" version "1.15.0"
id "org.jetbrains.intellij" version "1.16.0"
id "java"
id "maven-publish"
id "de.undercouch.download" version "5.3.0"
Expand All @@ -24,17 +24,19 @@ intellij {
type = intellijType
plugins = ['gradle', 'maven', 'Groovy', 'properties', 'java', 'Kotlin', 'org.jetbrains.plugins.go:223.8617.56', "PythonCore:223.8617.56"]
pluginName = 'JFrog'
updateSinceUntilBuild = false
}

runPluginVerifier {
ideVersions = [intellijType + "-" + sandboxVersion]
}

runIde {
jvmArgs '-Xmx2G'
}

patchPluginXml {
sinceBuild = "223.4884.69"
// Explicitly setting this to an empty string makes the plugin compatible with all IDE versions up to the latest one.
// Removing this line will limit compatibility to IDE versions up to 'sandboxVersion'.
untilBuild = ""
}

repositories {
mavenLocal()
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.jfrog.ide.idea.ui.LocalComponentsTree;
import com.jfrog.ide.idea.ui.utils.IconUtils;
import com.jfrog.ide.idea.utils.Utils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.jfrog.ide.idea.inspections.upgradeversion.GradleKotlinUpgradeVersion;
import com.jfrog.ide.idea.inspections.upgradeversion.UpgradeVersion;
import com.jfrog.ide.idea.utils.Descriptor;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.psi.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.jfrog.ide.idea.scan.data.PackageManagerType;
import com.jfrog.ide.idea.scan.data.ScanConfig;
import com.jfrog.xray.client.services.entitlements.Feature;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.jfrog.build.api.util.Log;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.jfrog.ide.idea.scan.data.applications.ScannerConfig;
import com.jfrog.ide.idea.ui.LocalComponentsTree;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.jfrog.ide.idea.ui;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.jfrog.build.extractor.scan.DependencyTree;
import org.jfrog.build.extractor.scan.Issue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.jfrog.ide.common.nodes.FileTreeNode;
import com.jfrog.ide.common.nodes.SubtitledTreeNode;
import com.jfrog.ide.idea.ui.utils.IconUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.jfrog.ide.idea.ui.utils.ComponentUtils;
import com.jfrog.ide.idea.ui.webview.WebviewManager;
import com.jfrog.ide.idea.ui.webview.WebviewObjectConverter;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.jfrog.ide.idea.scan.ScanManager;
import com.jfrog.ide.idea.ui.menus.ToolbarPopupMenu;
import com.jfrog.ide.idea.utils.Utils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.intellij.openapi.options.ConfigurationException;
import com.jfrog.ide.common.configuration.ServerConfig;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.commons.lang3.StringUtils;

import java.nio.file.FileSystems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.jfrog.ide.idea.ui.menus.SelectionCheckbox;
import com.jfrog.ide.idea.ui.menus.ToolbarPopupMenu;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jfrog/ide/idea/utils/Descriptor.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.jfrog.ide.idea.utils;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

/**
* Represents all supported file descriptor types.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jfrog/ide/idea/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.jfrog.ide.idea.configuration.ServerConfigImpl;
import com.jfrog.ide.idea.log.Logger;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.jfrog.build.extractor.scan.DependencyTree;
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
]]>
</change-notes>

<idea-version since-build="223.4884.69"/>
<depends>com.intellij.modules.lang</depends>
<depends config-file="with-gradle.xml" optional="true">com.intellij.gradle</depends>
<depends config-file="with-groovy.xml" optional="true">org.intellij.groovy</depends>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.jfrog.ide.idea.log.Logger;
import com.jfrog.ide.idea.scan.IACScannerExecutor;
import com.jfrog.ide.idea.scan.data.ScanConfig;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

import java.io.IOException;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.jfrog.ide.idea.log.Logger;
import com.jfrog.ide.idea.scan.SecretsScannerExecutor;
import com.jfrog.ide.idea.scan.data.ScanConfig;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;

import java.io.IOException;
import java.util.List;
Expand Down

0 comments on commit 72a836e

Please sign in to comment.