Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade sandbox and dependencies #367

Merged
merged 6 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.4.1
gradle-version: 7.6
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
Expand Down
16 changes: 8 additions & 8 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.13.2"
id "org.jetbrains.intellij" version "1.14.2"
id "java"
id "maven-publish"
id "de.undercouch.download" version "5.3.0"
Expand All @@ -13,15 +13,15 @@ plugins {
group 'com.jfrog.ide'
version currentVersion

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
def testPython = project.gradle.startParameter.taskNames.contains("pythonTests")
def intellijType = testPython ? "IC" : "IU"

intellij {
version = sandboxVersion
type = intellijType
plugins = ['gradle', 'maven', 'Groovy', 'properties', 'java', 'Kotlin', 'org.jetbrains.plugins.go:221.5080.210', "PythonCore:221.5080.216"]
plugins = ['gradle', 'maven', 'Groovy', 'properties', 'java', 'Kotlin', 'org.jetbrains.plugins.go:223.8617.56', "PythonCore:223.8617.56"]
pluginName = 'JFrog'
updateSinceUntilBuild = false
}
Expand All @@ -47,18 +47,18 @@ repositories {

def buildInfoVersion = '2.41.1'
dependencies {
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.14.0'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.15.2'
implementation group: 'org.jfrog.buildinfo', name: 'build-info-extractor', version: buildInfoVersion
implementation group: 'org.jfrog.buildinfo', name: 'build-info-client', version: buildInfoVersion
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.14.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.15.2'
implementation group: 'org.jfrog.buildinfo', name: 'build-info-api', version: buildInfoVersion
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.11.4'
implementation group: 'com.jfrog.xray.client', name: 'xray-client-java', version: '0.14.1'
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
implementation group: 'org.jfrog.filespecs', name: 'file-specs-java', version: '1.1.2'
implementation group: 'com.jfrog.ide', name: 'ide-plugins-common', version: '2.2.0'
implementation group: 'com.jfrog.ide', name: 'ide-plugins-common', version: '2.2.x-20230709.145459-1'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.11'
implementation group: 'com.google.guava', name: 'guava', version: '30.1.1-jre'
implementation group: 'com.google.guava', name: 'guava', version: '32.0.1-jre'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '4.2.0'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
webviewVersion=0.2.1
sandboxVersion=2022.1
sandboxVersion=2022.3.2
webviewChecksum=5dc4bd0d2e2b5dd8eeadf713fc10ac2b1bac6acf11b34861b74d25c7e0800c51
currentVersion=2.2.x-SNAPSHOT
7 changes: 4 additions & 3 deletions release/pipelines.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ pipelines:
runtime:
type: image
image:
custom:
name: releases-docker.jfrog.io/jfrog-ecosystem-integration-env
tag: 1.10.1
auto:
language: java
versions:
- "17"
environmentVariables:
readOnly:
NEXT_VERSION: 0.0.0
Expand Down
7 changes: 4 additions & 3 deletions release/pipelines.snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ pipelines:
runtime:
type: image
image:
custom:
name: releases-docker.jfrog.io/jfrog-ecosystem-integration-env
tag: 1.10.1
auto:
language: java
versions:
- "17"

steps:
- name: Snapshot
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jfrog/ide/idea/scan/ScannerBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private void scanAndUpdate(ProgressIndicator indicator) {
scanInterrupted.set(true);
} catch (Exception e) {
scanInterrupted.set(true);
logError(log, "Xray Scan failed", e, true);
logError(log, "Xray scan failed", e, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void onThrowable(@NotNull Throwable error) {
}

private void sourceCodeScanAndUpdate(ProgressIndicator indicator, Runnable checkCanceled, Logger log) {
indicator.setText("Running advance source code scanning");
indicator.setText("Running advanced source code scanning");
double fraction = 0;
for (ScanBinaryExecutor scanner : scanners) {
checkCanceled.run();
Expand Down
28 changes: 12 additions & 16 deletions src/main/java/com/jfrog/ide/idea/ui/JFrogCiToolWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
import java.util.stream.Collectors;

import static com.jfrog.ide.idea.ui.JFrogToolWindow.*;
import static com.jfrog.ide.idea.ui.utils.ComponentUtils.*;
import static com.jfrog.ide.idea.ui.utils.ComponentUtils.createDisabledTextLabel;
import static com.jfrog.ide.idea.ui.utils.ComponentUtils.createNoBuildsView;
import static org.apache.commons.lang3.StringUtils.isAnyBlank;
import static org.apache.commons.lang3.StringUtils.isBlank;

Expand Down Expand Up @@ -143,7 +144,7 @@ public JPanel createActionToolbar() {

// Add builds selector
BuildsMenu buildsMenu = new BuildsMenu(project);
((CiComponentsTree) componentsTree).setBuildsMenu(buildsMenu);
componentsTree.setBuildsMenu(buildsMenu);
toolbarPanel.add(buildsMenu.getBuildButton());

// Create parent toolbar containing the builds and the component tree toolbars
Expand Down Expand Up @@ -189,7 +190,7 @@ private Set<Issue> getIssuesToDisplay(List<DependencyTree> selectedNodes) {

public void registerListeners() {
// Xray credentials were set listener
appBusConnection.subscribe(ApplicationEvents.ON_CONFIGURATION_DETAILS_CHANGE, () ->
appBusConnection.subscribe(ApplicationEvents.ON_CONFIGURATION_DETAILS_CHANGE, (ApplicationEvents) () ->
ApplicationManager.getApplication().invokeLater(this::onConfigurationChange));

// Component selection listener
Expand All @@ -205,13 +206,13 @@ public void registerListeners() {

issuesTable.addTableSelectionListener(moreInfoPanel);
componentsTree.addOnProjectChangeListener(projectBusConnection);
projectBusConnection.subscribe(ApplicationEvents.ON_CI_FILTER_CHANGE, () -> ApplicationManager.getApplication().invokeLater(() -> {
projectBusConnection.subscribe(ApplicationEvents.ON_CI_FILTER_CHANGE, (ApplicationEvents) () -> ApplicationManager.getApplication().invokeLater(() -> {
CiComponentsTree.getInstance(project).applyFiltersForAllProjects();
updateIssuesTable();
}));
projectBusConnection.subscribe(ApplicationEvents.ON_SCAN_CI_STARTED, () -> ApplicationManager.getApplication().invokeLater(this::resetViews));
projectBusConnection.subscribe(BuildEvents.ON_SELECTED_BUILD, this::setBuildDetails);
projectBusConnection.subscribe(ApplicationEvents.ON_BUILDS_CONFIGURATION_CHANGE, () -> ApplicationManager.getApplication().invokeLater(this::onConfigurationChange));
projectBusConnection.subscribe(ApplicationEvents.ON_SCAN_CI_STARTED, (ApplicationEvents) () -> ApplicationManager.getApplication().invokeLater(this::resetViews));
projectBusConnection.subscribe(BuildEvents.ON_SELECTED_BUILD, (BuildEvents) this::setBuildDetails);
projectBusConnection.subscribe(ApplicationEvents.ON_BUILDS_CONFIGURATION_CHANGE, (ApplicationEvents) () -> ApplicationManager.getApplication().invokeLater(this::onConfigurationChange));
}

/**
Expand Down Expand Up @@ -258,14 +259,9 @@ private void setBuildStatus(BuildGeneralInfo buildGeneralInfo) {
return;
}
switch (buildGeneralInfo.getStatus()) {
case PASSED:
setTextAndIcon(buildStatus, "Status: Success", AllIcons.RunConfigurations.TestPassed);
return;
case FAILED:
setTextAndIcon(buildStatus, "Status: Failed", AllIcons.RunConfigurations.TestFailed);
return;
default:
setTextAndIcon(buildStatus, "Status: Unknown", AllIcons.RunConfigurations.TestUnknown);
case PASSED -> setTextAndIcon(buildStatus, "Status: Success", AllIcons.RunConfigurations.TestPassed);
case FAILED -> setTextAndIcon(buildStatus, "Status: Failed", AllIcons.RunConfigurations.TestFailed);
default -> setTextAndIcon(buildStatus, "Status: Unknown", AllIcons.RunConfigurations.TestUnknown);
}
}

Expand Down Expand Up @@ -333,7 +329,7 @@ private JComponent createComponentsTreeView() {
componentsTreeTitle.setFont(componentsTreeTitle.getFont().deriveFont(TITLE_FONT_SIZE));
componentsTreePanel.add(componentsTreeTitle, BorderLayout.LINE_START);
JPanel treePanel = new JBPanel<>(new GridLayout()).withBackground(UIUtil.getTableBackground());
TreeSpeedSearch treeSpeedSearch = new TreeSpeedSearch(componentsTree, ComponentUtils::getPathSearchString, true);
TreeSpeedSearch treeSpeedSearch = new TreeSpeedSearch(componentsTree, true, ComponentUtils::getPathSearchString);
treePanel.add(treeSpeedSearch.getComponent(), BorderLayout.WEST);
JScrollPane treeScrollPane = ScrollPaneFactory.createScrollPane(treePanel);
treeScrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_BAR_SCROLLING_UNITS);
Expand Down
30 changes: 8 additions & 22 deletions src/main/java/com/jfrog/ide/idea/ui/JFrogLocalToolWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,12 @@
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.intellij.ui.HyperlinkLabel;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.ui.OnePixelSplitter;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.SideBorder;
import com.intellij.ui.TreeSpeedSearch;
import com.intellij.ui.*;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.JBPanel;
import com.intellij.ui.jcef.JBCefApp;
import com.intellij.util.ui.UIUtil;
import com.jfrog.ide.common.nodes.ApplicableIssueNode;
import com.jfrog.ide.common.nodes.FileIssueNode;
import com.jfrog.ide.common.nodes.IssueNode;
import com.jfrog.ide.common.nodes.LicenseViolationNode;
import com.jfrog.ide.common.nodes.VulnerabilityNode;
import com.jfrog.ide.common.nodes.*;
import com.jfrog.ide.idea.actions.CollapseAllAction;
import com.jfrog.ide.idea.actions.ExpandAllAction;
import com.jfrog.ide.idea.actions.GoToSettingsAction;
Expand Down Expand Up @@ -118,7 +109,7 @@ public JPanel createActionToolbar() {
*/
public void registerListeners(JComponent browserComponent) {
// Xray credentials were set listener
appBusConnection.subscribe(ApplicationEvents.ON_CONFIGURATION_DETAILS_CHANGE, () -> ApplicationManager.getApplication().invokeLater(this::onConfigurationChange));
appBusConnection.subscribe(ApplicationEvents.ON_CONFIGURATION_DETAILS_CHANGE, (ApplicationEvents) () -> ApplicationManager.getApplication().invokeLater(this::onConfigurationChange));

// Wrap the browser component in a Panel to avoid display issues that may occur in some versions of IntelliJ in Windows.
JPanel browserWrapper = new JBPanel<>();
Expand All @@ -136,7 +127,7 @@ public void registerListeners(JComponent browserComponent) {
updateIssueOrLicenseInWebview(selectedIssue);
verticalSplit.setSecondComponent(browserWrapper);
});
projectBusConnection.subscribe(ApplicationEvents.ON_SCAN_LOCAL_STARTED, () -> {
projectBusConnection.subscribe(ApplicationEvents.ON_SCAN_LOCAL_STARTED, (ApplicationEvents) () -> {
setLeftPanelContent(compTreeView);
ApplicationManager.getApplication().invokeLater(this::resetViews);
});
Expand All @@ -163,7 +154,6 @@ private void refreshView() {
setLeftPanelContent(compTreeView);
}

@SuppressWarnings("UnstableApiUsage")
private JComponent createReadyEnvView() {
JPanel readyEnvPanel = new JBPanel<>();
readyEnvPanel.setLayout(new BoxLayout(readyEnvPanel, BoxLayout.PAGE_AXIS));
Expand All @@ -182,7 +172,6 @@ private JComponent createReadyEnvView() {
return ComponentUtils.createUnsupportedPanel(readyEnvPanel);
}

@SuppressWarnings("UnstableApiUsage")
private JComponent createJcefNotSupportedView() {
JPanel jcefNotSupportedPanel = new JBPanel<>();
jcefNotSupportedPanel.setLayout(new BoxLayout(jcefNotSupportedPanel, BoxLayout.PAGE_AXIS));
Expand Down Expand Up @@ -248,7 +237,7 @@ private JComponent initVulnerabilityInfoBrowser() throws IOException, URISyntaxE
*/
private JComponent createComponentsTreeView() {
JPanel treePanel = new JBPanel<>(new GridLayout()).withBackground(UIUtil.getTableBackground());
TreeSpeedSearch treeSpeedSearch = new TreeSpeedSearch(componentsTree, ComponentUtils::getPathSearchString, true);
TreeSpeedSearch treeSpeedSearch = new TreeSpeedSearch(componentsTree, true, ComponentUtils::getPathSearchString);
treeSpeedSearch.getComponent().getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
treePanel.add(treeSpeedSearch.getComponent(), BorderLayout.WEST);
JScrollPane treeScrollPane = ScrollPaneFactory.createScrollPane(treePanel);
Expand All @@ -258,18 +247,15 @@ private JComponent createComponentsTreeView() {
}

private void updateIssueOrLicenseInWebview(IssueNode issueNode) {
if (issueNode instanceof VulnerabilityNode) {
VulnerabilityNode issue = (VulnerabilityNode) issueNode;
if (issueNode instanceof VulnerabilityNode issue) {
webviewManager.sendMessage(MessageType.SHOW_PAGE, WebviewObjectConverter.convertIssueToDepPage(issue));
} else if (issueNode instanceof ApplicableIssueNode) {
ApplicableIssueNode node = (ApplicableIssueNode) issueNode;
webviewManager.sendMessage(MessageType.SHOW_PAGE, WebviewObjectConverter.convertIssueToDepPage(node.getIssue()));
navigateToFile(node);
} else if (issueNode instanceof LicenseViolationNode) {
LicenseViolationNode license = (LicenseViolationNode) issueNode;
} else if (issueNode instanceof LicenseViolationNode license) {
webviewManager.sendMessage(MessageType.SHOW_PAGE, WebviewObjectConverter.convertLicenseToDepPage(license));
} else if (issueNode instanceof FileIssueNode) {
FileIssueNode node = (FileIssueNode) issueNode;
} else if (issueNode instanceof FileIssueNode node) {
webviewManager.sendMessage(MessageType.SHOW_PAGE, WebviewObjectConverter.convertFileIssueToIssuePage(node));
navigateToFile(node);
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/jfrog/ide/idea/ui/JFrogToolWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import com.intellij.ui.content.ContentManager;
import com.jfrog.ide.idea.log.Logger;
import org.jetbrains.annotations.NotNull;


Expand All @@ -26,7 +25,7 @@ void initToolWindow(@NotNull ToolWindow toolWindow, @NotNull Project project, bo
}

private void addContent(ContentManager contentManager, JFrogLocalToolWindow jfrogLocalContent, JFrogCiToolWindow jfrogBuildsContent) {
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
ContentFactory contentFactory = ContentFactory.getInstance();
Content localContent = contentFactory.createContent(jfrogLocalContent, "Local", false);
contentManager.addContent(localContent);
Content buildsContent = contentFactory.createContent(jfrogBuildsContent, "CI", false);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/jfrog/ide/idea/ui/utils/ComponentUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public static JLabel createDisabledTextLabel(String text) {
return label;
}

@SuppressWarnings("UnstableApiUsage")
public static JComponent createNoCredentialsView() {
JPanel noCredentialsPanel = new JBPanel<>();
noCredentialsPanel.setLayout(new BoxLayout(noCredentialsPanel, BoxLayout.PAGE_AXIS));
Expand Down Expand Up @@ -78,7 +77,6 @@ public static void addCenteredComponent(JPanel panel, JComponent component) {
panel.add(component);
}

@SuppressWarnings("UnstableApiUsage")
public static JComponent createNoBuildsView() {
HyperlinkLabel link = new HyperlinkLabel();
link.setTextWithHyperlink("No builds detected. To start viewing your builds please follow <hyperlink>this</hyperlink> guide.");
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
]]>
</change-notes>

<idea-version since-build="221.5080"/>
<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
@@ -1,6 +1,7 @@
package com.jfrog.ide.idea.scan;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.vfs.VirtualFile;
import com.jetbrains.python.packaging.PyPackage;
import com.jetbrains.python.packaging.PyPackageManager;
Expand All @@ -13,13 +14,17 @@
import java.util.List;
import java.util.Set;

public class DummyCircularDepSDK extends PyPackageManager {
public class DummyCircularDepPyPkgManager extends PyPackageManager {
public static final String DIRECT_DEPENDENCY_NAME = "root";
public static final String DIRECT_DEPENDENCY_VERSION = "1.0.0";
public static final String CIRCULAR_DEPENDENCY_A = "a";
public static final String CIRCULAR_DEPENDENCY_B = "b";
public static final String CIRCULAR_DEPENDENCY_VERSION = "2.0.0";

public DummyCircularDepPyPkgManager(@NotNull Sdk sdk) {
super(sdk);
}

@Override
public void installManagement() {

Expand Down
Loading