Skip to content

Commit

Permalink
Cleans up some unused function params etc
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Creasy <[email protected]>
  • Loading branch information
alexcreasy committed Oct 4, 2024
1 parent 0c369a0 commit e4646b0
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 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
4 changes: 2 additions & 2 deletions clients/ui/bff/internal/api/registered_models_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type RegisteredModelEnvelope Envelope[*openapi.RegisteredModel, None]
type RegisteredModelListEnvelope Envelope[*openapi.RegisteredModelList, None]
type RegisteredModelUpdateEnvelope Envelope[*openapi.RegisteredModelUpdate, None]

func (app *App) GetAllRegisteredModelsHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
func (app *App) GetAllRegisteredModelsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
//TODO (ederign) implement pagination
client, ok := r.Context().Value(httpClientKey).(integrations.HTTPClientInterface)
if !ok {
Expand All @@ -40,7 +40,7 @@ func (app *App) GetAllRegisteredModelsHandler(w http.ResponseWriter, r *http.Req
}
}

func (app *App) CreateRegisteredModelHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
func (app *App) CreateRegisteredModelHandler(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 @@ -13,7 +13,7 @@ import (
)

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

expected := mocks.GenerateMockModelVersion()

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

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

expected := mocks.GenerateMockModelVersion()

Expand All @@ -63,7 +63,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 @@ -91,7 +91,7 @@ func TestUpdateModelVersion(t *testing.T) {
}

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

expected := mocks.GenerateMockModelArtifactList()

Expand All @@ -117,7 +117,7 @@ func TestGetModelArtifactsByModelVersion(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 @@ -13,7 +13,7 @@ import (
)

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

expected := mocks.GenerateMockRegisteredModelList()

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

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

expected := mocks.GenerateMockRegisteredModel()

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

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

expected := mocks.GenerateMockRegisteredModel()

Expand All @@ -84,7 +84,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 @@ -112,7 +112,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 @@ -140,7 +140,7 @@ func TestGetAllModelVersions(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
24 changes: 12 additions & 12 deletions clients/ui/bff/internal/mocks/model_registry_client_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,60 @@ type ModelRegistryClientMock struct {
mock.Mock
}

func NewModelRegistryClient(logger *slog.Logger) (*ModelRegistryClientMock, error) {
func NewModelRegistryClient(_ *slog.Logger) (*ModelRegistryClientMock, error) {
return &ModelRegistryClientMock{}, nil
}

func (m *ModelRegistryClientMock) GetAllRegisteredModels(client integrations.HTTPClientInterface) (*openapi.RegisteredModelList, error) {
func (m *ModelRegistryClientMock) GetAllRegisteredModels(_ integrations.HTTPClientInterface) (*openapi.RegisteredModelList, error) {
mockData := GetRegisteredModelListMock()
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
}

func (m *ModelRegistryClientMock) GetAllModelVersions(client integrations.HTTPClientInterface, id string) (*openapi.ModelVersionList, error) {
func (m *ModelRegistryClientMock) GetAllModelVersions(_ integrations.HTTPClientInterface, _ string) (*openapi.ModelVersionList, error) {
mockData := GetModelVersionListMock()
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
}

func (m *ModelRegistryClientMock) GetModelArtifactsByModelVersion(client integrations.HTTPClientInterface, id string) (*openapi.ModelArtifactList, error) {
func (m *ModelRegistryClientMock) GetModelArtifactsByModelVersion(_ integrations.HTTPClientInterface, _ string) (*openapi.ModelArtifactList, error) {
mockData := GetModelArtifactListMock()
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 e4646b0

Please sign in to comment.