Skip to content

Commit

Permalink
testing error
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvogt committed Dec 19, 2024
1 parent 4fd64d6 commit 81aa709
Show file tree
Hide file tree
Showing 128 changed files with 1,593 additions and 2 deletions.
7 changes: 5 additions & 2 deletions backend/src/routes/api/health/healthUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getDashboardConfig } from '../../../utils/resourceUtils';
import { KubeFastifyInstance } from '../../../types';
import { createCustomError } from '../../../utils/requestUtils';

let count = 0;
export const health = async (fastify: KubeFastifyInstance): Promise<{ health: string }> => {
const kubeContext = fastify.kube?.currentContext || '';
if (!kubeContext && !kubeContext.trim()) {
Expand All @@ -17,7 +18,9 @@ export const health = async (fastify: KubeFastifyInstance): Promise<{ health: st
fastify.log.error(error, 'failed to get dashboard config');
throw error;
} else {
throw new Error('this is a made up error for testing');
// return { health: 'ok' };
if (count++ < 3) {
throw new Error('this is a made up error for testing');
}
return { health: 'ok' };
}
};
2 changes: 2 additions & 0 deletions frontend/@mf-types/@mf/model-registry/Test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './compiled-types/src/Test';
export { default } from './compiled-types/src/Test';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import React from 'react';
declare const Test: React.FC;
export default Test;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const BFF_API_VERSION = "v1";
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as React from 'react';
import { ModelRegistryAPIState } from './useModelRegistryAPIState';
export type ModelRegistryContextType = {
apiState: ModelRegistryAPIState;
refreshAPIState: () => void;
};
type ModelRegistryContextProviderProps = {
children: React.ReactNode;
modelRegistryName: string;
};
export declare const ModelRegistryContext: React.Context<ModelRegistryContextType>;
export declare const ModelRegistryContextProvider: React.FC<ModelRegistryContextProviderProps>;
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as React from 'react';
import { ModelRegistry } from '~/app/types';
export type ModelRegistrySelectorContextType = {
modelRegistriesLoaded: boolean;
modelRegistriesLoadError?: Error;
modelRegistries: ModelRegistry[];
preferredModelRegistry: ModelRegistry | undefined;
updatePreferredModelRegistry: (modelRegistry: ModelRegistry | undefined) => void;
apiPrefix: string;
};
type ModelRegistrySelectorContextProviderProps = {
apiPrefix?: string;
children: React.ReactNode;
};
export declare const ModelRegistrySelectorContext: React.Context<ModelRegistrySelectorContextType>;
export declare const ModelRegistrySelectorContextProvider: React.FC<ModelRegistrySelectorContextProviderProps>;
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { Notification, NotificationAction } from '~/app/types';
type NotificationContextProps = {
notifications: Notification[];
notificationCount: number;
updateNotificationCount: React.Dispatch<React.SetStateAction<number>>;
dispatch: React.Dispatch<NotificationAction>;
};
export declare const NotificationContext: React.Context<NotificationContextProps>;
type NotificationContextProviderProps = {
children: React.ReactNode;
};
export declare const NotificationContextProvider: React.FC<NotificationContextProviderProps>;
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { APIState } from '~/shared/api/types';
import { ModelRegistryAPIs } from '~/app/types';
export type ModelRegistryAPIState = APIState<ModelRegistryAPIs>;
declare const useModelRegistryAPIState: (hostPath: string | null) => [apiState: ModelRegistryAPIState, refreshAPIState: () => void];
export default useModelRegistryAPIState;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { FetchState } from '~/shared/utilities/useFetchState';
import { ModelArtifactList } from '~/app/types';
declare const useModelArtifactsByVersionId: (modelVersionId?: string) => FetchState<ModelArtifactList>;
export default useModelArtifactsByVersionId;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { FetchState } from '~/shared/utilities/useFetchState';
import { ModelRegistry } from '~/app/types';
declare const useModelRegistries: (apiPrefix?: string) => FetchState<ModelRegistry[]>;
export default useModelRegistries;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ModelRegistryAPIState } from '~/app/context/useModelRegistryAPIState';
type UseModelRegistryAPI = ModelRegistryAPIState & {
refreshAllAPI: () => void;
};
export declare const useModelRegistryAPI: () => UseModelRegistryAPI;
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { FetchState } from '~/shared/utilities/useFetchState';
import { ModelVersion } from '~/app/types';
declare const useModelVersionById: (modelVersionId?: string) => FetchState<ModelVersion | null>;
export default useModelVersionById;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { FetchState } from '~/shared/utilities/useFetchState';
import { ModelVersionList } from '~/app/types';
declare const useModelVersionsByRegisteredModel: (registeredModelId?: string) => FetchState<ModelVersionList>;
export default useModelVersionsByRegisteredModel;
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
declare enum NotificationTypes {
SUCCESS = "success",
ERROR = "error",
INFO = "info",
WARNING = "warning"
}
type NotificationProps = (title: string, message?: React.ReactNode) => void;
type NotificationRemoveProps = (id: number | undefined) => void;
type NotificationTypeFunc = {
[key in NotificationTypes]: NotificationProps;
};
interface NotificationFunc extends NotificationTypeFunc {
remove: NotificationRemoveProps;
}
export declare const useNotification: () => NotificationFunc;
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { FetchState } from '~/shared/utilities/useFetchState';
import { RegisteredModel } from '~/app/types';
declare const useRegisteredModelById: (registeredModel?: string) => FetchState<RegisteredModel | null>;
export default useRegisteredModelById;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { FetchState } from '~/shared/utilities/useFetchState';
import { RegisteredModelList } from '~/app/types';
declare const useRegisteredModels: () => FetchState<RegisteredModelList>;
export default useRegisteredModels;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as React from 'react';
type ModelRegistryCoreLoaderProps = {
getInvalidRedirectPath: (modelRegistry: string) => string;
};
declare const ModelRegistryCoreLoader: React.FC<ModelRegistryCoreLoaderProps>;
export default ModelRegistryCoreLoader;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import * as React from 'react';
import '~/shared/style/MUI-theme.scss';
declare const ModelRegistryRoutes: React.FC;
export default ModelRegistryRoutes;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from 'react';
type InvalidModelRegistryProps = {
title?: string;
modelRegistry?: string;
};
declare const InvalidModelRegistry: React.FC<InvalidModelRegistryProps>;
export default InvalidModelRegistry;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as React from 'react';
import { ModelRegistryCustomProperties } from '~/app/types';
type ModelPropertiesDescriptionListGroupProps = {
customProperties: ModelRegistryCustomProperties;
isArchive?: boolean;
saveEditedCustomProperties: (properties: ModelRegistryCustomProperties) => Promise<unknown>;
};
declare const ModelPropertiesDescriptionListGroup: React.FC<ModelPropertiesDescriptionListGroupProps>;
export default ModelPropertiesDescriptionListGroup;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react';
import { KeyValuePair } from '~/shared/types';
import { EitherNotBoth } from '~/shared/typeHelpers';
type ModelPropertiesTableRowProps = {
allExistingKeys: string[];
setIsEditing: (isEditing: boolean) => void;
isSavingEdits: boolean;
isArchive?: boolean;
setIsSavingEdits: (isSaving: boolean) => void;
saveEditedProperty: (oldKey: string, newPair: KeyValuePair) => Promise<unknown>;
} & EitherNotBoth<{
isAddRow: true;
}, {
isEditing: boolean;
keyValuePair: KeyValuePair;
deleteProperty: (key: string) => Promise<unknown>;
}>;
declare const ModelPropertiesTableRow: React.FC<ModelPropertiesTableRowProps>;
export default ModelPropertiesTableRow;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';
import ApplicationsPage from '~/shared/components/ApplicationsPage';
type ModelRegistryProps = Omit<React.ComponentProps<typeof ApplicationsPage>, 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding' | 'removeChildrenTopPadding' | 'headerContent'>;
declare const ModelRegistry: React.FC<ModelRegistryProps>;
export default ModelRegistry;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as React from 'react';
type ModelRegistrySelectorProps = {
modelRegistry: string;
onSelection: (modelRegistry: string) => void;
primary?: boolean;
};
declare const ModelRegistrySelector: React.FC<ModelRegistrySelectorProps>;
export default ModelRegistrySelector;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from 'react';
import ModelRegistrySelector from './ModelRegistrySelector';
type ModelRegistrySelectorNavigatorProps = {
getRedirectPath: (namespace: string) => string;
} & Omit<React.ComponentProps<typeof ModelRegistrySelector>, 'onSelection' | 'modelRegistry'>;
declare const ModelRegistrySelectorNavigator: React.FC<ModelRegistrySelectorNavigatorProps>;
export default ModelRegistrySelectorNavigator;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import ApplicationsPage from '~/shared/components/ApplicationsPage';
import { ModelVersionDetailsTab } from './const';
type ModelVersionsDetailProps = {
tab: ModelVersionDetailsTab;
} & Omit<React.ComponentProps<typeof ApplicationsPage>, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>;
declare const ModelVersionsDetails: React.FC<ModelVersionsDetailProps>;
export default ModelVersionsDetails;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from 'react';
import { ModelVersion } from '~/app/types';
interface ModelVersionsDetailsHeaderActionsProps {
mv: ModelVersion;
}
declare const ModelVersionsDetailsHeaderActions: React.FC<ModelVersionsDetailsHeaderActionsProps>;
export default ModelVersionsDetailsHeaderActions;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as React from 'react';
import { ModelVersion } from '~/app/types';
import { ModelVersionDetailsTab } from './const';
type ModelVersionDetailTabsProps = {
tab: ModelVersionDetailsTab;
modelVersion: ModelVersion;
isArchiveVersion?: boolean;
refresh: () => void;
};
declare const ModelVersionDetailsTabs: React.FC<ModelVersionDetailTabsProps>;
export default ModelVersionDetailsTabs;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as React from 'react';
import { ModelVersion } from '~/app/types';
type ModelVersionDetailsViewProps = {
modelVersion: ModelVersion;
isArchiveVersion?: boolean;
refresh: () => void;
};
declare const ModelVersionDetailsView: React.FC<ModelVersionDetailsViewProps>;
export default ModelVersionDetailsView;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as React from 'react';
import { ModelVersion } from '~/app/types';
type ModelVersionSelectorProps = {
rmId?: string;
selection: ModelVersion;
onSelect: (versionId: string) => void;
};
declare const ModelVersionSelector: React.FC<ModelVersionSelectorProps>;
export default ModelVersionSelector;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export declare enum ModelVersionDetailsTab {
DETAILS = "details"
}
export declare enum ModelVersionDetailsTabTitle {
DETAILS = "Details"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as React from 'react';
import { RegisteredModel } from '~/app/types';
type ModelDetailsViewProps = {
registeredModel: RegisteredModel;
refresh: () => void;
isArchiveModel?: boolean;
};
declare const ModelDetailsView: React.FC<ModelDetailsViewProps>;
export default ModelDetailsView;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as React from 'react';
import { ModelVersion, RegisteredModel } from '~/app/types';
type ModelVersionListViewProps = {
modelVersions: ModelVersion[];
registeredModel?: RegisteredModel;
isArchiveModel?: boolean;
refresh: () => void;
};
declare const ModelVersionListView: React.FC<ModelVersionListViewProps>;
export default ModelVersionListView;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import { ModelVersionsTab } from '~/app/pages/modelRegistry/screens/ModelVersions/const';
import ApplicationsPage from '~/shared/components/ApplicationsPage';
type ModelVersionsProps = {
tab: ModelVersionsTab;
} & Omit<React.ComponentProps<typeof ApplicationsPage>, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>;
declare const ModelVersions: React.FC<ModelVersionsProps>;
export default ModelVersions;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from 'react';
import { RegisteredModel } from '~/app/types';
interface ModelVersionsHeaderActionsProps {
rm: RegisteredModel;
}
declare const ModelVersionsHeaderActions: React.FC<ModelVersionsHeaderActionsProps>;
export default ModelVersionsHeaderActions;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as React from 'react';
import { Table } from '~/shared/components/table';
import { ModelVersion } from '~/app/types';
type ModelVersionsTableProps = {
clearFilters: () => void;
modelVersions: ModelVersion[];
isArchiveModel?: boolean;
refresh: () => void;
} & Partial<Pick<React.ComponentProps<typeof Table>, 'toolbarContent'>>;
declare const ModelVersionsTable: React.FC<ModelVersionsTableProps>;
export default ModelVersionsTable;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { SortableData } from '~/shared/components/table';
import { ModelVersion } from '~/app/types';
export declare const mvColumns: SortableData<ModelVersion>[];
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as React from 'react';
import { ModelVersion } from '~/app/types';
type ModelVersionsTableRowProps = {
modelVersion: ModelVersion;
isArchiveRow?: boolean;
isArchiveModel?: boolean;
refresh: () => void;
};
declare const ModelVersionsTableRow: React.FC<ModelVersionsTableRowProps>;
export default ModelVersionsTableRow;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as React from 'react';
import { ModelVersion, RegisteredModel } from '~/app/types';
import { ModelVersionsTab } from '~/app/pages/modelRegistry/screens/ModelVersions/const';
type ModelVersionsTabProps = {
tab: ModelVersionsTab;
registeredModel: RegisteredModel;
modelVersions: ModelVersion[];
isArchiveModel?: boolean;
refresh: () => void;
mvRefresh: () => void;
};
declare const ModelVersionsTabs: React.FC<ModelVersionsTabProps>;
export default ModelVersionsTabs;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export declare enum ModelVersionsTab {
VERSIONS = "versions",
DETAILS = "details"
}
export declare enum ModelVersionsTabTitle {
VERSIONS = "Versions",
DETAILS = "Details"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import ApplicationsPage from '~/shared/components/ApplicationsPage';
import { ModelVersionDetailsTab } from '~/app/pages/modelRegistry/screens/ModelVersionDetails/const';
type ArchiveModelVersionDetailsProps = {
tab: ModelVersionDetailsTab;
} & Omit<React.ComponentProps<typeof ApplicationsPage>, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>;
declare const ArchiveModelVersionDetails: React.FC<ArchiveModelVersionDetailsProps>;
export default ArchiveModelVersionDetails;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import { RegisteredModel } from '~/app/types';
type ArchiveModelVersionDetailsBreadcrumbProps = {
preferredModelRegistry?: string;
registeredModel: RegisteredModel | null;
modelVersionName?: string;
};
declare const ArchiveModelVersionDetailsBreadcrumb: React.FC<ArchiveModelVersionDetailsBreadcrumbProps>;
export default ArchiveModelVersionDetailsBreadcrumb;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import ApplicationsPage from '~/shared/components/ApplicationsPage';
import { ModelVersionDetailsTab } from '~/app/pages/modelRegistry/screens/ModelVersionDetails/const';
type ModelVersionsArchiveDetailsProps = {
tab: ModelVersionDetailsTab;
} & Omit<React.ComponentProps<typeof ApplicationsPage>, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>;
declare const ModelVersionsArchiveDetails: React.FC<ModelVersionsArchiveDetailsProps>;
export default ModelVersionsArchiveDetails;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import { RegisteredModel } from '~/app/types';
type ModelVersionArchiveDetailsBreadcrumbProps = {
preferredModelRegistry?: string;
registeredModel: RegisteredModel | null;
modelVersionName?: string;
};
declare const ModelVersionArchiveDetailsBreadcrumb: React.FC<ModelVersionArchiveDetailsBreadcrumbProps>;
export default ModelVersionArchiveDetailsBreadcrumb;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from 'react';
import ApplicationsPage from '~/shared/components/ApplicationsPage';
type ModelVersionsArchiveProps = Omit<React.ComponentProps<typeof ApplicationsPage>, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>;
declare const ModelVersionsArchive: React.FC<ModelVersionsArchiveProps>;
export default ModelVersionsArchive;
Loading

0 comments on commit 81aa709

Please sign in to comment.