Skip to content

Show error messages from failing code host

Administrator requested to merge mv/code-hosts-error into main

Created by: miveronese

CLOUD-165

Currently, if a user has two code host connections and one of them fails, the repos from the working code host are not displayed in the organization/<org>/settings/repositories/manage page -- the user just sees the message "failed to fetch from any code host"

This PR tries to solve this problem by extending the way we return errors from code hosts, so we can show them in the frontend. This way, in organization//settings/repositories/manage page, we can show both the errors returned from a failing code host + the repos from the working code host.

Test plan

Unit tests

Run go test ./cmd/frontend/graphqlbackend/ --run TestAffiliatedRepositories for the updated unit tests.

Manual tests

A) Go to the organization code host connections page and make sure you have two connections. B) Break one of the code host connections (by adding a wrong token, for example) C) Go to the org repos page > manage repos. You should see the error returned from the broken code host + the repos from the working code host D) Now, break both code host connections and go to the org repos page > manage repositories. You should see just the message "failed to fetch from any code host" and no repos.

https://user-images.githubusercontent.com/1552863/158718637-cbff8989-910f-4217-a591-9509eb562b4b.mp4 https://user-images.githubusercontent.com/1552863/158718642-77a75b26-d1df-44b2-9d5b-ae28fd12e7c6.mp4

Merge request reports

Loading