Git Product home page Git Product logo

fabric8-analytics-devstudio-plugin's Introduction

Dependency Analytics

'Dependency Analytics Report' with Insights about your application dependencies: * Flags a security vulnerability(CVE) and suggests a remedial version * Shows Github popularity metrics along with latest version * Suggests a project level license, check for conflicts between dependency licences * AI based guidance for additional, alternative dependencies

Supported Languages

'Dependency Analytics' extension supports projects using Maven.

Red Hat Dependency Analytics Eclipse Plugin

This plugin adds support of Dependency Analytics in Eclipse based IDE’s such as Devstudio.

Usage

  • Import a project

  • Open manifest file (errors will show the component analyses)

  • For Stack Analyses, right click on pom.xml and click Stack Analyses

Installation

installation

Features

  • This Plugin helps to analyze your application stack on manifest level.

generate manifest_level

  • The Plugin also analyzes stack at workspace level

project_stack stack_menu

  • Another feature includes analyses of components of application stack as and when you type.

componentAnalyses

CA

fabric8-analytics-devstudio-plugin's People

Contributors

dependabot[bot] avatar geetikabatra avatar invinciblejai avatar jeffmaury avatar ljelinkova avatar nickboldt avatar odockal avatar rawagner avatar sbouchet avatar vprusa avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fabric8-analytics-devstudio-plugin's Issues

Do not unnecessarily export packages in MANIFEST.MF

This plugin is not responsible for exporting http packages to others.
The only candidate for export is com.redhat.fabric8analytics.lsp.eclipse, but unless some other plugin actually consumes it, that's unnecessary. Once you add a test plugin, that needs access to com.redhat.fabric8analytics.lsp.eclipse classes, then it might be useful.

TLD;DR : don't export anything

Remove libraries folder

It would be better to find appropriate Eclipse bundles and depend on them instead of storing libraries in github and packaging them into the f8 plugin..

For example. instead of including httpclient-4.5.jar you can specify org.apache.httpcomponents.httpclient as a dependency in the manifest file.

Use OSIO token for authorization.

The authentication needs to be enabled using OSIO icon. On clicking OSIO token, a preference page should come up which contains information about the services that would be enables on logging into OSIO.

Cannot run language server if the Eclipse's path contains spaces

When the installation directory of Eclipse contains spaces in its name, the server will fail to start because of the following exception:

java.net.URISyntaxException: Illegal character in path at index 36: file:/home/ljelinko/programs/jbt/4.5 + F8/../../../git/fabric8-analytics-devstudio-plugin/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/fabric8-analytics-lsp-server-test-devstudio/output/server.js at java.net.URI$Parser.fail(URI.java:2848) at java.net.URI$Parser.checkChars(URI.java:3021) at java.net.URI$Parser.parseHierarchical(URI.java:3105) at java.net.URI$Parser.parse(URI.java:3053) at java.net.URI.<init>(URI.java:588) at java.net.URL.toURI(URL.java:946) at com.redhat.fabric8analytics.lsp.eclipse.ui.Fabric8AnalyticsStreamConnectionProvider.<init>(Fabric8AnalyticsStreamConnectionProvider.java:47) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184) at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905) at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243) at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55) at org.eclipse.lsp4e.LanguageServersRegistry$ExtensionLanguageServerDefinition.createConnectionProvider(LanguageServersRegistry.java:102) at org.eclipse.lsp4e.ProjectSpecificLanguageServerWrapper.<init>(ProjectSpecificLanguageServerWrapper.java:142) at org.eclipse.lsp4e.LanguageServiceAccessor.getLSWrapperForConnection(LanguageServiceAccessor.java:199) at org.eclipse.lsp4e.LanguageServiceAccessor.getLSWrappers(LanguageServiceAccessor.java:163) at org.eclipse.lsp4e.LanguageServiceAccessor.getLSPDocumentInfosFor(LanguageServiceAccessor.java:261) at org.eclipse.lsp4e.ConnectDocumentToLanguageServerSetupParticipant$1.run(ConnectDocumentToLanguageServerSetupParticipant.java:74) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

Implement token access through an extension point/OSGI service

As of yet, the token is managed through an Eclipse preference which has the following drawbacks:

  • security: it should be stored in secured storage as this is a sensitive data
  • it forces user to find the token in the OSIO UI and it is a bad UX

As DevStudio/JBossTools team will force as part of the Freesia release train on implementing OSIO login, it would be nice that the LSP plugin get access to the token through an extension point/OSGI service (that will be implemented of course by DevStudio/JBossTools team).
So the behaviour would be:

  • if there is an extension point implementation/OSGI service found, call it to get the token
  • if not use the current implementation

Add some notification to user why Openshift.io login is displayed

When user opens pom.xml file, the OpenShift.io login is displayed immediately. This is quite confusing. User should be informed that the Fabric8 analyses needs to login into OpenShift.io and asked, if he/she wants to log in.

Note that this will need change of OpenShift.io plugin API.

Integration with crowd sourcing intent api

Next task in Devstudio involves integration of crowd sourcing api with Devstudio, where user will be asked to tag the components, user can skip if he wishes.
This will involve removal of Eclipse job which is implementing a counter to check if the response if stack report is available.

Devstudio Production Ready

  • Create and update site for the plugin
  • Trigger analyses on Jenkins
  • Upload the plugin on download.jboss.org

Lookup of project wide manifest files to utilize multi maven support in stack analyses.

Currently the the lookup method only picks the main manifest file. An iterative way to find manifest files was worked upon in this commit. https://github.com/fabric8-analytics/fabric8-analytics-devstudio-plugin/commit/4e76647b4a7ed203e61ff442e1f1c8a9a49aa236#diff-abfa82c1af087068576ffd6394382b29R72

But this doesn't sound feasible for large scale projects.

Reference Issue #28

Core plugin depends on UI

When building I see this warning:

[WARNING] Rule 0: org.jboss.tools.releng.CoreUIDependency failed with message:
[CoreUIDependency] com.redhat.fabric8analytics.lsp.eclipse.core is a Core plugin, but depends on these UI plugins directly or transitively:
> org.eclipse.ui

You should seek to move all UI functionality to the .ui plugin, out of the .core one.

Fabric8 error markers stay visible after the analyses are disabled

Steps:

  1. Make sure you have analyses enabled
  2. Open pom file with some security problem
  3. The error markers should be visible in Problems view
  4. Go to Preferences -> Fabric8 and disable code analyses

RESULT: The LSP server is stopped (you can see it in Eclipse log) but the error markers are still visible

Force stop of LSP server throws Exception.

Force stopping lsp server like this https://github.com/fabric8-analytics/fabric8-analytics-devstudio-plugin/blob/master/plugins/com.redhat.fabric8analytics.lsp.eclipse.ui/src/com/redhat/fabric8analytics/lsp/eclipse/ui/Fabric8AnalyticsStreamConnectionProvider.java#L71-L72

Throws Exceptions like these
!ENTRY org.eclipse.lsp4e 4 0 2018-01-02 18:04:23.321 !MESSAGE Analyses Disabled !STACK 0 java.io.IOException: Analyses Disabled at com.redhat.fabric8analytics.lsp.eclipse.ui.Fabric8AnalyticsStreamConnectionProvider.start(Fabric8AnalyticsStreamConnectionProvider.java:73) at org.eclipse.lsp4e.LanguageServerWrapper.start(LanguageServerWrapper.java:174) at org.eclipse.lsp4e.LanguageServerWrapper.getInitializedServer(LanguageServerWrapper.java:458) at org.eclipse.lsp4e.LanguageServerWrapper.getServer(LanguageServerWrapper.java:442) at org.eclipse.lsp4e.LanguageServiceAccessor.getLSPDocumentInfosFor(LanguageServiceAccessor.java:357) at org.eclipse.lsp4e.ConnectDocumentToLanguageServerSetupParticipant$1.run(ConnectDocumentToLanguageServerSetupParticipant.java:74) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
.
@ljelinkova has followed up with LSP4E team and has suggested some changes, but I don't think these changes will be incorporated any time soon.

Change the lookup of Maven pom files

While current solution works on small scale projects, it would not work on a large ones (like the whole wildfly project for example).

There should be a possibility to get the list of maven pom files from the maven plugin.

Exception when running stack analyses

I get an exception when I run the analyses, then close the Stack analyses view and run the analyses again.

Steps to reproduce:

  1. Right click some maven project and select Stack analyses
  2. The Stack analyses view should appear
  3. Close the view
  4. Right click the same project and run the analyses again
    RESULT: The following exception is in error log

org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(SWT.java:4533) at org.eclipse.swt.SWT.error(SWT.java:4448) at org.eclipse.swt.SWT.error(SWT.java:4419) at org.eclipse.swt.widgets.Widget.error(Widget.java:487) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:424) at org.eclipse.swt.browser.Browser.checkWidget(Browser.java:207) at org.eclipse.swt.browser.Browser.setUrl(Browser.java:1145) at com.redhat.fabric8analytics.lsp.eclipse.CustomView$1.run(CustomView.java:61) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4497) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4110) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1044) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1499) at org.eclipse.equinox.launcher.Main.main(Main.java:1472)

Move all internal classes to an *.internal package

In some conventions, non API classes are usually kept under *.internal packages. It makes accidental public exposure of internal stuff less likely.
I recommend moving all internal classes to com.redhat.fabric8analytics.lsp.eclipse.internal. Anything that should be considered API can be left in the current package.
Only public packages should be exported in the manifest. See #36

Improve StackAnalyses view by adding more information

At the moment, the Stack Analyses view has only 3 states

  • empty
  • loading
  • displaying stack analyses

Instead of empty view there should be information how you can run analyses or some button to run analyses over the whole workspace on one click. Also, when analyses is aborted by timeout or an exception occurs, the view should display some message.

Exception handling

All exceptions should be properly handled - either the user should be informed that something went wrong (e.g. cannot connect to server) or it should be at least logged into the Eclipse error log.

Improve error handling in case 'node' is not installed

If the node is not installed, an error message is displayed to user but it is covered by login window to OSIO. This is unnecessary. If node is not installed, the server should be disabled and no login should be attempted.

LSP server authentification

I'd like to ask about the need of authentication in fabric8 lsp server. Is it necessary to provide the user's token to run the server? Could it be changed to some anonymous mode?

The reason I am asking is that it complicates things quite a lot in Devstudio plugin.

First of all, the user might not want to login into OSIO at first. But the plugin will ask him to do so on every open of pom file. This would be very annoying so in order to prevent it we set an eclipse preference "Fabric8 analyses enabled" to false. User then needs to go to Eclipse Preferences in order to enable the analyses again and login into OSIO. But would he ever do that? If there was no OSIO login needed the analyses would work right away.

There are also other areas that will not be covered at all

  • user deletes his/her token
  • token is expired

How is this done in Visual studio plugin?

@invincibleJai @geetikabatra

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.