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

#142 and #94: Plugin based commandlet feature and PluginBasedCommandlet #153

Closed
wants to merge 12 commits into from

Conversation

diiinesh
Copy link
Contributor

@diiinesh diiinesh commented Dec 11, 2023

fixes #142:

  • created an abstract class "PluginBasedCommandlet" with all the plugin releated functions

fixes #94

  • modified getPluginsMap function, such that plugins can be processed with higher priority in user home directory

…nction, such that user can configure plugins in their home directory as well
…nction, such that user can configure plugins in their home directory as well
@diiinesh diiinesh changed the title Plugin based commandlet feature #142 and #94: Plugin based commandlet feature and PluginBasedCommandlet Dec 11, 2023
Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diiinesh I am aware this is still in draft. However, due to a question I was asked to answer in this PR I already looked at your code.
You did a good job and are very close to the final result. 👍
IMHO you can address my review comments and then take this PR out of draft mode and move it to the review so it can get merged.

…uginBasedCommandlet,

also changed method of getting home directory
@diiinesh diiinesh marked this pull request as ready for review December 15, 2023 13:06
@diiinesh diiinesh self-assigned this Dec 15, 2023
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 7222434854

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 32 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 47.856%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 32 6.49%
Totals Coverage Status
Change from base Build 7220702365: -0.02%
Covered Lines: 2719
Relevant Lines: 5455

💛 - Coveralls

@diiinesh diiinesh assigned hohwille and unassigned diiinesh Jan 15, 2024
Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diiinesh thanks for your PR.
It seems that git did play some trick on you and something went wrong in this PR reverting lots of changes/improvements that others have done by accident.
Please have a look. See also PR #141

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your IDE settings are outdated/incorrect. Star-Imports are discouraged. According to our IDE settings this should also be auto-configured correctly for Intellij (maybe ask @jan-vcapgemini if it is not working for you) and for Eclipse it was correct from the beginning.

Comment on lines -70 to -95
/**
* Test of {@link EnvironmentCommandlet} run.
*/
@Test
public void testRun() {

// arrange
String path = "workspaces/foo-test/my-git-repo";
IdeTestContext context = newContext("basic", path, false);
EnvironmentCommandlet env = context.getCommandletManager().getCommandlet(EnvironmentCommandlet.class);
// act
env.run();
// assert
assertLogMessage(context, IdeLogLevel.INFO, "MVN_VERSION=3.9.*");
assertLogMessage(context, IdeLogLevel.INFO, "SOME=some-${UNDEFINED}");
assertLogMessage(context, IdeLogLevel.INFO, "BAR=bar-some-${UNDEFINED}");
assertLogMessage(context, IdeLogLevel.INFO, "IDE_TOOLS=mvn,eclipse");
assertLogMessage(context, IdeLogLevel.INFO, "ECLIPSE_VERSION=2023-03");
assertLogMessage(context, IdeLogLevel.INFO, "FOO=foo-bar-some-${UNDEFINED}");
assertLogMessage(context, IdeLogLevel.INFO, "JAVA_VERSION=17*");
assertLogMessage(context, IdeLogLevel.INFO, "INTELLIJ_EDITION=ultimate");
assertLogMessage(context, IdeLogLevel.INFO, "DOCKER_EDITION=docker");
}
/**
* Test of {@link EnvironmentCommandlet} does not require home.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your commit is removing and reverting a lot of things that seems to be undesired.
I already reverted some things in the browser but that is rather tedious.
IMHO you did something wrong with git here to lose/revert changes that had made by others as improvements.
See also entire removal of ConextCommandletTest.java what is IMHO a mistake.
I already reverted the removal of the coverall stuff added by Moritz.

Comment on lines +29 to +36
@Test
public void testGetPluginsMap() {





}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not seem to be complete.
Why is a @test annotation inside a Commandlet? This does not make sense.
Either this is a test so it may extend Assertions or other test-classes or it is a commandlet but not a test.

Comment on lines -53 to -71
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was added by Moritz on purpose. Do not remove.

assertThat(help.isIdeHomeRequired()).isFalse();
assertThat(help.isIdeHomeRequired()).isEqualTo(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was also an improvement that you are reverting.

@@ -10,7 +10,6 @@ image:https://img.shields.io/github/license/devonfw/IDEasy.svg?label=License["Ap
image:https://img.shields.io/maven-central/v/com.devonfw.tools.ide/ide-cli.svg?label=Maven%20Central["Maven Central",link=https://search.maven.org/search?q=g:com.devonfw.tools.ide]
image:https://github.com/devonfw/IDEasy/actions/workflows/build.yml/badge.svg["Build Status",link="https://github.com/devonfw/IDEasy/actions/workflows/build.yml"]
image:https://github.com/devonfw/IDEasy/actions/workflows/update-urls.yml/badge.svg["Update URLS Status",link="https://github.com/devonfw/IDEasy/actions/workflows/update-urls.yml"]
image:https://coveralls.io/repos/github/devonfw/IDEasy/badge.svg?branch=main["Coverage Status",link="https://coveralls.io/github/devonfw/IDEasy?branch=main"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please keep this badge added by Moritz for the coverage.

@hohwille
Copy link
Member

To avoid double effort, I will close this PR and we concentrate on PR #141 that includes the changes of this PR and already fixed some of the problems.

@hohwille hohwille closed this Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Implement PluginBasedCommandlet Ability to define plugins in user config
3 participants