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

Release v5.0.1 #1905

Merged
merged 11 commits into from
Jul 19, 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
6 changes: 6 additions & 0 deletions CHANGE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

## v5.0.1

- Improved: performance of loading repositories with long git histories and a lot of red-edge branches
- Fixed: `Class initialization must not depend on services` error on IntelliJ 2024.2 EAP (reported by @fan-tom)

## v5.0.0
- Added support for IntelliJ 2024.2.
- Dropped support for IntelliJ 2022.2.
Note that the versions of this plugin published so far will remain available for download in IntelliJ 2022.2 indefinitely.
The change in the range of supported IntelliJ versions will only affect the new plugin releases, starting from this one.
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ ln -s ../../scripts/run-pre-build-checks .git/hooks/pre-commit

#### Windows
**The hooks do not work on Windows** (however, their execution seems to be possible theoretically).
This is because one may not be emulating bash environment in any way or doing it in some specific way.

#### macOS
Some hooks use `grep`. The macOS version of `grep` (FreeBSD) differs from GNU `grep`.
Expand Down
6 changes: 0 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,3 @@ vavr("test")
tasks.withType<Test> {
jvmArgs(getFlagsForAddExports("jdk.internal.reflect", module = "java.base"))
}

// TODO (JetBrains/intellij-platform-gradle-plugin#1675): workaround to prevent race condition on .../.intellijPlatform/coroutines-javaagent.jar
tasks.withType<Test> {
dependsOn(":frontend:graph:initializeIntellijPlatformPlugin")
dependsOn(":frontend:ui:initializeIntellijPlatformPlugin")
}
2 changes: 1 addition & 1 deletion buildSrc/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[libraries]
jsoup = "org.jsoup:jsoup:1.17.2"
jsoup = "org.jsoup:jsoup:1.18.1"
junit-api = "org.junit.jupiter:junit-jupiter-api:5.10.3"
# Plugin packages
# This way of applying the plugins was needed for the build-related code in buildSrc/src/main/,
Expand Down
10 changes: 0 additions & 10 deletions frontend/ui/impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ dependencies {
implementation(project(":frontend:ui:api"))
}

// TODO (JetBrains/intellij-platform-gradle-plugin#1675): workaround to prevent race condition on .../.intellijPlatform/coroutines-javaagent.jar
tasks.withType<Test> {
dependsOn(":initializeIntellijPlatformPlugin")
dependsOn(":frontend:actions:initializeIntellijPlatformPlugin")
dependsOn(":frontend:graph:initializeIntellijPlatformPlugin")
dependsOn(":frontend:graph:impl:initializeIntellijPlatformPlugin")
dependsOn(":frontend:ui:initializeIntellijPlatformPlugin")
dependsOn(":frontend:ui:impl:initializeIntellijPlatformPlugin")
}

apacheCommonsText()
junit()
junitPlatformLauncher()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ public final class BranchOrCommitCellRendererComponent extends SimpleColoredRend
private static final String CELL_TEXT_FRAGMENTS_SPACING = " ";
private static final String HEAVY_WIDE_HEADED_RIGHTWARDS_ARROW = "\u2794";

private static final IGraphCellPainterFactory graphCellPainterFactoryInstance = ApplicationManager.getApplication()
.getService(IGraphCellPainterFactory.class);

private final JTable graphTable;
private final BufferedImage graphImage;
private final MyTableCellRenderer myTableCellRenderer;
Expand Down Expand Up @@ -104,7 +101,7 @@ public BranchOrCommitCellRendererComponent(
}
this.graphImage = getGraphImage(graphTable, maxGraphNodePositionInRow);
Graphics2D g2 = graphImage.createGraphics();
val graphCellPainter = graphCellPainterFactoryInstance.create(table);
val graphCellPainter = ApplicationManager.getApplication().getService(IGraphCellPainterFactory.class).create(table);
graphCellPainter.draw(g2, renderParts);

this.myTableCellRenderer = new MyTableCellRenderer();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.virtuslab.gitmachete.frontend.ui.impl.table;

import static com.virtuslab.gitmachete.frontend.resourcebundles.GitMacheteBundle.getString;

import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.openapi.vcs.VcsNotifier;
import lombok.Getter;
import lombok.experimental.ExtensionMethod;

import com.virtuslab.gitmachete.frontend.resourcebundles.GitMacheteBundle;

