Fetch bulk_import failures from backend and properly format table
requested to merge 386138-inform-user-which-resources-were-not-migrated-fetch-api-from-data into master
What does this MR do and why?
This change is behind the feature flag bulk_import_details_page
from issue #429109 (closed).
Previous MR !135004 (merged) added the feature flag and app boilerplate code.
- Refactor
import_details_table
to work with both import / bulk_import by passingfields
as a prop. - Update fetch to use bulk_import API for failures when on bulk_import details page.
Screenshots or screen recordings
How to set up and validate locally
1. Start an import
- In the header bar, click on + icon (Create new...) > New group.
- Select Import group.
- Fill in the GDK URL as GitLab source instance URL and a Person Access Token. Then click Connect instance.
- You should be on the Import groups from GitLab page.
- Start a few imports with any group and let them run.
- Find at least 1 import that has import failures (has the "Details" button next to it on the History page). You can also create a dummy failure running this in rails console:
entity = BulkImports::Entity.last
entity.failures.create!(pipeline_class: "test", exception_class: "test", exception_message: "test", source_url: "...", source_title: "...")
2. Go to the bulk_import details page
Go to http://127.0.0.1:3000/import/bulk_imports/details?id=144&entity_id=68
replacing the id
and entity_id
with bulk_import_id
and id
from the /api/v4/bulk_imports/entities
endpoint:
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 #386138 (closed)
Edited by Justin Ho Tuan Duong