Skip to content

Commit

Permalink
Revert "Moved binary analysis to TIER0 (#161)"
Browse files Browse the repository at this point in the history
This reverts commit d62b5f8.
  • Loading branch information
aufi committed Sep 3, 2024
1 parent d62b5f8 commit ae927eb
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 26 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ VENDOR_DIR ?= /tmp/konveyor-vendor
ARCH ?= amd64
JUNIT_REPORT_DIR ?= /tmp/junit-report

# Set MAVEN_TESTAPP_USER to the value of GITHUB_USER if GITHUB_USER is defined
MAVEN_TESTAPP_USER ?= $(GITHUB_USER)
MAVEN_TESTAPP_TOKEN ?= $(GITHUB_TOKEN)


# Setup local minikube with tackle - work in progress (TODO: enable auth)
# This is for local setup, CI uses shared github actions
setup:
Expand Down Expand Up @@ -43,9 +48,9 @@ test-tier2:

# TIER3
test-tier3:
TIER3=1 MAVEN_TESTAPP_USER='$(MAVEN_TESTAPP_USER)' MAVEN_TESTAPP_TOKEN='$(MAVEN_TESTAPP_TOKEN)' $(MAKE) test-analysis
$(MAKE) test-jira
$(MAKE) test-migrationwave
TIER3=1 $(MAKE) test-analysis

#
# Feature tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"github.com/konveyor/tackle2-hub/api"
)

