Skip to content
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
2 changes: 1 addition & 1 deletion packages/model-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"branch": "main",
"src": "clients/ui",
"target": "upstream",
"commit": "d941024350a42ef5f0b047c4617ee98e85158e26"
"commit": "6e18d5aca6de378c66794ae581b9c42d0767aff7"
},
"module-federation": {
"name": "modelRegistry",
Expand Down
4 changes: 2 additions & 2 deletions packages/model-registry/upstream/bff/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ require (
github.com/rs/cors v1.11.1
github.com/stretchr/testify v1.11.1
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.35.3
k8s.io/apimachinery v0.35.3
k8s.io/api v0.35.4
k8s.io/apimachinery v0.35.4
k8s.io/client-go v0.35.3
sigs.k8s.io/controller-runtime v0.23.3
)
Expand Down
8 changes: 4 additions & 4 deletions packages/model-registry/upstream/bff/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.35.3 h1:pA2fiBc6+N9PDf7SAiluKGEBuScsTzd2uYBkA5RzNWQ=
k8s.io/api v0.35.3/go.mod h1:9Y9tkBcFwKNq2sxwZTQh1Njh9qHl81D0As56tu42GA4=
k8s.io/api v0.35.4 h1:P7nFYKl5vo9AGUp1Z+Pmd3p2tA7bX2wbFWCvDeRv988=
k8s.io/api v0.35.4/go.mod h1:yl4lqySWOgYJJf9RERXKUwE9g2y+CkuwG+xmcOK8wXU=
k8s.io/apiextensions-apiserver v0.35.0 h1:3xHk2rTOdWXXJM+RDQZJvdx0yEOgC0FgQ1PlJatA5T4=
k8s.io/apiextensions-apiserver v0.35.0/go.mod h1:E1Ahk9SADaLQ4qtzYFkwUqusXTcaV2uw3l14aqpL2LU=
k8s.io/apimachinery v0.35.3 h1:MeaUwQCV3tjKP4bcwWGgZ/cp/vpsRnQzqO6J6tJyoF8=
k8s.io/apimachinery v0.35.3/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns=
k8s.io/apimachinery v0.35.4 h1:xtdom9RG7e+yDp71uoXoJDWEE2eOiHgeO4GdBzwWpds=
k8s.io/apimachinery v0.35.4/go.mod h1:NNi1taPOpep0jOj+oRha3mBJPqvi0hGdaV8TCqGQ+cc=
k8s.io/client-go v0.35.3 h1:s1lZbpN4uI6IxeTM2cpdtrwHcSOBML1ODNTCCfsP1pg=
k8s.io/client-go v0.35.3/go.mod h1:RzoXkc0mzpWIDvBrRnD+VlfXP+lRzqQjCmKtiwZ8Q9c=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ComponentLabelValue = "model-registry"
const ComponentLabelValueCatalog = "model-catalog"

const CatalogSourceKey = "sources.yaml"
const CatalogSourceDefaultConfigMapName = "model-catalog-default-sources"
const CatalogSourceDefaultConfigMapName = "default-catalog-sources"
const CatalogSourceUserConfigMapName = "model-catalog-sources"

type KubernetesClientInterface interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ catalogs:
}

