Skip to content

Commit

Permalink
[WINDUP-3561] - Update static reports to PF4 - mandatory reports (#1579)
Browse files Browse the repository at this point in the history
* Evaluate each XPath one by one

* Evaluate each XPath one by one

* Export labels api

* Remove initialization of fields

* Add applications working json

* Add files and issues

* Move code to module

* Add working API that match UI

* Add JS output

* Generate UI

* Add Windup generation URL to the output of the analysis

* Change phase

* Synch with master branch

* Allow minimize the RULES and FILES jsons adding getById endpoint

* Upgrade version

* Add total story points by issue

* Add dependencies report

* Add technologies

* Add ignored files

* Refactor Dto

* Add total incidents to the issues dto

* Add effort to issues

* Add package incidents

* Upgrade to 6.2.0-SNAPSHOT

* Add application details

* Add project site to application details

* Add prettyFileName field to FileDto.java

* Add tags service

* Allow window variables to have special characters

* Rename classes

* Add ui module

* Add gh action

* Change logos

* Enhance About modal and include version to it

* Add EJBs - needs finish progress

* Add Entity beans

* Add spring beans report

* Add remote services

* Add server resources report

* Add JPA reports

* Add hibernate report

* save changes

* Add unparsable files

* Add transaction reports

* Add transactions

* Select hint when issue opens  code editor

* Rules list

* ApplicationList: set correct app names amd add label to shared libraries

* ContextSelector: add bottom border to "All Applications" element

* Replace table spinner by skeleton loading

* EJB report split in tabs and not hide data

* Add export to csv feature

* Add "--legacyReports" parameter

* (fix): rule-list: clear result filter

* Import icons using PF4 standards

* (feat): allow mutiple themes

* Fix ui build

* Fix tests

* Fix tests: legacy reports

* Fix tests: legacy reports

* Save tests

* Add Hibernate and Exploded app tests

* Fix previous tests failing

* Add tests to WindupArchitectureJspTest

* Save changes

* Save changes

* Add WindupArchitectureMediumBinaryModeFernflowerTest

* Add WindupArchitectureMediumBinaryModeProcyonTest

* Add WindupArchitectureScanPackagesTest

* Add WindupArchitectureSeamBookingSourceTest

* Add WindupArchitectureSmallBinaryMode2Test

* Add WindupArchitectureSmallBinaryModeTest

* Add WindupArchitectureSoa5GatewaysRoutersTest

* Add WindupArchitectureSourceWithBadPOMTest

* Add WindupArchitectureSourceModeTest

* Add WindupArchitectureSpringSmallTest

* Add WindupArchitectureStopTest

* Add WindupArchitectureTestKeepArchivesAndGraphTest

* Add WindupCompiledWithSourceTest

* Add WindupRulesetMetadataTest

* Introduce lombok

* Add WindupMultiAppBasicTest

* Rename tests

* Add compatibleFiles and hardcoded ip reports

* Add JBPM report

* Rename UI files to avoid long names

* Rename PF4 by PF since the version of a library should not be part of the name

* Rename PF4 by PF since the version of a library should not be part of the name

* Enhance folder management for report folder

* Revert temp fix

* The header in the Technologies report should be "Technologies" and not "Dependencies"

* In the Project/Applications page, when you click on the number of incidents and a row with a breakdown of incidents by category appears, only Mandatory, Optional, Potential and Information category incidents are listed. Cloud-mandatory incidents for instance are not listed, so the total and sum of incidents listed do not match if these incidents are present in an analysis. Is it a design choice to only show the 'main' categories?

* In the Project/Applications page, when you click on the number of incidents and a row with a breakdown of incidents by category appears, only Mandatory, Optional, Potential and Information category incidents are listed. Cloud-mandatory incidents for instance are not listed, so the total and sum of incidents listed do not match if these incidents are present in an analysis. Is it a design choice to only show the 'main' categories?

* The size of the page in pagination resets itself each time a different filter is selected - maybe it should remain the same

* The Application messages section doesn't have a title

* The Tags found - Occurrence Found histograms are empty on the new reports at both at Application and Archive level

* Fix typo in CLI help message

* Sources/targets filters show all sources and targets, regardless of whether they have been triggered for the particular application or not. It should show only the ones triggered, otherwise it might get confusing

* Enhance FileId extraction

* There is no mention of duplicate archives in the Application details section (see figure 3.7)

* In the application dependencies area, for each dependency, "Found at path" only shows one path, instead of all the paths where the jar has been found

* Sorting in the issues page

* Build multiple themes at a single time

* Move all PF reports to the root folder rather than pf-reports folder

* Fix test

* Fix test

* Add links to Code viewer Hint

* Issues: filter by effort type rather than effort's description

* Project level, avoid including Virtual Apps in the Context selector and in the data processed

* Issues apply groupBy when all applications are selected

* WINDUP-3722 Added param to use 'search.maven.org' website

* Generate compatible files only when requested

* Add "multiple times included" label to app details

* Enhance issues rendering performance

* Add "All issues" support and reused csv from windup without generating a new one

* IssueCategory consistent labeling

* Fix tests after adding "All issues" data as a separate standalone data

* Adapt custom settings for prepare web-console to have dynamic loading of jsons

* Beautify toolbar separator

* Fix: issues page - multiple rows with same name expanded

* Enhance: render json files in parallel using ExecutorService

* Remove unused set of profiles

* local lib-ui

* Fix tests

* Rename WaitRuleProvider.java by DataGatheringRuleProvider.java

* Ensure flush and synchronized is done when writing windup.js

* Issues page: Enhance source/target filters inferred set of options

* App edit: Show tabs only when data is present

* Enhance file writing windup.js

* Issues: filter by source/target match same logic from old reports
  • Loading branch information
carlosthe19916 committed Mar 31, 2023
1 parent 739196f commit d619a09
Show file tree
Hide file tree
Showing 392 changed files with 55,667 additions and 169 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pr_build_ui.yml
@@ -0,0 +1,27 @@
name: Windup PR/Push UI

on:
pull_request:
branches:
- master
- 'releases/**'
push:
branches:
- master
- 'releases/**'

jobs:
ui-tests:
name: UI Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Build
working-directory: pf-ui/src/main/webapp
run: |
npm install
npm run build
13 changes: 13 additions & 0 deletions bom/pom.xml
Expand Up @@ -204,6 +204,14 @@
<version>${project.version}</version>
</dependency>

<!-- Windup Engine - Reporting Addon -->
<dependency>
<groupId>org.jboss.windup.reporting</groupId>
<artifactId>windup-reporting-data</artifactId>
<classifier>forge-addon</classifier>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.jboss.windup.rules.apps</groupId>
<artifactId>windup-rules-tattletale</artifactId>
Expand Down Expand Up @@ -318,6 +326,11 @@
<classifier>forge-addon</classifier>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.windup.reporting</groupId>
<artifactId>pf-windup-ui</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Windup Engine - Utils -->
<dependency>
Expand Down
@@ -0,0 +1 @@
window["WINDUP_THEME"] = "mta";
@@ -0,0 +1 @@
window["WINDUP_THEME"] = "mtr";
@@ -0,0 +1 @@
window["WINDUP_THEME"] = "tackle";
@@ -0,0 +1 @@
window["WINDUP_THEME"] = "windup";
@@ -0,0 +1,47 @@
package org.jboss.windup.config;

import org.jboss.windup.graph.model.WindupConfigurationModel;
import org.jboss.windup.util.ThemeProvider;

/**
* Indicates whether Windup processing should render legacy reports, otherwise new Patternfly 4 reports will be rendered.
*/
public class LegacyReportsRenderingOption extends AbstractConfigurationOption {
public static final String NAME = WindupConfigurationModel.LEGACY_REPORTS;

@Override
public String getDescription() {
return "If set, " + ThemeProvider.getInstance().getTheme().getBrandNameAcronym() + " generates legacy reports.";
}

@Override
public String getName() {
return NAME;
}

@Override
public String getLabel() {
return "Should " + ThemeProvider.getInstance().getTheme().getBrandNameAcronym() + " generate legacy reports?";
}

@Override
public Class<?> getType() {
return Boolean.class;
}

@Override
public InputType getUIType() {
return InputType.SINGLE;
}

@Override
public boolean isRequired() {
return false;
}

@Override
public ValidationResult validate(Object value) {
return ValidationResult.SUCCESS;
}

}
@@ -0,0 +1,17 @@
package org.jboss.windup.config.phase;

public class PostReportPfRenderingPhase extends RulePhase {
public PostReportPfRenderingPhase() {
super(PostReportPfRenderingPhase.class);
}

@Override
public Class<? extends RulePhase> getExecuteAfter() {
return ReportPfRenderingPhase.class;
}

@Override
public Class<? extends RulePhase> getExecuteBefore() {
return null;
}
}
@@ -0,0 +1,17 @@
package org.jboss.windup.config.phase;

public class PreReportPfRenderingPhase extends RulePhase {
public PreReportPfRenderingPhase() {
super(PreReportPfRenderingPhase.class);
}

@Override
public Class<? extends RulePhase> getExecuteAfter() {
return PostReportGenerationPhase.class;
}

@Override
public Class<? extends RulePhase> getExecuteBefore() {
return null;
}
}
@@ -0,0 +1,17 @@
package org.jboss.windup.config.phase;

public class ReportPfRenderingPhase extends RulePhase {
public ReportPfRenderingPhase() {
super(ReportPfRenderingPhase.class);
}

@Override
public Class<? extends RulePhase> getExecuteAfter() {
return PreReportPfRenderingPhase.class;
}

@Override
public Class<? extends RulePhase> getExecuteBefore() {
return null;
}
}
Expand Up @@ -3,6 +3,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Writer;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
Expand Down Expand Up @@ -30,6 +31,10 @@
public class TagService {
private final ConcurrentMap<String, Tag> definedTags = new ConcurrentHashMap<>();

public Collection<Tag> getAllTags() {
return definedTags.values();
}

/**
* Read the tag structure from the provided stream.
*/
Expand Down
Expand Up @@ -14,6 +14,7 @@
import org.jboss.windup.config.DefaultEvaluationContext;
import org.jboss.windup.config.GraphRewrite;
import org.jboss.windup.config.KeepWorkDirsOption;
import org.jboss.windup.config.LegacyReportsRenderingOption;
import org.jboss.windup.config.PreRulesetEvaluation;
import org.jboss.windup.config.RuleLifecycleListener;
import org.jboss.windup.config.RuleProvider;
Expand All @@ -25,9 +26,12 @@
import org.jboss.windup.config.metadata.TechnologyReference;
import org.jboss.windup.config.metadata.TechnologyReferenceAliasTranslator;
import org.jboss.windup.config.phase.PostReportGenerationPhase;
import org.jboss.windup.config.phase.PostReportPfRenderingPhase;
import org.jboss.windup.config.phase.PostReportRenderingPhase;
import org.jboss.windup.config.phase.PreReportGenerationPhase;
import org.jboss.windup.config.phase.ReportGenerationPhase;
import org.jboss.windup.config.phase.ReportPfRenderingPhase;
import org.jboss.windup.config.phase.PreReportPfRenderingPhase;
import org.jboss.windup.config.phase.ReportRenderingPhase;
import org.jboss.windup.exec.configuration.WindupConfiguration;
import org.jboss.windup.exec.configuration.options.ExcludeTagsOption;
Expand Down Expand Up @@ -286,25 +290,47 @@ private RuleLoaderContext configureRuleProviderAndTagFilters(RuleLoaderContext r
config.setRuleProviderFilter(providerFilter);
}

NotPredicate skipReportsProviderFilter;

Boolean skipReports = false;
// if skipReportsRendering option is set filter rules in related phases
if (config.getOptionMap().containsKey(SkipReportsRenderingOption.NAME)) {
skipReports = (Boolean) config.getOptionMap().get(SkipReportsRenderingOption.NAME);
}
if (skipReports) {
NotPredicate skipReportsProviderFilter = new NotPredicate(
new RuleProviderPhasePredicate(PreReportGenerationPhase.class, ReportGenerationPhase.class,
ReportRenderingPhase.class, PostReportGenerationPhase.class, PostReportRenderingPhase.class));
Predicate<RuleProvider> configuredProvider = config.getRuleProviderFilter();
Predicate<RuleProvider> providerFilter = new AndPredicate(skipReportsProviderFilter);
if (configuredProvider != null) {
providerFilter = new AndPredicate(configuredProvider, skipReportsProviderFilter);
skipReportsProviderFilter = new NotPredicate(new RuleProviderPhasePredicate(
PreReportGenerationPhase.class, ReportGenerationPhase.class, ReportRenderingPhase.class, PostReportGenerationPhase.class, PostReportRenderingPhase.class,
PreReportPfRenderingPhase.class, ReportPfRenderingPhase.class, PostReportPfRenderingPhase.class
));
} else {
Boolean legacyReports = false;
if (config.getOptionMap().containsKey(LegacyReportsRenderingOption.NAME)) {
legacyReports = (Boolean) config.getOptionMap().get(LegacyReportsRenderingOption.NAME);
}

LOG.info("Adding RuleProvider filter for skipping reports: " + providerFilter);
config.setRuleProviderFilter(providerFilter);
if (legacyReports) {
skipReportsProviderFilter = new NotPredicate(new RuleProviderPhasePredicate(
PreReportPfRenderingPhase.class,
ReportPfRenderingPhase.class,
PostReportPfRenderingPhase.class
));
} else {
skipReportsProviderFilter = new NotPredicate(new RuleProviderPhasePredicate(
ReportRenderingPhase.class,
PostReportRenderingPhase.class
));
}
}

Predicate<RuleProvider> configuredProvider = config.getRuleProviderFilter();
Predicate<RuleProvider> providerFilter = new AndPredicate(skipReportsProviderFilter);
if (configuredProvider != null) {
providerFilter = new AndPredicate(configuredProvider, skipReportsProviderFilter);
}

config.setRuleProviderFilter(providerFilter);
LOG.info("Adding RuleProvider filter for skipping reports: " + providerFilter);

return new RuleLoaderContext(ruleLoaderContext.getContext(), ruleLoaderContext.getRulePaths(), config.getRuleProviderFilter());
}

Expand Down
Expand Up @@ -29,6 +29,7 @@ public interface WindupConfigurationModel extends WindupVertexFrame {
String SKIP_REPORTS_RENDERING = "skipReports";
String SKIP_SOURCE_CODE_REPORTS_RENDERING = "skipSourceCodeReports";
String ANALYZE_KNOWN_LIBRARIES = "analyzeKnownLibraries";
String LEGACY_REPORTS = "legacyReports";

/**
* The input path to scan
Expand Down
50 changes: 50 additions & 0 deletions pf-ui/README.md
@@ -0,0 +1,50 @@
# Windup UI

Next generation of Reports for Windup.

## Enable

Execute

```
npm run build
```

Copy all api json files to the folder `build/api/`

Execute

```
node server.js
```

Open the file `.env.develop` and set `REACT_APP_DATA_SOURCE=""`

start the UI

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

0 comments on commit d619a09

Please sign in to comment.