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

fix(intellij): Update intellij version #201

Merged
merged 1 commit into from
Sep 2, 2024
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
10 changes: 5 additions & 5 deletions ide_extension/intellij/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp")
implementation("org.jetbrains:annotations:24.1.0")

compileOnly("org.projectlombok:lombok:1.18.32")
annotationProcessor("org.projectlombok:lombok:1.18.32")
compileOnly("org.projectlombok:lombok:1.18.34")
annotationProcessor("org.projectlombok:lombok:1.18.34")

testCompileOnly("org.projectlombok:lombok:1.18.32")
testAnnotationProcessor("org.projectlombok:lombok:1.18.32")
testCompileOnly("org.projectlombok:lombok:1.18.34")
testAnnotationProcessor("org.projectlombok:lombok:1.18.34")

testImplementation("org.mockito:mockito-core:5.12.0")
testImplementation("org.mockito:mockito-core:5.13.0")

implementation(platform("com.squareup.okhttp3:okhttp-bom:4.12.0"))
}
Expand Down
2 changes: 1 addition & 1 deletion ide_extension/intellij/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pluginSinceBuild=241
pluginUntilBuild=242.*
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType=IC
platformVersion=2024.1.4
platformVersion=2024.2.1
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
platformPlugins=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import co.com.bancolombia.devsecopsenginetools.tasks.ScanIacTask;
import co.com.bancolombia.devsecopsenginetools.ui.tool.LogPanelLogger;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
Expand All @@ -15,6 +16,8 @@

import javax.swing.*;

import static com.intellij.openapi.actionSystem.ActionUpdateThread.BGT;

public class ScanIacAction extends AnAction {
private boolean isTaskRunning = false;

Expand Down Expand Up @@ -43,6 +46,11 @@ public void actionPerformed(AnActionEvent e) {
}
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return BGT;
}

@Override
public void update(@NotNull AnActionEvent e) {
Presentation presentation = e.getPresentation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import co.com.bancolombia.devsecopsenginetools.tasks.ScanImageTask;
import co.com.bancolombia.devsecopsenginetools.ui.tool.LogPanelLogger;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
Expand All @@ -15,6 +16,8 @@

import javax.swing.*;

import static com.intellij.openapi.actionSystem.ActionUpdateThread.BGT;

public class ScanImageAction extends AnAction {
private boolean isTaskRunning = false;

Expand Down Expand Up @@ -43,6 +46,11 @@ public void actionPerformed(AnActionEvent e) {
}
}

@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return BGT;
}

@Override
public void update(@NotNull AnActionEvent e) {
Presentation presentation = e.getPresentation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.intellij.ui.components.JBPanel;
import com.intellij.ui.components.JBScrollPane;
import lombok.SneakyThrows;
import lombok.extern.log4j.Log4j2;
import lombok.extern.java.Log;

import javax.swing.*;
import javax.swing.text.AttributeSet;
Expand All @@ -19,10 +19,11 @@
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Log4j2
@Log
public class LogPanel extends JBPanel<LogPanel> {
private final transient StyledDocument doc;
private final JTextPane textPane;
Expand Down Expand Up @@ -56,7 +57,7 @@ public void appendText(String message, String color) {
try {
parseAndAppend("\033[" + color + "m" + message + "\033[0m\n");
} catch (BadLocationException e) {
log.warn("Error appending text", e);
log.log(Level.WARNING, "Error appending text", e);
}
}

Expand Down Expand Up @@ -176,7 +177,7 @@ private String getText(Element element) {
return textPane.getDocument().getText(element.getStartOffset(),
element.getEndOffset() - element.getStartOffset()).trim();
} catch (BadLocationException e) {
log.warn("Error getting text from element", e);
log.log(Level.WARNING, "Error getting text from element", e);
return null;
}
}
Expand All @@ -185,7 +186,7 @@ private void openLink(String link) {
try {
Desktop.getDesktop().browse(new URI(link));
} catch (Exception e) {
log.warn("Error opening link: {}", link, e);
log.log(Level.WARNING, "Error opening link: " + link, e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
import com.intellij.ui.content.ContentFactory;
import lombok.AccessLevel;
import lombok.Setter;
import lombok.extern.log4j.Log4j2;
import lombok.extern.java.Log;
import org.jetbrains.annotations.NotNull;

import java.awt.*;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.logging.Level;

@Log4j2
@Log
public class LogPanelLogger implements ToolWindowFactory, DumbAware {
protected static final String TOOL_WINDOW_ID = "DevSecOps Engine Tools";

Expand Down Expand Up @@ -96,7 +97,7 @@ public static void activate(Project project) {
toolWindow.activate(() -> {
}, true, true);
} catch (Exception e) {
log.warn("Error activating tool window", e);
log.log(Level.WARNING, "Error activating tool window", e);
}
}
}
Expand All @@ -110,6 +111,7 @@ public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindo
.createActionToolbar("LogPanelToolbar", actionGroup, false);

LogPanel logPanel = new LogPanel();
actionToolbar.setTargetComponent(logPanel);
logPanel.add(actionToolbar.getComponent(), BorderLayout.WEST);
ContentFactory contentFactory = ContentFactory.getInstance();
Content content = contentFactory.createContent(logPanel, "Scan Output", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
import co.com.bancolombia.devsecopsenginetools.utils.FileUtils;
import co.com.bancolombia.devsecopsenginetools.utils.http.HttpClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import lombok.extern.java.Log;

import java.util.Optional;
import java.util.logging.Level;

@Log4j2
@Log
@RequiredArgsConstructor
public class DockerLatestImage {
private final GlobalSettings settings;
Expand Down Expand Up @@ -39,7 +40,7 @@ private Optional<String> getLatestTag() {
return Optional.of(tags.getResults().get(0).getName());
}
} catch (Exception ex) {
log.info("Error getting latest image tag: ", ex);
log.log(Level.ALL, "Error getting latest image tag: ", ex);
LogPanelLogger.warn("Error getting latest image, current will be used", ex);
}
return Optional.empty();
Expand Down
Loading