if _, err := k8sClient.CoreV1().ConfigMaps(namespace).Create(ctx, cm, metav1.CreateOptions{}); err != nil {
return fmt.Errorf("failed to create model-catalog-default-sources configmap: %w", err)
return fmt.Errorf("failed to create default-catalog-sources configmap: %w", err)
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class CatalogSourceConfigRow extends TableRow {
return this;
}

shouldHaveValidationStatus(status: 'Connected' | 'Failed' | 'Starting' | 'Unknown' | '-') {
shouldHaveValidationStatus(status: 'Ready' | 'Failed' | 'Starting' | 'Unknown' | '-') {
this.findValidationStatus().contains(status);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ describe('Catalog Source Configs Table', () => {
modelCatalogSettings.visit();
const row = modelCatalogSettings.getRow('HuggingFace Google');
row.findName().should('be.visible');
row.shouldHaveValidationStatus('Connected');
row.shouldHaveValidationStatus('Ready');
row.findValidationStatus().findByTestId('source-status-connected-hf-google').should('exist');
});

Expand Down Expand Up @@ -783,15 +783,15 @@ describe('Manage Source Page', () => {

// Before entering organization, should show generic text
cy.contains(
'Optionally filter which models from your source appear in the model catalog',
'Optionally filter which models from this source appear in the model catalog',
).should('exist');

// Fill organization name
manageSourcePage.fillOrganization('Google');

// After entering organization, should show organization-specific text
cy.contains(
'Optionally filter which Google models from your source appear in the model catalog',
'Optionally filter which Google models from this source appear in the model catalog',
).should('exist');
cy.contains('all Google models from the source will be visible').should('exist');

Expand All @@ -800,7 +800,7 @@ describe('Manage Source Page', () => {

// Text should update to new organization
cy.contains(
'Optionally filter which Meta models from your source appear in the model catalog',
'Optionally filter which Meta models from this source appear in the model catalog',
).should('exist');
cy.contains('all Meta models from the source will be visible').should('exist');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const McpCatalog: React.FC = () => {
provideChildrenPadding
>
<Sidebar hasBorder hasGutter>
<SidebarPanel>
<SidebarPanel variant="sticky">
<McpCatalogFilters />
</SidebarPanel>
<SidebarContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const CatalogSourceStatus: React.FC<CatalogSourceStatusProps> = ({ catalogSource
case CatalogSourceStatusEnum.AVAILABLE:
return (
<Label status="success" data-testid={`source-status-connected-${catalogSourceConfig.id}`}>
Connected
Ready
</Label>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ModalVariant,
} from '@patternfly/react-core';
import { ExclamationCircleIcon } from '@patternfly/react-icons';
import { ERROR_MESSAGES } from '~/app/pages/modelCatalogSettings/constants';

type CatalogSourceStatusErrorModalProps = {
isOpen: boolean;
Expand Down Expand Up @@ -45,12 +46,11 @@ const CatalogSourceStatusErrorModal: React.FC<CatalogSourceStatusErrorModalProps
<Alert
variant="danger"
isInline
title="Validation failed"
title={ERROR_MESSAGES.VALIDATION_FAILED}
data-testid="catalog-source-status-error-alert"
>
<p data-testid="catalog-source-status-error-details">
The system cannot establish a connection to the source. Ensure that the organization is
accurate, then try again.
{ERROR_MESSAGES.VALIDATION_FAILED_BODY}
</p>
{errorMessage && <p data-testid="catalog-source-status-error-message">{errorMessage}</p>}
</Alert>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';
import {
FormGroup,
TextInput,
FormHelperText,
HelperText,
Expand All @@ -12,16 +11,18 @@ import {
} from '@patternfly/react-core';
import { UpdateObjectAtPropAndValue } from 'mod-arch-shared';
import PasswordInput from '~/app/shared/components/PasswordInput';
import FormFieldset from '~/app/pages/modelRegistry/screens/components/FormFieldset';
import FormSection from '~/app/pages/modelRegistry/components/pf-overrides/FormSection';
import ThemeAwareFormGroupWrapper from '~/app/pages/settings/components/ThemeAwareFormGroupWrapper';
import { ManageSourceFormData } from '~/app/pages/modelCatalogSettings/useManageSourceData';
import { validateOrganization } from '~/app/pages/modelCatalogSettings/utils/validation';
import {
FORM_LABELS,
VALIDATION_MESSAGES,
HELP_TEXT,
DESCRIPTION_TEXT,
HELPER_TEXT,
PLACEHOLDERS,
ERROR_MESSAGES,
SUCCESS_MESSAGES,
} from '~/app/pages/modelCatalogSettings/constants';
import { TempDevFeature, useTempDevFeatureAvailable } from '~/app/hooks/useTempDevFeatureAvailable';

Expand Down Expand Up @@ -67,7 +68,7 @@ const CredentialsSection: React.FC<CredentialsSectionProps> = ({
<>
<FormHelperText>
<HelperText>
<HelperTextItem>{HELP_TEXT.ORGANIZATION}</HelperTextItem>
<HelperTextItem>{DESCRIPTION_TEXT.ORGANIZATION}</HelperTextItem>
</HelperText>
</FormHelperText>
</>
Expand All @@ -87,15 +88,22 @@ const CredentialsSection: React.FC<CredentialsSectionProps> = ({
) : undefined;

const organizationFormGroup = (
<ThemeAwareFormGroupWrapper
label={FORM_LABELS.ORGANIZATION}
fieldId="organization"
isRequired
descriptionTextNode={organizationDescriptionTxtNode}
helperTextNode={organizationHelperTxtNode}
>
{organizationInput}
</ThemeAwareFormGroupWrapper>
<>
<ThemeAwareFormGroupWrapper
label={FORM_LABELS.ORGANIZATION}
fieldId="organization"
isRequired
descriptionTextNode={organizationDescriptionTxtNode}
helperTextNode={organizationHelperTxtNode}
>
{organizationInput}
</ThemeAwareFormGroupWrapper>
<FormHelperText>
<HelperText>
<HelperTextItem>{HELPER_TEXT.ORGANIZATION_SLUG}</HelperTextItem>
</HelperText>
</FormHelperText>
</>
);

const accessTokenInput = (
Expand All @@ -111,34 +119,55 @@ const CredentialsSection: React.FC<CredentialsSectionProps> = ({
/>
);

const accessTokenDescriptionTxtNode = (
<FormHelperText>
<HelperText>
<HelperTextItem>{DESCRIPTION_TEXT.ACCESS_TOKEN}</HelperTextItem>
</HelperText>
</FormHelperText>
);

const accessTokenHelperTxtNode = (
<FormHelperText>
<HelperText>
<HelperTextItem>{HELPER_TEXT.ACCESS_TOKEN}</HelperTextItem>
</HelperText>
</FormHelperText>
);

const accessTokenFormGroup = (
<>
<FormGroup label={FORM_LABELS.ACCESS_TOKEN} fieldId="access-token">
<FormHelperText>
<HelperText>
<HelperTextItem>{HELP_TEXT.ACCESS_TOKEN}</HelperTextItem>
</HelperText>
</FormHelperText>
<FormFieldset component={accessTokenInput} field="Access token" />
</FormGroup>
<ThemeAwareFormGroupWrapper
label={FORM_LABELS.ACCESS_TOKEN}
fieldId="access-token"
descriptionTextNode={accessTokenDescriptionTxtNode}
helperTextNode={accessTokenHelperTxtNode}
>
{accessTokenInput}
</ThemeAwareFormGroupWrapper>
{validationError && (
<Alert isInline variant="danger" title="Validation failed" className="pf-v5-u-mt-md">
<Alert
isInline
variant="danger"
title={ERROR_MESSAGES.VALIDATION_FAILED}
className="pf-v6-u-mt-md"
>
{validationError.message}
</Alert>
)}
{isValidationSuccess && (
<Alert
isInline
variant="success"
className="pf-v5-u-mt-md"
title="Validation successful"
className="pf-v6-u-mt-md"
title={SUCCESS_MESSAGES.VALIDATION_SUCCESSFUL}
actionClose={<AlertActionCloseButton onClose={onClearValidationSuccess} />}
>
The organization and accessToken are valid for connection.
{SUCCESS_MESSAGES.VALIDATION_SUCCESSFUL_BODY}
</Alert>
)}

<ActionList className="pf-v5-u-mt-md">
<ActionList className="pf-v6-u-mt-md">
<Button
isDisabled={!isOrganizationValid || isValidating}
variant="link"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import { catalogSettingsUrl } from '~/app/routes/modelCatalogSettings/modelCatal
import { isFormValid } from '~/app/pages/modelCatalogSettings/utils/validation';
import { useManageSourceData } from '~/app/pages/modelCatalogSettings/useManageSourceData';
import { useSourcePreview } from '~/app/pages/modelCatalogSettings/useSourcePreview';
import { FORM_LABELS, DESCRIPTIONS } from '~/app/pages/modelCatalogSettings/constants';
import {
FORM_LABELS,
DESCRIPTION_TEXT,
ERROR_MESSAGES,
} from '~/app/pages/modelCatalogSettings/constants';
import { ModelCatalogSettingsContext } from '~/app/context/modelCatalogSettings/ModelCatalogSettingsContext';
import {
catalogSourceConfigToFormData,
Expand Down Expand Up @@ -82,7 +86,7 @@ const ManageSourceForm: React.FC<ManageSourceFormProps> = ({
refreshCatalogSourceConfigs();
navigate(catalogSettingsUrl());
} catch (error) {
setSubmitError(error instanceof Error ? error : new Error(`Failed to save source`));
setSubmitError(error instanceof Error ? error : new Error(ERROR_MESSAGES.SAVE_FAILED));
} finally {
setIsSubmitting(false);
}
Expand Down Expand Up @@ -154,7 +158,7 @@ const ManageSourceForm: React.FC<ManageSourceFormProps> = ({
id="enable-source"
name="enable-source"
data-testid="enable-source-checkbox"
description={DESCRIPTIONS.ENABLE_SOURCE}
description={DESCRIPTION_TEXT.ENABLE_SOURCE}
isChecked={formData.enabled}
onChange={(_event, checked) => setData('enabled', checked)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ActionListGroup,
Alert,
} from '@patternfly/react-core';
import { ERROR_MESSAGES } from '~/app/pages/modelCatalogSettings/constants';
import PreviewButton from './PreviewButton';

type ManageSourceFormFooterProps = {
Expand Down Expand Up @@ -38,7 +39,7 @@ const ManageSourceFormFooter: React.FC<ManageSourceFormFooterProps> = ({
<Stack hasGutter>
{submitError && (
<StackItem>
<Alert variant="danger" isInline title="Error saving source">
<Alert variant="danger" isInline title={ERROR_MESSAGES.SAVE_FAILED}>
{submitError.message}
</Alert>
</StackItem>
Expand Down
Loading
Loading