Skip to content

Commit 6dce839

Browse files
Merge pull request #752 from kubeflow/main
[pull] main from kubeflow:main
2 parents 737fce4 + 1da2b11 commit 6dce839

File tree

15 files changed

+372
-126
lines changed

15 files changed

+372
-126
lines changed

catalog/pkg/openapi/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/kubeflow/model-registry/catalog/pkg/openapi
22

3-
go 1.25
3+
go 1.24.6

clients/python/poetry.lock

Lines changed: 39 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ coverage = { extras = ["toml"], version = "^7.3.2" }
5151
pytest-cov = ">=4.1,<8.0"
5252
pytest-mock = ">=3.7.0"
5353
pytest-xdist = "^3.5.0"
54-
ruff = ">=0.5.2,<0.14.0"
54+
ruff = ">=0.5.2,<0.15.0"
5555
mypy = "^1.7.0"
5656
# atm Ray is only available <3.13, so we will E2E test using Ray in compatible py environments.
5757
ray = [

clients/python/tests/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ def get_mock_custom_oci_backend():
318318
def pull_mock_imple(base_image, dest_dir, **kwargs):
319319
pathlib.Path(dest_dir).joinpath("oci-layout").write_text(oci_layout_contents)
320320
pathlib.Path(dest_dir).joinpath("index.json").write_text(index_json_contents)
321+
blobs_sha256_dir = pathlib.Path(dest_dir).joinpath("blobs").joinpath("sha256")
322+
blobs_sha256_dir.mkdir(parents=True, exist_ok=True)
323+
blobs_sha256_dir.joinpath("unused-blob").write_text("{}")
321324

322325
pull_mock.side_effect = pull_mock_imple
323326
return BackendDefinition(

clients/ui/api/openapi/mod-arch.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,6 +2101,21 @@ components:
21012101
type: array
21022102
items:
21032103
type: string
2104+
status:
2105+
description: |-
2106+
Operational status of a catalog source.
2107+
- `available`: The source is functioning correctly and models can be retrieved
2108+
- `error`: The source is experiencing issues and cannot provide models
2109+
- `disabled`: The source has been intentionally disabled
2110+
type: string
2111+
enum:
2112+
- available
2113+
- error
2114+
- disabled
2115+
error:
2116+
description: |-
2117+
Error message when status is Failed. Contains details about what went wrong.
2118+
type: string
21042119
CatalogSourceList:
21052120
description: List of CatalogSource entities.
21062121
allOf:

clients/ui/bff/internal/mocks/static_data_mock.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,41 +802,59 @@ func GetCatalogModelListMock() models.CatalogModelList {
802802

803803
func GetCatalogSourceMocks() []models.CatalogSource {
804804
enabled := true
805-
disabled := false
805+
disabledBool := false
806+
807+
// Status examples (matching OpenAPI spec)
808+
availableStatus := "available"
809+
errorStatus := "error"
810+
disabledStatus := "disabled"
811+
812+
invalidCredentialError := "The provided API key is invalid or has expired. Please update your credentials."
813+
invalidOrgError := "The specified organization 'invalid-org' does not exist or you don't have access to it."
814+
806815
return []models.CatalogSource{
807816
{
808817
Id: "sample-source",
809818
Name: "Sample mocked source",
810819
Enabled: &enabled,
811820
Labels: []string{"Sample category 1", "Sample category 2", "Sample category"},
821+
Status: &availableStatus,
812822
},
813823
{
814824
Id: "huggingface",
815825
Name: "Hugging Face",
816826
Labels: []string{"Sample category 2", "Sample category"},
827+
// Status is nil - represents "Starting" state (no status yet)
828+
Status: nil,
817829
},
818830
{
819831
Id: "adminModel1",
820832
Name: "Admin model 1",
821833
Enabled: &enabled,
822834
Labels: []string{},
835+
Status: &errorStatus,
836+
Error: &invalidCredentialError,
823837
},
824838
{
825839
Id: "adminModel2",
826840
Name: "Admin model 2",
827841
Enabled: &enabled,
828842
Labels: []string{"Sample category 1"},
843+
Status: &errorStatus,
844+
Error: &invalidOrgError,
829845
},
830846
{
831847
Id: "dora",
832848
Name: "Dora source",
833849
Labels: []string{},
850+
Status: &availableStatus,
834851
},
835852
{
836853
Id: "adminModel3",
837854
Name: "Admin model 3",
838-
Enabled: &disabled,
855+
Enabled: &disabledBool,
839856
Labels: []string{},
857+
Status: &disabledStatus,
840858
},
841859
}
842860
}

clients/ui/bff/internal/models/catalog_source_list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ type CatalogSource struct {
55
Name string `json:"name"`
66
Enabled *bool `json:"enabled,omitempty"`
77
Labels []string `json:"labels"`
8+
Status *string `json:"status,omitempty"`
9+
Error *string `json:"error,omitempty"`
810
}
911

1012
type CatalogSourceList struct {

clients/ui/frontend/src/__mocks__/mockCatalogSourceList.ts

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,65 @@ export const mockCatalogSource = (partial?: Partial<CatalogSource>): CatalogSour
55
name: 'sample source',
66
enabled: true,
77
labels: ['Sample category 1', 'Sample category 2', 'Community'],
8+
status: 'available',
89
...partial,
910
});
1011

12+
// Mock source with no status (Starting state - no status field)
13+
export const mockCatalogSourceStarting = (): CatalogSource => ({
14+
id: 'starting-source',
15+
name: 'Starting Source',
16+
enabled: true,
17+
labels: ['Community'],
18+
// No status field - represents "Starting" state
19+
});
20+
21+
// Mock source with error status and error message (invalid credential)
22+
export const mockCatalogSourceFailedCredential = (): CatalogSource => ({
23+
id: 'failed-credential-source',
24+
name: 'Failed Credential Source',
25+
enabled: true,
26+
labels: ['Enterprise'],
27+
status: 'error',
28+
error: 'The provided API key is invalid or has expired. Please update your credentials.',
29+
});
30+
31+
// Mock source with error status and error message (invalid organization)
32+
export const mockCatalogSourceFailedOrg = (): CatalogSource => ({
33+
id: 'failed-org-source',
34+
name: 'Failed Organization Source',
35+
enabled: true,
36+
labels: ['Enterprise'],
37+
status: 'error',
38+
error: "The specified organization 'invalid-org' does not exist or you don't have access to it.",
39+
});
40+
41+
// Mock source with disabled status
42+
export const mockCatalogSourceDisabled = (): CatalogSource => ({
43+
id: 'disabled-source',
44+
name: 'Disabled Source',
45+
enabled: false,
46+
labels: ['Community'],
47+
status: 'disabled',
48+
});
49+
50+
// Mock source with available status
51+
export const mockCatalogSourceActive = (): CatalogSource => ({
52+
id: 'active-source',
53+
name: 'Active Source',
54+
enabled: true,
55+
labels: ['Community', 'Enterprise'],
56+
status: 'available',
57+
});
58+
1159
export const mockCatalogSourceList = (partial?: Partial<CatalogSourceList>): CatalogSourceList => ({
12-
items: [mockCatalogSource({})],
60+
items: [
61+
mockCatalogSourceActive(),
62+
mockCatalogSourceStarting(),
63+
mockCatalogSourceFailedCredential(),
64+
mockCatalogSourceFailedOrg(),
65+
mockCatalogSourceDisabled(),
66+
],
1367
pageSize: 10,
1468
size: 25,
1569
nextPageToken: '',

0 commit comments

Comments
 (0)