@ExtensionMethod(GitMacheteBundle.class)
public class UnmanagedBranchNotification extends Notification {

@Getter
private final String branchName;

UnmanagedBranchNotification(String branchName) {
super(VcsNotifier.STANDARD_NOTIFICATION.getDisplayId(),
getString("action.GitMachete.EnhancedGraphTable.unmanaged-branch-notification.text").fmt(branchName),
NotificationType.INFORMATION);
this.branchName = branchName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationAction;
import com.intellij.notification.NotificationType;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.VcsNotifier;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.experimental.ExtensionMethod;
import lombok.val;
Expand Down Expand Up @@ -132,19 +129,4 @@ private NotificationAction getOpenMacheteFileAction() {
ActionManager.getInstance().getAction(OPEN_MACHETE_FILE).actionPerformed(actionEvent);
});
}

}

@ExtensionMethod(GitMacheteBundle.class)
class UnmanagedBranchNotification extends Notification {

@Getter
private final String branchName;

UnmanagedBranchNotification(String branchName) {
super(VcsNotifier.STANDARD_NOTIFICATION.getDisplayId(),
getString("action.GitMachete.EnhancedGraphTable.unmanaged-branch-notification.text").fmt(branchName),
NotificationType.INFORMATION);
this.branchName = branchName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
@CustomLog
@ToString(onlyExplicitlyIncluded = true)
public final class GitCoreRepository implements IGitCoreRepository {
/**
* Let's avoid loading too many commits when trying to find fork point.
* It's unlikely that anyone will have that many unique commits on a branch.
*/
private static final int MAX_ANCESTOR_COMMIT_COUNT = 100;

@Getter
@ToString.Include
private final Path rootDirectoryPath;
Expand Down Expand Up @@ -643,6 +649,6 @@ public Stream<IGitCoreCommit> ancestorsOf(IGitCoreCommit commitInclusive) throws
throw new GitCoreException(e);
}

return Stream.ofAll(walk).map(GitCoreCommit::new);
return Stream.ofAll(walk).take(MAX_ANCESTOR_COMMIT_COUNT).map(GitCoreCommit::new);
}
}
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ vavr = "io.vavr:vavr:0.10.4"
# where they aren't really `apply`-ed as plugins, but rather added to classpath as plugin packages;
# see https://docs.gradle.org/current/samples/sample_convention_plugins.html#things_to_note.
[plugins]
jetbrains-changelog = "org.jetbrains.changelog:2.2.0"
jetbrains-changelog = "org.jetbrains.changelog:2.2.1"
jetbrains-grammarkit = "org.jetbrains.grammarkit:2022.3.2.2"
jetbrains-intellij = "org.jetbrains.intellij.platform:2.0.0-beta8"
jetbrains-intellij = "org.jetbrains.intellij.platform:2.0.0-RC1"
taskTree = "com.dorongold.task-tree:4.0.0"
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 1 addition & 1 deletion intellij-versions.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
eapOfLatestSupportedMajor=242.19533.56-EAP-SNAPSHOT
eapOfLatestSupportedMajor=242.20224.91-EAP-SNAPSHOT
earliestSupportedMajor=2022.3
earliestSupportedMajorKotlinVersion=1.7
latestMinorsOfOldSupportedMajors=2022.3.3,2023.1.7,2023.2.7,2023.3.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.methods;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;

import com.tngtech.archunit.base.DescribedPredicate;
import com.tngtech.archunit.core.domain.JavaMethodCall;
import lombok.val;
import org.junit.jupiter.api.Test;

import com.virtuslab.gitmachete.backend.impl.GitMacheteRepositorySnapshot;
Expand All @@ -25,6 +28,24 @@ public void no_classes_should_call_AnActionEvent_getRequiredData() {
.check(productionClasses);
}

@Test
public void no_classes_should_call_Application_getService_from_static_initializer() {
noClasses()
.should()
.callMethodWhere(new DescribedPredicate<JavaMethodCall>("Application#getService is called from static initializer") {
@Override
public boolean test(JavaMethodCall javaMethodCall) {
val target = javaMethodCall.getTarget();
val origin = javaMethodCall.getOrigin();
return target.getOwner().isEquivalentTo(com.intellij.openapi.application.Application.class)
&& target.getName().equals("getService")
&& origin.getName().equals("<clinit>");
}
})
.because("class initialization must not depend on services since IntelliJ 2024.2")
.check(productionClasses);
}

@Test
public void no_classes_should_call_Collections_nCopies() {
noClasses()
Expand Down
2 changes: 1 addition & 1 deletion version.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
val prospectiveReleaseVersion by extra("5.0.0")
val prospectiveReleaseVersion by extra("5.0.1")