Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bff): correctly forward errors from MR API on Get operations #837

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ederign
Copy link
Member

@ederign ederign commented Feb 26, 2025

Description

HTTP Get operations from BFF were not forwarding errors correctly.

In this PR:

  • clients/ui/bff/internal/integrations/http.go: generated proper error object when there is an error with get operation
  • clients/ui/bff/internal/integrations/http_test.go: test coverage for http.go

How Has This Been Tested?

1-) Run model registry with docker compose -f docker-compose.yaml up
2-) Run BFF with make run MOCK_K8S_CLIENT=true MOCK_MR_CLIENT=false
3-) After this PR, we should:

curl -i -H "kubeflow-userid: [email protected]" "localhost:4000/api/v1/model_registry/model-registry-bella/registered_models?namespace=bella-namespace"

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 26 Feb 2025 22:20:18 GMT
Transfer-Encoding: chunked 

If we manually stop mlmd-server from Model Registry (forcing them return a error):

HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Date: Wed, 26 Feb 2025 22:20:59 GMT
Content-Length: 119

{
	"error": {
		"code": "500",
		"message": "the server encountered a problem and could not process your request"
	}
}

I've also done a small sanity check on the UI

Merge criteria:

  • All the commits have been signed-off (To pass the DCO check)
  • The commits have meaningful messages; the author will squash them after approval or in case of manual merges will ask to merge with squash.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work.
  • Code changes follow the kubeflow contribution guidelines.

Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from ederign. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ederign
Copy link
Member Author

ederign commented Feb 26, 2025

@alexcreasy this will be a quick review in a area of your knowledge.

@christianvogt as you reproduced this, if you also want to look at it!

Copy link
Contributor

@adysenrothman adysenrothman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this locally on my end and everything looks great. Good catch on the gap between MR server failure and BFF resp. /lgtm
Screenshot 2025-02-27 at 3 04 11 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants