Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

✨ add "addons" tab for running arbitrary tackle addons #544

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ npm-debug.log*

# Intellij IDEA
.idea/

# Downloaded runnables for development
bin/
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.PHONY: start-minikube
START_MINIKUBE_SH = ./bin/start-minikube.sh
start-minikube:
ifeq (,$(wildcard $(START_MINIKUBE_SH)))
@{ \
set -e ;\
mkdir -p $(dir $(START_MINIKUBE_SH)) ;\
curl -sSLo $(START_MINIKUBE_SH) https://raw.githubusercontent.com/konveyor/tackle2-operator/main/hack/start-minikube.sh ;\
chmod +x $(START_MINIKUBE_SH) ;\
}
endif
$(START_MINIKUBE_SH);

.PHONY: install-tackle
INSTALL_TACKLE_SH = ./bin/install-tackle.sh
install-tackle:
ifeq (,$(wildcard $(INSTALL_TACKLE_SH)))
@{ \
set -e ;\
mkdir -p $(dir $(INSTALL_TACKLE_SH)) ;\
curl -sSLo $(INSTALL_TACKLE_SH) https://raw.githubusercontent.com/konveyor/tackle2-operator/main/hack/install-tackle.sh ;\
chmod +x $(INSTALL_TACKLE_SH) ;\
}
endif
export TACKLE_ADDON_WINDUP_IMAGE=$(IMG); \
export TACKLE_IMAGE_PULL_POLICY='IfNotPresent'; \
$(INSTALL_TACKLE_SH);
1 change: 1 addition & 0 deletions client/config/stylePaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
__dirname,
"../../node_modules/@patternfly/react-core/dist/styles/base.css"
),
path.resolve(__dirname, "../../node_modules/monaco-editor"),
path.resolve(
__dirname,
"../../node_modules/@patternfly/react-core/dist/esm/@patternfly/patternfly"
Expand Down
3 changes: 3 additions & 0 deletions client/config/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import CopyPlugin from "copy-webpack-plugin";
import Dotenv from "dotenv-webpack";
import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin";
import { Configuration, WatchIgnorePlugin } from "webpack";
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");

const BG_IMAGES_DIRNAME = "images";

Expand Down Expand Up @@ -52,6 +53,7 @@ const config: Configuration = {
__dirname,
"../../node_modules/@patternfly/patternfly/assets/pficon"
),
path.resolve(__dirname, "../../node_modules/monaco-editor"),
],
use: {
loader: "file-loader",
Expand Down Expand Up @@ -195,6 +197,7 @@ const config: Configuration = {
new WatchIgnorePlugin({
paths: [/\.js$/, /\.d\.ts$/],
}),
new MonacoWebpackPlugin(),
],
resolve: {
alias: {
Expand Down
1 change: 1 addition & 0 deletions client/config/webpack.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import HtmlWebpackPlugin from "html-webpack-plugin";
import helpers from "../../server/helpers";
import { Configuration } from "webpack";
import "webpack-dev-server";
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");

const brandType = process.env["PROFILE"] || "konveyor";

Expand Down
2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@migtools/lib-ui": "^8.6.0",
"@patternfly/patternfly": "^4.222.4",
"@patternfly/react-charts": "^6.94.15",
"@patternfly/react-code-editor": "^4.82.82",
"@patternfly/react-core": "^4.267.6",
"@patternfly/react-table": "^4.112.6",
"@patternfly/react-tokens": "^4.94.3",
Expand All @@ -38,6 +39,7 @@
"i18next": "^19.8.4",
"i18next-http-backend": "^1.0.22",
"keycloak-js": "^18.0.1",
"monaco-editor-webpack-plugin": "^7.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-hook-form": "^7.27.1",
Expand Down
7 changes: 7 additions & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"manageImports": "Manage imports",
"next": "Next",
"review": "Review",
"run": "Run",
"runAddon": "Run Addon",
"save": "Save",
"saveAndReview": "Save and review",
"saveAsDraft": "Save as draft",
Expand Down Expand Up @@ -160,6 +162,8 @@
"accepted": "Accepted",
"acceptedAppsAndDeps": "Accepted applications and dependencies",
"add": "Add",
"addon": "Addon",
"addons": "Addons",
"additionalNotesOrComments": "Additional notes or comments",
"adoptionCandidateDistribution": "Adoption candidate distribution",
"analysis": "Analysis",
Expand Down Expand Up @@ -229,6 +233,7 @@
"jobFunction": "Job function",
"jobFunctionDeleted": "Job function deleted",
"jobFunctions": "Job functions",
"lastRun": "Last Run",
"loading": "Loading",
"lowRisk": "Low risk",
"mavenConfig": "Maven configuration",
Expand Down Expand Up @@ -287,7 +292,9 @@
"tagType": "Tag type",
"tagTypeDeleted": "",
"tagTypes": "Tag types",
"tasks": "Tasks",
"teamMember": "team member",
"testgen": "Test Generator",
"trivialButMigratable": "Trivial but migratable",
"unassesed": "Unassesed",
"unknown": "Unknown",
Expand Down
7 changes: 7 additions & 0 deletions client/public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"manageImports": "Administrar importaciones",
"next": "Siguiente",
"review": "Revisar",
"run": "Ejecutar",
"runAddon": "Ejecutar el Addon",
"save": "Guardar",
"saveAndReview": "Guardar y revisar",
"saveAsDraft": "Guardar como borrador",
Expand Down Expand Up @@ -160,6 +162,8 @@
"accepted": "Aceptado",
"acceptedAppsAndDeps": "Aplicaciónes y dependencias adoptadas",
"add": "Agregar",
"addon": "Addon",
"addons": "Addons",
"additionalNotesOrComments": "Notas adicionales o comentarios",
"adoptionCandidateDistribution": "Distribución de candidatos a la adopción",
"analysis": "Análisis",
Expand Down Expand Up @@ -226,6 +230,7 @@
"jobFunction": "Función laboral",
"jobFunctionDeleted": "Función laboral descheda",
"jobFunctions": "Funciones laborales",
"lastRun": "Última ejecución",
"loading": "Cargando",
"lowRisk": "Riesgo bajo",
"mavenConfig": "configuiración de Maven",
Expand Down Expand Up @@ -284,7 +289,9 @@
"tagType": "Tipo de etiqueta",
"tagTypeDeleted": "Tipo de etiqueta descheda",
"tagTypes": "Tipos de etiqueta",
"tasks": "Tareas",
"teamMember": "miembro del equipo",
"testgen": "Generador de Prueba",
"trivialButMigratable": "Trivial pero migrable",
"unassesed": "No evaluado",
"unknown": "Desconocido",
Expand Down
1 change: 1 addition & 0 deletions client/src/app/Paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export enum Paths {
applications = "/applications",
applicationsAnalysisTab = "/applications/analysis-tab",
applicationsAssessmentTab = "/applications/assessment-tab",
applicationsAddonsTab = "/applications/addons-tab",
applicationsImports = "/applications/application-imports",
applicationsImportsDetails = "/applications/application-imports/:importId",
applicationsAssessment = "/applications/assessment/:assessmentId",
Expand Down
9 changes: 7 additions & 2 deletions client/src/app/api/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export interface Task {
application: { id: number };
name: string;
addon: string;
data: TaskData;
data: any; // TODO(djzager) - may want to fix this
error?: string;
image?: string;
started?: string;
Expand Down Expand Up @@ -370,6 +370,11 @@ export interface TaskData {
};
}

export interface Addon {
name: string;
image: string;
}

interface TaskReport {
activity: string[];
completed: number;
Expand Down Expand Up @@ -400,7 +405,7 @@ export interface Taskgroup {
id?: number;
name: string;
addon: string;
data: TaskData;
data: any; // TODO(djzager) - may want to fix this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to use the TaskData type here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem here is that the data we are trying to submit almost certainly will not match the TaskData type. TaskData as it currently exists is only true for running a Windup task.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This point still remains but the other issues have been addressed.

tasks: TaskgroupTask[];
}

Expand Down
5 changes: 5 additions & 0 deletions client/src/app/api/rest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
BulkCopyReview,
Identity,
Setting,
Addon,
Task,
Proxy,
Taskgroup,
Expand Down Expand Up @@ -52,6 +53,7 @@ export const IDENTITIES = HUB + "/identities";
export const PROXIES = HUB + "/proxies";
export const SETTINGS = HUB + "/settings";
export const TASKS = HUB + "/tasks";
export const ADDONS = HUB + "/addons";
export const TASKGROUPS = HUB + "/taskgroups";

// PATHFINDER
Expand Down Expand Up @@ -513,6 +515,9 @@ export const getApplicationImports = (
export const getTasks = () =>
axios.get<Task[]>(TASKS).then((response) => response.data);

export const getAddons = () =>
axios.get<Addon[]>(ADDONS).then((response) => response.data);

export const deleteTask = (id: number) => axios.delete<Task>(`${TASKS}/${id}`);

export const cancelTask = (id: number) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { RunAddonForm } from "./run-addon-form";
export { RunAddonModal } from "./run-addon-modal";
Loading