Skip to content

Commit

Permalink
Add questionnaire view driven from example yaml
Browse files Browse the repository at this point in the history
Signed-off-by: ibolton336 <[email protected]>
  • Loading branch information
ibolton336 committed Aug 11, 2023
1 parent 5e9a715 commit 3d08047
Show file tree
Hide file tree
Showing 8 changed files with 508 additions and 6 deletions.
211 changes: 211 additions & 0 deletions client/public/questionnaire-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
name: Cloud Native
description: |
Questionnaire that includes the Twelve Factor Application principles.
sections:
- name: Application technologies 1
questions:
- formulation: What is the main technology in your application?
explanation: What would you describe as the main framework used to build your application.
answers:
- choice: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
- choice: Quarkus
risk: green
autoanswer_if_tags_present:
- category: Technology
tag: Quarkus
autotag:
- category: Technology
tag: Quarkus
- choice: Spring Boot
risk: green
autoanswer_if_tags_present:
- category: Technology
tag: Spring Boot
autotag:
- category: Technology
tag: Spring Boot
- choice: Java EE
rationale: This might not be the most cloud friendly technology.
mitigation: Maybe start thinking about migrating to Quarkus or Jakarta EE.
risk: yellow
autoanswer_if_tags_present:
- category: Technology
tag: Java EE
autotag:
- category: Technology
tag: Java EE
- choice: J2EE
rationale: This is obsolete.
mitigation: Maybe start thinking about migrating to Quarkus or Jakarta EE.
risk: red
autoanswer_if_tags_present:
- category: Technology
tag: J2EE
autotag:
- category: Technology
tag: J2EE
- formulation: "What version of Java EE does the application use?"
explanation: "What version of the Java EE specification is your application using?"
answers:
- choice: Below 5.
rationale: This technology stack is obsolete.
mitigation: Consider migrating to at least Java EE 7.
risk: red
- choice: 5 or 6
rationale: This is a mostly outdated stack.
mitigation: Consider migrating to at least Java EE 7.
risk: yellow
- choice: "7"
risk: green
include_if_tags_present:
- category: Technology
tag: Java EE
- formulation: Does your application use any caching mechanism?
answers:
- choice: Yes
rationale: This could be problematic in containers and Kubernetes.
mitigation: Review the clustering mechanism to check compatibility and support for container environments.
risk: yellow
autoanswer_if_tags_present:
- category: Caching
tag: Infinispan
- category: Caching
tag: Datagrid
- category: Caching
tag: eXtreme Scale
- category: Caching
tag: Coherence
- choice: No
risk: green
- choice: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
- formulation: What implementation of JAX-WS does your application use?
answers:
- choice: Apache Axis
rationale: This version is obsolete
mitigation: Consider migrating to Apache CXF
risk: red
- choice: Apache CXF
risk: green
- choice: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
skip_if_tags_present:
- category: Technology
tag: Spring Boot
- category: Technology
tag: Quarkus
- name: Application technologies
questions:
- formulation: What is the main technology in your application?
explanation: What would you describe as the main framework used to build your application.
answers:
- choice: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
- choice: Quarkus
risk: green
autoanswer_if_tags_present:
- category: Technology
tag: Quarkus
autotag:
- category: Technology
tag: Quarkus
- choice: Spring Boot
risk: green
autoanswer_if_tags_present:
- category: Technology
tag: Spring Boot
autotag:
- category: Technology
tag: Spring Boot
- choice: Java EE
rationale: This might not be the most cloud friendly technology.
mitigation: Maybe start thinking about migrating to Quarkus or Jakarta EE.
risk: yellow
autoanswer_if_tags_present:
- category: Technology
tag: Java EE
autotag:
- category: Technology
tag: Java EE
- choice: J2EE
rationale: This is obsolete.
mitigation: Maybe start thinking about migrating to Quarkus or Jakarta EE.
risk: red
autoanswer_if_tags_present:
- category: Technology
tag: J2EE
autotag:
- category: Technology
tag: J2EE
- formulation: "What version of Java EE does the application use?"
explanation: "What version of the Java EE specification is your application using?"
answers:
- choice: Below 5.
rationale: This technology stack is obsolete.
mitigation: Consider migrating to at least Java EE 7.
risk: red
- choice: 5 or 6
rationale: This is a mostly outdated stack.
mitigation: Consider migrating to at least Java EE 7.
risk: yellow
- choice: "7"
risk: green
include_if_tags_present:
- category: Technology
tag: Java EE
- formulation: Does your application use any caching mechanism?
answers:
- choice: Yes
rationale: This could be problematic in containers and Kubernetes.
mitigation: Review the clustering mechanism to check compatibility and support for container environments.
risk: yellow
autoanswer_if_tags_present:
- category: Caching
tag: Infinispan
- category: Caching
tag: Datagrid
- category: Caching
tag: eXtreme Scale
- category: Caching
tag: Coherence
- choice: No
risk: green
- choice: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
- formulation: What implementation of JAX-WS does your application use?
answers:
- choice: Apache Axis
rationale: This version is obsolete
mitigation: Consider migrating to Apache CXF
risk: red
- choice: Apache CXF
risk: green
- choice: Unknown
rationale: This is a problem because of the uncertainty.
mitigation: Gathering more information about this is required.
risk: unknown
skip_if_tags_present:
- category: Technology
tag: Spring Boot
- category: Technology
tag: Quarkus
thresholds:
red: 1%
yellow: 30%
unknown: 15%
risk_messages:
red: Application requires deep changes in architecture or lifecycle
yellow: Application is Cloud friendly but requires some minor changes
green: Application is Cloud Native
unknown: More information about the application is required
1 change: 1 addition & 0 deletions client/src/app/Paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export enum Paths {
proxies = "/proxies",
migrationTargets = "/migration-targets",
assessment = "/assessment",
questionnaire = "/questionnaire",
jira = "/jira",
}

Expand Down
17 changes: 15 additions & 2 deletions client/src/app/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ const AffectedApplications = lazy(
() => import("./pages/issues/affected-applications")
);
const Dependencies = lazy(() => import("./pages/dependencies"));
const Questionnaires = lazy(() => import("./pages/assessment"));

const AssessmentSettings = lazy(
() =>
import(
"./pages/assessment-management/assessment-settings/assessment-settings-page"
)
);
const Questionnaire = lazy(
() => import("./pages/assessment-management/questionnaire/questionnaire-page")
);
export interface IRoute {
path: string;
comp: React.ComponentType<any>;
Expand Down Expand Up @@ -123,7 +131,12 @@ export const devRoutes: IRoute[] = [
: []),
{
path: Paths.assessment,
comp: Questionnaires,
comp: AssessmentSettings,
exact: false,
},
{
path: Paths.questionnaire,
comp: Questionnaire,
exact: false,
},
];
Expand Down
36 changes: 36 additions & 0 deletions client/src/app/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,3 +714,39 @@ export interface Questionnaire {
dateImported: string;
system: boolean;
}
export interface RiskMessages {
green: string;
red: string;
unknown: string;
yellow: string;
}
export interface Section {
name: string;
questions: CustomYamlAssessmentQuestion[];
}

// TODO: Rename after removing pathfinder
export interface CustomYamlAssessmentQuestion {
answers: Answer[];
explanation: string;
formulation: string;
}

export interface Answer {
choice: string;
mitigation: string;
rationale: string;
risk: string;
}
export interface Thresholds {
red: string;
unknown: string;
yellow: string;
}
export interface YamlAssessment {
description: string;
name: string;
risk_messages: RiskMessages;
sections: Section[];
thresholds: Thresholds;
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ import { useLocalTableControls } from "@app/hooks/table-controls";
import { NotificationsContext } from "@app/components/NotificationsContext";
import { getAxiosErrorMessage } from "@app/utils/utils";
import { Questionnaire } from "@app/api/models";
import { useHistory } from "react-router-dom";
import { Paths } from "@app/Paths";

export const AssessmentSettings: React.FC = () => {
const AssessmentSettings: React.FC = () => {
const { t } = useTranslation();

const history = useHistory();
const { pushNotification } = React.useContext(NotificationsContext);

// TODO Replace with Hub API when ready
Expand Down Expand Up @@ -363,8 +366,7 @@ export const AssessmentSettings: React.FC = () => {
key="view"
component="button"
onClick={() => {
// TODO Link to questionnaire page
// history.push(Paths.questionnaire);
history.push(Paths.questionnaire);
}}
>
{t("actions.view")}
Expand Down Expand Up @@ -474,3 +476,4 @@ export const AssessmentSettings: React.FC = () => {
</>
);
};
export default AssessmentSettings;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.tabs-vertical-container {
width: 20em;
}
.tab-content-container {
width: 80em;
}
Loading

0 comments on commit 3d08047

Please sign in to comment.