Skip to content

Commit

Permalink
[RFR] Fix Apache wicket app analysis failure (#213)
Browse files Browse the repository at this point in the history
* Update Analysis issues

Signed-off-by: Nandini Chandra <[email protected]>

* Update Incidents

Signed-off-by: Nandini Chandra <[email protected]>

* Update Incidents for Analysis issues

Signed-off-by: Nandini Chandra <[email protected]>

* Move application initilaization out of test file

Signed-off-by: Nandini Chandra <[email protected]>

* Move application initilaization out of test file

Signed-off-by: Nandini Chandra <[email protected]>

* Remove redundant lines

Signed-off-by: Nandini Chandra <[email protected]>

* Import required packages

Signed-off-by: Nandini Chandra <[email protected]>

---------

Signed-off-by: Nandini Chandra <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
  • Loading branch information
nachandr authored and web-flow committed Nov 20, 2024
1 parent 73cb109 commit 79ad447
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 25 deletions.
72 changes: 48 additions & 24 deletions analysis/tc_apache_wicket.go
Original file line number Diff line number Diff line change
@@ -1,37 +1,61 @@
package analysis

import "github.com/konveyor/tackle2-hub/api"
import (
"github.com/konveyor/go-konveyor-tests/data"
"github.com/konveyor/go-konveyor-tests/hack/addon"
"github.com/konveyor/tackle2-hub/api"
)

var ApacheWicket = TC{
Name: "Apache Wicket",
Application: api.Application{
Name: "Apache Wicket app",
Repository: &api.Repository{
Kind: "git",
URL: "https://github.com/windup/windup-sample-apps.git",
Path: "test-files/src_example/org/apache/wicket",
},
},
Application: data.ApacheWicket,
Task: Analyze,
ReportContent: map[string][]string{
"/windup/report/index.html": {
"5\nstory points",
Labels: addon.Labels{
Included: []string{
"konveyor.io/target=cloud-readiness",
},
},
Targets: []string{
"cloud-readiness",
},
Analysis: api.Analysis{
Effort: 5,
Effort: 10,
Issues: []api.Issue{
{Category: "cloud-mandatory", Description: "Trivial change or 1-1 library swap", Effort: 2, Name: "File system - Java IO"},
{Category: "cloud-mandatory", Description: "Trivial change or 1-1 library swap", Effort: 3, Name: "Hard-coded IP address"},
{Category: "information", Description: "Info", Effort: 0, Name: "Java Servlet"},
{Category: "information", Description: "Info", Effort: 0, Name: "Threads"},
{
Category: "mandatory",
Effort: 1,
Description: "Hardcoded IP Address",
RuleSet: "discovery-rules",
Rule: "hardcoded-ip-address",
Incidents: []api.Incident{
{
File: "/shared/source/windup-sample-apps/test-files/src_example/org/apache/wicket/protocol/http/mock/MockHttpServletRequest.java",
Line: 51,
Message: "When migrating environments, hard-coded IP addresses may need to be modified or eliminated.",
},
{
File: "/shared/source/windup-sample-apps/test-files/src_example/org/apache/wicket/protocol/http/mock/MockHttpServletRequest.java",
Line: 584,
Message: "When migrating environments, hard-coded IP addresses may need to be modified or eliminated.",
},
{
File: "/shared/source/windup-sample-apps/test-files/src_example/org/apache/wicket/protocol/http/mock/MockHttpServletRequest.java",
Line: 587,
Message: "When migrating environments, hard-coded IP addresses may need to be modified or eliminated.",
},
},
},
{
Category: "mandatory",
Effort: 7,
Description: "Local HTTP Calls",
RuleSet: "cloud-readiness",
Rule: "localhost-http-00001",
Incidents: []api.Incident{
{
File: "/shared/source/windup-sample-apps/test-files/src_example/org/apache/wicket/protocol/http/mock/MockHttpServletRequest.java",
Line: 362,
Message: "The app is trying to access local resource by HTTP, please try to migrate the resource to cloud",
},
},
},
},
},
AnalysisTags: []api.Tag{
{Name: "Servlet"},
{Name: "Java Threads"},
},
}
10 changes: 9 additions & 1 deletion data/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ var (
URL: "https://github.com/WASdev/sample.daytrader7.git",
},
}
ApacheWicket = api.Application{
Name: "Apache Wicket",
Repository: &api.Repository{
Kind: "git",
URL: "https://github.com/windup/windup-sample-apps.git",
Path: "test-files/src_example/org/apache/wicket",
},
}

// Binary applications
TackleTestappPublicBinary = api.Application{
Expand All @@ -68,5 +76,5 @@ var (
}

ApplicationSamples = []api.Application{Minimal, PathfinderGit, BookServer, TackleTestappPublic,
CustomerTomcatLegacy, Coolstore, Daytrader, TackleTestappPublicBinary, UploadBinary}
CustomerTomcatLegacy, Coolstore, Daytrader, ApacheWicket, TackleTestappPublicBinary, UploadBinary}
)

0 comments on commit 79ad447

Please sign in to comment.