Skip to content

Add error handling to import project members modal

Doug Stull requested to merge 405010-handle-errors-for-importing-project into master

What does this MR do and why?

Add error handling to import project members modal for individual member failure reporting

  • better error handling for user feedback

See discussion on design - https://gitlab.com/gitlab-org/gitlab/-/issues/405010#note_1464401487

Note screenshot wording a bit out of date due to !125761 (comment 1475430577)

Screenshots or screen recordings

scenario Before After
systemic failure Screenshot_2023-07-18_at_1.25.43_PM no change
partial member import failure Screenshot_2023-07-18_at_1.31.27_PM Screenshot_2023-07-18_at_1.27.11_PM

How to set up and validate locally

note: taken from spec/features/projects/members/import_project_members_spec.rb examples

Systemic failure

This one is hard to simulate as the UI kinda safeguards most of the failure paths from happening(projects/users existing) see simulation in the spec(that is how screenshots were taken)

Partial success/failure

  1. Create a project under a group that you will import members to - 'A'
  2. Create a project you will import members from - 'B'
  3. Add a user to the group for project A as an owner
  4. Add the same user to project B as a reporter
  5. On project A, navigate to the members page(example: http://gdk.test:3000/test-import-project-modal/new-project/-/project_members)
  6. Click Import from a project.
  7. Select project B and submit.
  8. Notice the errors.

Success

Follow the partial success/failure instructions and import a different project than 'B'

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #405010

Edited by Doug Stull

Merge request reports