var TackleTestappPublicBinary = TC{
var TackleTestappPrivateBinary = TC{
Name: "tackle-testapp-binary",
Application: data.TackleTestappPublic,
Application: data.TackleTestapp,
Identities: []api.Identity{
identity.MavenPublic,
identity.TackleTestappMaven,
},
Task: Analyze,
Labels: addon.Labels{
Expand Down
113 changes: 113 additions & 0 deletions analysis/tc_tackle_testapp_public.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package analysis

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

var TackleTestApp = api.Application{
Name: "Tackle Testapp public",
Repository: &api.Repository{
Kind: "git",
URL: "https://github.com/konveyor/tackle-testapp-public",
},
}

var TackleTestappPublic = TC{
Name: "Tackle Testapp public",
Application: TackleTestApp,
Task: Analyze,
WithDeps: false,
Labels: addon.Labels{
Included: []string{
"konveyor.io/target=cloud-readiness",
"konveyor.io/target=linux",
},
},
Identities: []api.Identity{},
Analysis: api.Analysis{
Effort: 8,
Issues: []api.Issue{
{
Category: "mandatory",
Description: "Hardcoded IP Address\nWhen migrating environments, hard-coded IP addresses may need to be modified or eliminated.",
Effort: 1,
RuleSet: "discovery-rules",
Rule: "hardcoded-ip-address",
Incidents: []api.Incident{
{
File: "/shared/source/tackle-testapp-public/src/main/resources/persistence.properties",
Line: 2,
Message: "When migrating environments, hard-coded IP addresses may need to be modified or eliminated.",
CodeSnip: "jdbc.url=jdbc:oracle:thin:@10.19.2.93:15",
},
},
},
{
Category: "mandatory",
Description: "File system - Java IO\nAn application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
Effort: 1,
RuleSet: "openshift",
Rule: "local-storage-00001",
Incidents: []api.Incident{
{
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 45,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "dataSource.setDriverClassName(config.getProperty(\"jdbc.driverClassName\"));",
},
{
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 46,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "dataSource.setUrl(config.getProperty(\"jdbc.url\"));",
},
{
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 47,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "dataSource.setUsername(config.getProperty(\"jdbc.user\"));",
},
{
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 48,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "dataSource.setPassword(config.getProperty(\"jdbc.password\"));",
},
{
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 56,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "transactionManager.setEntityManagerFactory(",
},
{
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 68,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "hibernateProperties.setProperty(\"hibernate.hbm2ddl.auto\", config.getProperty(\"hibernate.hbm2ddl.auto\"));",
},
{
File: "/shared/source/tackle-testapp-public/src/main/java/io/konveyor/demo/ordermanagement/config/PersistenceConfig.java",
Line: 69,
Message: "An application running inside a container could lose access to a file in local storage.. Recommendations. The following recommendations depend on the function of the file in local storage:. * Logging: Log to standard output and use a centralized log collector to analyze the logs.. * Caching: Use a cache backing service.. * Configuration: Store configuration settings in environment variables so that they can be updated without code changes.. * Data storage: Use a database backing service for relational data or use a persistent data storage system.. * Temporary data storage: Use the file system of a running container as a brief, single-transaction cache.",
CodeSnip: "hibernateProperties.setProperty(\"hibernate.dialect\", config.getProperty(\"hibernate.dialect\"));",
},
},
},
},
},
AnalysisTags: []api.Tag{
{Name: "EJB XML", Category: api.Ref{Name: "Bean"}},
{Name: "Servlet", Category: api.Ref{Name: "HTTP"}},
{Name: "Properties", Category: api.Ref{Name: "Other"}},
{Name: "Java EE Batch", Category: api.Ref{Name: "Processing"}},
{Name: "Java EE Batch", Category: api.Ref{Name: "Java EE"}},
{Name: "Servlet", Category: api.Ref{Name: "Java EE"}},
{Name: "EJB XML", Category: api.Ref{Name: "Java EE"}},
{Name: "Properties", Category: api.Ref{Name: "Sustain"}},
{Name: "Properties", Category: api.Ref{Name: "Embedded"}},
{Name: "Java EE Batch", Category: api.Ref{Name: "Execute"}},
{Name: "EJB XML", Category: api.Ref{Name: "Connect"}},
{Name: "Servlet", Category: api.Ref{Name: "Connect"}},
},
}
10 changes: 6 additions & 4 deletions analysis/tc_tackle_testapp_public_deps.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package analysis

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

var MavenPublic = identity.Mvn

var TackleTestappPublicWithDeps = TC{
Name: "Tackle Testapp public with deps",
Application: data.TackleTestappPublic,
Application: TackleTestApp,
Task: Analyze,
WithDeps: true,
Labels: addon.Labels{
Expand All @@ -19,7 +20,8 @@ var TackleTestappPublicWithDeps = TC{
},
},
Identities: []api.Identity{
identity.MavenPublic,
MavenPublic, // Tackle Testapp public Maven registry expects MAVEN_TESTAPP_USER and MAVEN_TESTAPP_TOKEN env variables.

},
Analysis: api.Analysis{
Effort: 2,
Expand Down
11 changes: 9 additions & 2 deletions analysis/tc_tackle_testapp_public_package_filter.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
package analysis

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

var TackleTestAppPackageFilter = api.Application{
Name: "Tackle Testapp public",
Repository: &api.Repository{
Kind: "git",
URL: "https://github.com/konveyor/tackle-testapp-public",
},
}

var TackleTestappPublicPackageFilter = TC{
Name: "Tackle Testapp public with package filter",
Application: data.TackleTestappPublic,
Application: TackleTestApp,
Task: Analyze,
WithDeps: false,
Labels: addon.Labels{
Expand Down
3 changes: 2 additions & 1 deletion analysis/test_cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var Tier0TestCases = []TC{
TackleTestappPublicPackageFilter,
AcmeairWebapp,
Tomcat,
TackleTestappPublicBinary,
}

// Tier 1 Analysis test cases - should work.
Expand All @@ -20,6 +19,7 @@ var Tier1TestCases = []TC{
// List of applications with expected analysis outputs.
var Tier2TestCases = []TC{
AdministracionEfectivo,
TackleTestappPublic,
Daytrader,
PetclinicHazelcast,
ApacheWicket,
Expand All @@ -29,4 +29,5 @@ var Tier2TestCases = []TC{
// Tier 3 Analysis with credentials test cases - should work
// List of applications with expected analysis outputs.
var Tier3TestCases = []TC{
TackleTestappPrivateBinary, // Needs GITHUB_USER and GITHUB_TOKEN env variables with Read access to https://github.com/konveyor/tackle-testapp
}
10 changes: 5 additions & 5 deletions data/application.go → data/application_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ var (
URL: "https://github.com/ibraginsky/book-server",
},
}
TackleTestappPublic = api.Application{
Name: "Tackle Testapp public",
TackleTestapp = api.Application{
Name: "tackle-testapp",
Repository: &api.Repository{
Kind: "git",
URL: "https://github.com/konveyor/tackle-testapp-public",
Kind: "subversion",
URL: "https://github.com/konveyor/tackle-testapp",
},
Binary: "io.konveyor.demo:customers-tomcat:0.0.1-SNAPSHOT:war",
}
Expand All @@ -45,5 +45,5 @@ var (
Path: "example-1",
},
}
ApplicationSamples = []api.Application{Minimal, PathfinderGit, BookServer, TackleTestappPublic, UploadBinary, CustomerTomcatLegacy}
ApplicationSamples = []api.Application{Minimal, PathfinderGit, BookServer, TackleTestapp, UploadBinary, CustomerTomcatLegacy}
)
12 changes: 2 additions & 10 deletions data/identity/identity.go → data/identity/identity_data.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
package identity

import (
"github.com/konveyor/tackle2-hub/api"
"github.com/konveyor/tackle2-hub/test/api/identity"
)
import "github.com/konveyor/tackle2-hub/api"

// Tackle Testapp public Maven registry expects MAVEN_TESTAPP_USER and MAVEN_TESTAPP_TOKEN env variables.
// For more information, see: https://github.com/konveyor/tackle-testapp-public?tab=readme-ov-file#building-the-application
var MavenPublic = identity.Mvn


var TackleTestappPrivateMaven = api.Identity{
var TackleTestappMaven = api.Identity{
Kind: "maven",
Name: "maven-creds",
Settings: `<?xml version="1.0" encoding="UTF-8"?>
Expand Down
2 changes: 2 additions & 0 deletions go-konveyor-tests.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ export JIRA_SERVER_PASSWORD=""
export JIRA_SERVER_TOKEN=""

# Enviroment variebles needed for Tier3 Analysis test
export GITHUB_USER=""
export GITHUB_TOKEN=""

0 comments on commit ae927eb

Please sign in to comment.