Fetch failures for import details page from API endpoint
What does this MR do and why?
This feature is currently behind a feature flag.
Now that the API private endpoint /import/github/failures
is ready, we can fetch real data from the backend using axios. This MR adds this functionality along with some minor adjustments to the code to match the backend params.
Screenshots or screen recordings
How to set up and validate locally
- Go to
http://127.0.0.1:3000/import/github/details?project_id=29
(use any project id that was imported). The page should render 404 Not Found. - Enable the feature flag and refresh the page:
Feature.enable :import_details_page
- Fake some failures in
rails console
:
p = Project.find(29)
f = p.import_failures.new
f.external_identifiers = {
object_type: 'pull_request',
title: 'A new pull request',
iid: 18741
}
f.exception_message = 'Something went wrong!'
f.save
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #386748 (closed)
Edited by Justin Ho Tuan Duong