From e900a47771cba9dc43f3e49464da344fde751b64 Mon Sep 17 00:00:00 2001 From: Vladyslav Palyvoda Date: Thu, 21 Sep 2023 14:00:09 +0300 Subject: [PATCH] feat: Make EDP-gitops repository unique per edp tenant (#52) Jira: EPMDEDP-12643 Related: #52 Change-Id: I7db8fe31d7a4eb5e53337692a59c2bb48e25a9bb --- src/hooks/useDetectNamespaces/index.tsx | 5 +-- ...CreateCodebase.tsx => useCodebaseCRUD.tsx} | 28 +++++++++++- src/k8s/EDPCodebase/hooks/useEditCodebase.ts | 45 ------------------- src/k8s/EDPCodebase/labels.ts | 1 + src/override.css | 15 ++++++- src/pages/edp-cdpipeline-list/view.tsx | 33 +++++++------- .../pages/edp-gitops/view.tsx | 10 ++++- .../providers/Data/provider.tsx | 6 ++- .../components/FormActions/index.tsx | 4 +- .../Inner/components/FormActions/index.tsx | 4 +- .../Edit/components/FormActions/index.tsx | 4 +- .../components/FormActions/index.tsx | 4 +- .../components/fields/GitRepoPath/index.tsx | 4 +- .../components/fields/GitServer/index.tsx | 6 +-- .../components/fields/Name/index.tsx | 18 +++++++- .../ManageGitOps/hooks/useDefaultValues.ts | 1 + src/widgets/ManageGitOps/names.ts | 7 +++ 17 files changed, 111 insertions(+), 84 deletions(-) rename src/k8s/EDPCodebase/hooks/{useCreateCodebase.tsx => useCodebaseCRUD.tsx} (86%) delete mode 100644 src/k8s/EDPCodebase/hooks/useEditCodebase.ts diff --git a/src/hooks/useDetectNamespaces/index.tsx b/src/hooks/useDetectNamespaces/index.tsx index e815bd1d5..35e64a15a 100644 --- a/src/hooks/useDetectNamespaces/index.tsx +++ b/src/hooks/useDetectNamespaces/index.tsx @@ -15,6 +15,7 @@ export const useDetectNamespaces = () => { const history = useHistory(); React.useEffect(() => { + closeSnackbar(); const lsNamespaceObject = JSON.parse( localStorage.getItem(`cluster_settings.${clusterName}`) || '{}' ); @@ -28,7 +29,6 @@ export const useDetectNamespaces = () => { } if (!lsNamespaceObject?.defaultNamespace) { - closeSnackbar(); enqueueSnackbar( Default namespace is unset. Navigate to @@ -47,7 +47,6 @@ export const useDetectNamespaces = () => { , { autoHideDuration: null, - variant: 'warning', anchorOrigin: { vertical: 'bottom', horizontal: 'left', @@ -63,7 +62,6 @@ export const useDetectNamespaces = () => { !lsNamespaceObject?.allowedNamespaces || !lsNamespaceObject?.allowedNamespaces.length ) { - closeSnackbar(); enqueueSnackbar( Allowed namespaces are unset. Navigate to @@ -82,7 +80,6 @@ export const useDetectNamespaces = () => { , { autoHideDuration: null, - variant: 'warning', anchorOrigin: { vertical: 'bottom', horizontal: 'left', diff --git a/src/k8s/EDPCodebase/hooks/useCreateCodebase.tsx b/src/k8s/EDPCodebase/hooks/useCodebaseCRUD.tsx similarity index 86% rename from src/k8s/EDPCodebase/hooks/useCreateCodebase.tsx rename to src/k8s/EDPCodebase/hooks/useCodebaseCRUD.tsx index ec2d370d1..e9559f9e7 100644 --- a/src/k8s/EDPCodebase/hooks/useCreateCodebase.tsx +++ b/src/k8s/EDPCodebase/hooks/useCodebaseCRUD.tsx @@ -20,7 +20,11 @@ interface CreateCodebaseProps { codebaseAuthData: CodebaseAuthData | null; } -export const useCreateCodebase = ({ +interface EditCodebaseProps { + codebaseData: EDPCodebaseKubeObjectInterface; +} + +export const useCodebaseCRUD = ({ onSuccess, onError, }: { @@ -88,6 +92,11 @@ export const useCreateCodebase = ({ CRUD_TYPES.CREATE >('codebaseSecretCreateMutation', K8s.secret.default, CRUD_TYPES.CREATE); + const codebaseEditMutation = useResourceCRUDMutation< + EDPCodebaseKubeObjectInterface, + CRUD_TYPES.EDIT + >('codebaseEditMutation', EDPCodebaseKubeObject, CRUD_TYPES.EDIT); + const createCodebase = React.useCallback( async ({ codebaseData, codebaseAuthData }: CreateCodebaseProps) => { if (codebaseAuthData === null) { @@ -142,11 +151,26 @@ export const useCreateCodebase = ({ ] ); + const editCodebase = React.useCallback( + async ({ codebaseData }: EditCodebaseProps) => { + codebaseEditMutation.mutate(codebaseData, { + onSuccess: () => { + invokeOnSuccessCallback(codebaseData); + }, + onError: () => { + invokeOnErrorCallback(); + }, + }); + }, + [codebaseEditMutation, invokeOnErrorCallback, invokeOnSuccessCallback] + ); + const mutations = { codebaseCreateMutation, codebaseSecretCreateMutation, codebaseSecretDeleteMutation, + codebaseEditMutation, }; - return { createCodebase, mutations }; + return { createCodebase, editCodebase, mutations }; }; diff --git a/src/k8s/EDPCodebase/hooks/useEditCodebase.ts b/src/k8s/EDPCodebase/hooks/useEditCodebase.ts deleted file mode 100644 index be7eea41a..000000000 --- a/src/k8s/EDPCodebase/hooks/useEditCodebase.ts +++ /dev/null @@ -1,45 +0,0 @@ -import React from 'react'; -import { CRUD_TYPES } from '../../../constants/crudTypes'; -import { useResourceCRUDMutation } from '../../../hooks/useResourceCRUDMutation'; -import { EDPCodebaseKubeObject } from '../index'; -import { EDPCodebaseKubeObjectInterface } from '../types'; - -interface EditCodebaseProps { - codebaseData: EDPCodebaseKubeObjectInterface; -} - -export const useEditCodebase = ({ - onSuccess, - onError, -}: { - onSuccess?: () => void; - onError?: () => void; -}) => { - const invokeOnSuccessCallback = React.useCallback(() => onSuccess && onSuccess(), [onSuccess]); - const invokeOnErrorCallback = React.useCallback(() => onError && onError(), [onError]); - - const codebaseEditMutation = useResourceCRUDMutation< - EDPCodebaseKubeObjectInterface, - CRUD_TYPES.EDIT - >('codebaseEditMutation', EDPCodebaseKubeObject, CRUD_TYPES.EDIT); - - const editCodebase = React.useCallback( - async ({ codebaseData }: EditCodebaseProps) => { - codebaseEditMutation.mutate(codebaseData, { - onSuccess: () => { - invokeOnSuccessCallback(); - }, - onError: () => { - invokeOnErrorCallback(); - }, - }); - }, - [codebaseEditMutation, invokeOnErrorCallback, invokeOnSuccessCallback] - ); - - const mutations = { - codebaseEditMutation, - }; - - return { editCodebase, mutations }; -}; diff --git a/src/k8s/EDPCodebase/labels.ts b/src/k8s/EDPCodebase/labels.ts index 0cccd74cd..6742b2049 100644 --- a/src/k8s/EDPCodebase/labels.ts +++ b/src/k8s/EDPCodebase/labels.ts @@ -1 +1,2 @@ export const CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE = 'app.edp.epam.com/codebaseType'; +export const CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE_SYSTEM_TYPE = 'app.edp.epam.com/systemType'; diff --git a/src/override.css b/src/override.css index 82052dd78..ec278cff4 100644 --- a/src/override.css +++ b/src/override.css @@ -10,4 +10,17 @@ .MuiChip-label { line-height: 1; -} \ No newline at end of file +} + +nav[aria-label="Navigation Tabs"] li[class*="linkMainSelected"] { + background-color: #2ccfe2 !important; +} + +nav[aria-label="Navigation Tabs"] li[class*="linkSelected"] .Mui-selected * { + color: #2ccfe2 !important; +} + +div[class*="SnackbarItem-variantWarning"] { + color: #000; +} + diff --git a/src/pages/edp-cdpipeline-list/view.tsx b/src/pages/edp-cdpipeline-list/view.tsx index 277f10df5..50cb14545 100644 --- a/src/pages/edp-cdpipeline-list/view.tsx +++ b/src/pages/edp-cdpipeline-list/view.tsx @@ -12,8 +12,8 @@ import { CODEBASE_TYPES } from '../../constants/codebaseTypes'; import { EDP_USER_GUIDE } from '../../constants/urls'; import { ICONS } from '../../icons/iconify-icons-mapping'; import { EDPCDPipelineKubeObject } from '../../k8s/EDPCDPipeline'; -import { EDPCodebaseKubeObject } from '../../k8s/EDPCodebase'; -import { CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE } from '../../k8s/EDPCodebase/labels'; +import { useCodebasesByTypeLabelQuery } from '../../k8s/EDPCodebase/hooks/useCodebasesByTypeLabelQuery'; +import { CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE_SYSTEM_TYPE } from '../../k8s/EDPCodebase/labels'; import { useDialogContext } from '../../providers/Dialog/hooks'; import { ResourceActionListContextProvider } from '../../providers/ResourceActionList'; import { FORM_MODES } from '../../types/forms'; @@ -25,19 +25,22 @@ import { routeEDPGitOpsConfiguration } from '../edp-configuration/pages/edp-gito import { CDPipelineList } from './components/CDPipelineList'; export const PageView = () => { - const [codebases] = EDPCodebaseKubeObject.useList({ - namespace: getDefaultNamespace(), - labelSelector: `${CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE}=${CODEBASE_TYPES.SYSTEM}`, + const { data: gitOpsCodebase, isLoading } = useCodebasesByTypeLabelQuery({ + props: { + namespace: getDefaultNamespace(), + codebaseType: CODEBASE_TYPES.SYSTEM, + }, + options: { + select: data => { + return data?.items.find( + el => + el.metadata.labels[CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE_SYSTEM_TYPE] === + 'gitops' + ); + }, + }, }); - const codebasesArray = React.useMemo( - () => (codebases ? codebases.filter(Boolean) : []), - [codebases] - ); - - const codebasesIsLoading = codebases === null; - - const gitOpsCodebase = codebasesArray.find(el => el.metadata.name === 'edp-gitops') ?? null; const [items, error] = EDPCDPipelineKubeObject.useList(); const { setDialog } = useDialogContext(); @@ -87,10 +90,10 @@ export const PageView = () => { headerStyle="label" /> - + - + { const itemsArray = React.useMemo(() => (items ? items.filter(Boolean) : []), [items]); - const gitOpsCodebase = itemsArray.find(el => el.metadata.name === 'edp-gitops') ?? null; + const gitOpsCodebase = + itemsArray.find( + el => el.metadata.labels[CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE_SYSTEM_TYPE] === 'gitops' + ) ?? null; const status = gitOpsCodebase?.status?.status ?? CUSTOM_RESOURCE_STATUSES.UNKNOWN; diff --git a/src/pages/edp-stage-details/providers/Data/provider.tsx b/src/pages/edp-stage-details/providers/Data/provider.tsx index 5bac1ffd5..2c0e9be22 100644 --- a/src/pages/edp-stage-details/providers/Data/provider.tsx +++ b/src/pages/edp-stage-details/providers/Data/provider.tsx @@ -5,6 +5,7 @@ import { useCDPipelineByNameQuery } from '../../../../k8s/EDPCDPipeline/hooks/us import { useCDPipelineStageListByCDPipelineNameQuery } from '../../../../k8s/EDPCDPipelineStage/hooks/useCDPipelineStageListByCDPipelineNameQuery'; import { useCodebasesByTypeLabelQuery } from '../../../../k8s/EDPCodebase/hooks/useCodebasesByTypeLabelQuery'; import { useEnrichedApplicationsWithImageStreamsQuery } from '../../../../k8s/EDPCodebase/hooks/useEnrichedApplicationsWithImageStreamsQuery'; +import { CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE_SYSTEM_TYPE } from '../../../../k8s/EDPCodebase/labels'; import { EDPStageDetailsRouteParams } from '../../types'; import { DataContext } from './context'; @@ -47,7 +48,10 @@ export const DataContextProvider: React.FC = ({ children }) => { }, }); - const gitOpsCodebase = codebases?.items.find(el => el.metadata.name === 'edp-gitops') ?? null; + const gitOpsCodebase = + codebases?.items.find( + el => el.metadata.labels[CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE_SYSTEM_TYPE] === 'gitops' + ) ?? null; const DataContextValue = React.useMemo( () => ({ diff --git a/src/widgets/CreateCodebaseFromTemplate/components/FormActions/index.tsx b/src/widgets/CreateCodebaseFromTemplate/components/FormActions/index.tsx index 52b00b71b..c21ed27c8 100644 --- a/src/widgets/CreateCodebaseFromTemplate/components/FormActions/index.tsx +++ b/src/widgets/CreateCodebaseFromTemplate/components/FormActions/index.tsx @@ -1,7 +1,7 @@ import { Button } from '@material-ui/core'; import React from 'react'; import { useFormContext } from 'react-hook-form'; -import { useCreateCodebase } from '../../../../k8s/EDPCodebase/hooks/useCreateCodebase'; +import { useCodebaseCRUD } from '../../../../k8s/EDPCodebase/hooks/useCodebaseCRUD'; import { EDPCodebaseKubeObjectInterface } from '../../../../k8s/EDPCodebase/types'; import { createCodebaseInstance } from '../../../../k8s/EDPCodebase/utils/createCodebaseInstance'; import { useDefaultCIToolQuery } from '../../../../k8s/EDPComponent/hooks/useDefaultCIToolQuery'; @@ -29,7 +29,7 @@ export const FormActions = () => { const { createCodebase, mutations: { codebaseCreateMutation }, - } = useCreateCodebase({ + } = useCodebaseCRUD({ onSuccess: () => { closeDialog(); reset(); diff --git a/src/widgets/CreateEditCodebase/components/Create/components/Inner/components/FormActions/index.tsx b/src/widgets/CreateEditCodebase/components/Create/components/Inner/components/FormActions/index.tsx index b977733ce..fb3d1ccdc 100644 --- a/src/widgets/CreateEditCodebase/components/Create/components/Inner/components/FormActions/index.tsx +++ b/src/widgets/CreateEditCodebase/components/Create/components/Inner/components/FormActions/index.tsx @@ -2,7 +2,7 @@ import { Button } from '@material-ui/core'; import React from 'react'; import { useFormContext } from 'react-hook-form'; import { Render } from '../../../../../../../../components/Render'; -import { useCreateCodebase } from '../../../../../../../../k8s/EDPCodebase/hooks/useCreateCodebase'; +import { useCodebaseCRUD } from '../../../../../../../../k8s/EDPCodebase/hooks/useCodebaseCRUD'; import { createCodebaseInstance } from '../../../../../../../../k8s/EDPCodebase/utils/createCodebaseInstance'; import { useSpecificDialogContext } from '../../../../../../../../providers/Dialog/hooks'; import { getUsedValues } from '../../../../../../../../utils/forms/getUsedValues'; @@ -102,7 +102,7 @@ export const FormActions = ({ codebaseSecretCreateMutation, codebaseSecretDeleteMutation, }, - } = useCreateCodebase({ + } = useCodebaseCRUD({ onSuccess: handleClose, }); diff --git a/src/widgets/CreateEditCodebase/components/Edit/components/FormActions/index.tsx b/src/widgets/CreateEditCodebase/components/Edit/components/FormActions/index.tsx index 4c46129fc..3d6315610 100644 --- a/src/widgets/CreateEditCodebase/components/Edit/components/FormActions/index.tsx +++ b/src/widgets/CreateEditCodebase/components/Edit/components/FormActions/index.tsx @@ -1,7 +1,7 @@ import { Button } from '@material-ui/core'; import React from 'react'; import { useFormContext } from 'react-hook-form'; -import { useEditCodebase } from '../../../../../../k8s/EDPCodebase/hooks/useEditCodebase'; +import { useCodebaseCRUD } from '../../../../../../k8s/EDPCodebase/hooks/useCodebaseCRUD'; import { editCodebaseInstance } from '../../../../../../k8s/EDPCodebase/utils/editCodebaseInstance'; import { useSpecificDialogContext } from '../../../../../../providers/Dialog/hooks'; import { getUsedValues } from '../../../../../../utils/forms/getUsedValues'; @@ -33,7 +33,7 @@ export const FormActions = () => { reset(); }, [closeDialog, reset]); - const { editCodebase } = useEditCodebase({ + const { editCodebase } = useCodebaseCRUD({ onSuccess: handleClose, }); diff --git a/src/widgets/ManageGitOps/components/FormActions/index.tsx b/src/widgets/ManageGitOps/components/FormActions/index.tsx index ef59a8342..ad6cd52b5 100644 --- a/src/widgets/ManageGitOps/components/FormActions/index.tsx +++ b/src/widgets/ManageGitOps/components/FormActions/index.tsx @@ -2,7 +2,7 @@ import { Button, Grid } from '@material-ui/core'; import React from 'react'; import { useFormContext as useReactHookFormContext } from 'react-hook-form'; import { Render } from '../../../../components/Render'; -import { useCreateCodebase } from '../../../../k8s/EDPCodebase/hooks/useCreateCodebase'; +import { useCodebaseCRUD } from '../../../../k8s/EDPCodebase/hooks/useCodebaseCRUD'; import { createCodebaseInstance } from '../../../../k8s/EDPCodebase/utils/createCodebaseInstance'; import { useFormContext } from '../../../../providers/Form/hooks'; import { FORM_MODES } from '../../../../types/forms'; @@ -35,7 +35,7 @@ export const FormActions = () => { codebaseSecretCreateMutation, codebaseSecretDeleteMutation, }, - } = useCreateCodebase({ + } = useCodebaseCRUD({ onSuccess: handleClose, }); diff --git a/src/widgets/ManageGitOps/components/fields/GitRepoPath/index.tsx b/src/widgets/ManageGitOps/components/fields/GitRepoPath/index.tsx index 2cb5819bd..cfc94f53f 100644 --- a/src/widgets/ManageGitOps/components/fields/GitRepoPath/index.tsx +++ b/src/widgets/ManageGitOps/components/fields/GitRepoPath/index.tsx @@ -5,7 +5,6 @@ import { GIT_SERVERS } from '../../../../../constants/gitServers'; import { FormTextField } from '../../../../../providers/Form/components/FormTextField'; import { useFormContext } from '../../../../../providers/Form/hooks'; import { FieldEvent } from '../../../../../types/forms'; -import { GIT_OPS_CODEBASE_NAME } from '../../../constants'; import { CODEBASE_FORM_NAMES } from '../../../names'; import { ManageGitOpsDataContext, ManageGitOpsValues } from '../../../types'; // relative path should always start with slash @@ -26,6 +25,7 @@ export const GitRepoPath = () => { } = useFormContext(); const gitServerFieldValue = watch(CODEBASE_FORM_NAMES.gitRepoPath.name); + const nameFieldValue = watch(CODEBASE_FORM_NAMES.name.name); return ( { setValue( CODEBASE_FORM_NAMES.gitUrlPath.name, - isGerrit ? `/${GIT_OPS_CODEBASE_NAME}` : `${value}/${GIT_OPS_CODEBASE_NAME}` + isGerrit ? `/${nameFieldValue}` : `${value}/${nameFieldValue}` ); }, })} diff --git a/src/widgets/ManageGitOps/components/fields/GitServer/index.tsx b/src/widgets/ManageGitOps/components/fields/GitServer/index.tsx index 3e766d3a1..094a2845e 100644 --- a/src/widgets/ManageGitOps/components/fields/GitServer/index.tsx +++ b/src/widgets/ManageGitOps/components/fields/GitServer/index.tsx @@ -5,7 +5,6 @@ import { useGitServerListQuery } from '../../../../../k8s/EDPGitServer/hooks/use import { FormSelect } from '../../../../../providers/Form/components/FormSelect'; import { useFormContext } from '../../../../../providers/Form/hooks'; import { FieldEvent } from '../../../../../types/forms'; -import { GIT_OPS_CODEBASE_NAME } from '../../../constants'; import { CODEBASE_FORM_NAMES } from '../../../names'; import { ManageGitOpsDataContext, ManageGitOpsValues } from '../../../types'; @@ -29,6 +28,7 @@ export const GitServer = () => { } = useFormContext(); const gitRepoPathFieldValue = watch(CODEBASE_FORM_NAMES.gitRepoPath.name); + const nameFieldValue = watch(CODEBASE_FORM_NAMES.name.name); return ( { setValue( CODEBASE_FORM_NAMES.gitUrlPath.name, isGerrit - ? `/${GIT_OPS_CODEBASE_NAME}` - : `${gitRepoPathFieldValue}/${GIT_OPS_CODEBASE_NAME}` + ? `/${nameFieldValue}` + : `${gitRepoPathFieldValue}/${nameFieldValue}` ); }, })} diff --git a/src/widgets/ManageGitOps/components/fields/Name/index.tsx b/src/widgets/ManageGitOps/components/fields/Name/index.tsx index b7d510d0a..5f5c7e69c 100644 --- a/src/widgets/ManageGitOps/components/fields/Name/index.tsx +++ b/src/widgets/ManageGitOps/components/fields/Name/index.tsx @@ -1,7 +1,9 @@ import { InputAdornment } from '@material-ui/core'; import React from 'react'; import { useFormContext as useReactHookFormContext } from 'react-hook-form'; +import { GIT_SERVERS } from '../../../../../constants/gitServers'; import { FormTextField } from '../../../../../providers/Form/components/FormTextField'; +import { FieldEvent } from '../../../../../types/forms'; import { CODEBASE_FORM_NAMES } from '../../../names'; import { ManageGitOpsValues } from '../../../types'; @@ -12,11 +14,25 @@ export const Name = () => { register, control, formState: { errors }, + setValue, + watch, } = useReactHookFormContext(); + const gitRepoPathFieldValue = watch(CODEBASE_FORM_NAMES.gitRepoPath.name); + const gitServerFieldValue = watch(CODEBASE_FORM_NAMES.gitServer.name); + return ( { + const isGerrit = gitServerFieldValue === GIT_SERVERS.GERRIT; + + setValue( + CODEBASE_FORM_NAMES.gitUrlPath.name, + isGerrit ? `/${value}` : `${gitRepoPathFieldValue}/${value}` + ); + }, + })} label={'Repository Name'} control={control} errors={errors} diff --git a/src/widgets/ManageGitOps/hooks/useDefaultValues.ts b/src/widgets/ManageGitOps/hooks/useDefaultValues.ts index c66782081..289131e27 100644 --- a/src/widgets/ManageGitOps/hooks/useDefaultValues.ts +++ b/src/widgets/ManageGitOps/hooks/useDefaultValues.ts @@ -39,6 +39,7 @@ export const useDefaultValues = ({ formData }: { formData: ManageGitOpsDataConte [CODEBASE_FORM_NAMES.type.name]: CODEBASE_TYPES.SYSTEM, [CODEBASE_FORM_NAMES.versioningType.name]: CODEBASE_VERSIONING_TYPES.EDP, [CODEBASE_FORM_NAMES.versioningStartFrom.name]: '0.1.0-SNAPSHOT', + [CODEBASE_FORM_NAMES.systemTypeLabel.name]: 'gitops', }; } diff --git a/src/widgets/ManageGitOps/names.ts b/src/widgets/ManageGitOps/names.ts index 78ee15c96..c7ebc86d7 100644 --- a/src/widgets/ManageGitOps/names.ts +++ b/src/widgets/ManageGitOps/names.ts @@ -1,3 +1,5 @@ +import { CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE_SYSTEM_TYPE } from '../../k8s/EDPCodebase/labels'; + const NAMES = { TYPE: 'type', STRATEGY: 'strategy', @@ -16,6 +18,7 @@ const NAMES = { DEPLOYMENT_SCRIPT: 'deploymentScript', CI_TOOL: 'ciTool', GIT_REPO_PATH: 'gitRepoPath', + SYSTEM_TYPE_LABEL: 'systemTypeLabel', } as const; export const CODEBASE_FORM_NAMES = { @@ -88,4 +91,8 @@ export const CODEBASE_FORM_NAMES = { [NAMES.GIT_REPO_PATH]: { name: NAMES.GIT_REPO_PATH, }, + [NAMES.SYSTEM_TYPE_LABEL]: { + name: NAMES.SYSTEM_TYPE_LABEL, + path: ['metadata', 'labels', CODEBASE_LABEL_SELECTOR_CODEBASE_TYPE_SYSTEM_TYPE], + }, };