Skip to content

Commit

Permalink
Cleans up some unused function params in BFF (kubeflow#450)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Creasy <[email protected]>
  • Loading branch information
alexcreasy authored Oct 4, 2024
1 parent febed3a commit 9bcbfea
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion clients/ui/bff/internal/api/model_registry_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

type ModelRegistryListEnvelope Envelope[[]data.ModelRegistryModel, None]

func (app *App) ModelRegistryHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
func (app *App) ModelRegistryHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {

registries, err := app.models.ModelRegistry.FetchAllModelRegistries(app.kubernetesClient)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion clients/ui/bff/internal/api/model_versions_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (app *App) GetModelVersionHandler(w http.ResponseWriter, r *http.Request, p
}
}

func (app *App) CreateModelVersionHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
func (app *App) CreateModelVersionHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
client, ok := r.Context().Value(httpClientKey).(integrations.HTTPClientInterface)
if !ok {
app.serverErrorResponse(w, r, errors.New("REST client not found"))
Expand Down
10 changes: 5 additions & 5 deletions clients/ui/bff/internal/data/model_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func TestGetModelVersion(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockModelVersion()

Expand All @@ -39,7 +39,7 @@ func TestGetModelVersion(t *testing.T) {
}

func TestCreateModelVersion(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockModelVersion()

Expand All @@ -64,7 +64,7 @@ func TestCreateModelVersion(t *testing.T) {
}

func TestUpdateModelVersion(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockModelVersion()

Expand Down Expand Up @@ -92,7 +92,7 @@ func TestUpdateModelVersion(t *testing.T) {
}

func TestGetModelArtifactsByModelVersion(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockModelArtifactList()

Expand Down Expand Up @@ -143,7 +143,7 @@ func TestGetModelArtifactsByModelVersionWithPageParams(t *testing.T) {
}

func TestCreateModelArtifactByModelVersion(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockModelArtifact()

Expand Down
12 changes: 6 additions & 6 deletions clients/ui/bff/internal/data/registered_model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func TestGetAllRegisteredModels(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockRegisteredModelList()

Expand Down Expand Up @@ -60,7 +60,7 @@ func TestGetAllRegisteredModelsWithPageParams(t *testing.T) {
}

func TestCreateRegisteredModel(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockRegisteredModel()

Expand All @@ -85,7 +85,7 @@ func TestCreateRegisteredModel(t *testing.T) {
}

func TestGetRegisteredModel(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockRegisteredModel()

Expand All @@ -107,7 +107,7 @@ func TestGetRegisteredModel(t *testing.T) {
}

func TestUpdateRegisteredModel(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockRegisteredModel()

Expand Down Expand Up @@ -135,7 +135,7 @@ func TestUpdateRegisteredModel(t *testing.T) {
}

func TestGetAllModelVersions(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockModelVersionList()

Expand Down Expand Up @@ -188,7 +188,7 @@ func TestGetAllModelVersionsWithPageParams(t *testing.T) {
}

func TestCreateModelVersionForRegisteredModel(t *testing.T) {
gofakeit.Seed(0) //nolint:errcheck
_ = gofakeit.Seed(0)

expected := mocks.GenerateMockModelVersion()

Expand Down
2 changes: 1 addition & 1 deletion clients/ui/bff/internal/mocks/k8s_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type KubernetesClientMock struct {
mock.Mock
}

func NewKubernetesClient(logger *slog.Logger) (k8s.KubernetesClientInterface, error) {
func NewKubernetesClient(_ *slog.Logger) (k8s.KubernetesClientInterface, error) {
return &KubernetesClientMock{}, nil
}

Expand Down
16 changes: 8 additions & 8 deletions clients/ui/bff/internal/mocks/model_registry_client_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@ func (m *ModelRegistryClientMock) GetAllRegisteredModels(_ integrations.HTTPClie
return &mockData, nil
}

func (m *ModelRegistryClientMock) CreateRegisteredModel(client integrations.HTTPClientInterface, jsonData []byte) (*openapi.RegisteredModel, error) {
func (m *ModelRegistryClientMock) CreateRegisteredModel(_ integrations.HTTPClientInterface, _ []byte) (*openapi.RegisteredModel, error) {
mockData := GetRegisteredModelMocks()[0]
return &mockData, nil
}

func (m *ModelRegistryClientMock) GetRegisteredModel(client integrations.HTTPClientInterface, id string) (*openapi.RegisteredModel, error) {
func (m *ModelRegistryClientMock) GetRegisteredModel(_ integrations.HTTPClientInterface, _ string) (*openapi.RegisteredModel, error) {
mockData := GetRegisteredModelMocks()[0]
return &mockData, nil
}

func (m *ModelRegistryClientMock) UpdateRegisteredModel(client integrations.HTTPClientInterface, id string, jsonData []byte) (*openapi.RegisteredModel, error) {
func (m *ModelRegistryClientMock) UpdateRegisteredModel(_ integrations.HTTPClientInterface, _ string, _ []byte) (*openapi.RegisteredModel, error) {
mockData := GetRegisteredModelMocks()[0]
return &mockData, nil
}

func (m *ModelRegistryClientMock) GetModelVersion(client integrations.HTTPClientInterface, id string) (*openapi.ModelVersion, error) {
func (m *ModelRegistryClientMock) GetModelVersion(_ integrations.HTTPClientInterface, _ string) (*openapi.ModelVersion, error) {
mockData := GetModelVersionMocks()[0]
return &mockData, nil
}

func (m *ModelRegistryClientMock) CreateModelVersion(client integrations.HTTPClientInterface, jsonData []byte) (*openapi.ModelVersion, error) {
func (m *ModelRegistryClientMock) CreateModelVersion(_ integrations.HTTPClientInterface, _ []byte) (*openapi.ModelVersion, error) {
mockData := GetModelVersionMocks()[0]
return &mockData, nil
}

func (m *ModelRegistryClientMock) UpdateModelVersion(client integrations.HTTPClientInterface, id string, jsonData []byte) (*openapi.ModelVersion, error) {
func (m *ModelRegistryClientMock) UpdateModelVersion(_ integrations.HTTPClientInterface, _ string, _ []byte) (*openapi.ModelVersion, error) {
mockData := GetModelVersionMocks()[0]
return &mockData, nil
}
Expand All @@ -56,7 +56,7 @@ func (m *ModelRegistryClientMock) GetAllModelVersions(_ integrations.HTTPClientI
return &mockData, nil
}

func (m *ModelRegistryClientMock) CreateModelVersionForRegisteredModel(client integrations.HTTPClientInterface, id string, jsonData []byte) (*openapi.ModelVersion, error) {
func (m *ModelRegistryClientMock) CreateModelVersionForRegisteredModel(_ integrations.HTTPClientInterface, _ string, _ []byte) (*openapi.ModelVersion, error) {
mockData := GetModelVersionMocks()[0]
return &mockData, nil
}
Expand All @@ -66,7 +66,7 @@ func (m *ModelRegistryClientMock) GetModelArtifactsByModelVersion(_ integrations
return &mockData, nil
}

func (m *ModelRegistryClientMock) CreateModelArtifactByModelVersion(client integrations.HTTPClientInterface, id string, jsonData []byte) (*openapi.ModelArtifact, error) {
func (m *ModelRegistryClientMock) CreateModelArtifactByModelVersion(_ integrations.HTTPClientInterface, _ string, _ []byte) (*openapi.ModelArtifact, error) {
mockData := GetModelArtifactMocks()[0]
return &mockData, nil
}

0 comments on commit 9bcbfea

Please sign in to comment.