Skip to content

Show writable forks in Web IDE modal

What does this MR do and why?

  • Checks to see if a user has write access to any forks (not just a personal fork) when trying to launch the WebIDE from a project they do not have write access to.
  • Updates the "create new fork" action to give the user choices when forking (e.g. to fork to a group instead of personal namespace etc)
Before After
Screen_Recording_2023-06-06_at_09.23.24 Screen_Recording_2023-06-06_at_09.15.10

NOTE: This is an MVC, and we do want to:

  • update the behaviour on repository pages
  • modify the behaviour to automatically open the fork (when you have access to a single "non personal" fork)
  • modify the behaviour to not automatically open the personal fork when you have access to multiple forks

How to set up and validate locally

  1. Impersonate a non-admin user
  2. Navigate to a project the user has read-only access to (e.g. public project, or reporter role) for example http://gdk.test:3000/flightjs/Flight
  3. Click the Web IDE button (from the main project page, not from a specific repository path, this uses a different mechanic under the hood)
  4. The modal should show you don't have write access and offer you the option to create a new fork
  5. Click the "create new fork" button (ensure this doesn't automatically create a personal fork, but takes you to the new fork page)
  6. Create the new fork in a group (not in the user's personal namespace)
  7. Go back to the canonical project from step 2
  8. Click the Web IDE button
  9. The modal should now list the fork you created earlier, but still give you the option to create a new fork
  10. Create a new fork in another group
  11. Go back to the canonical project from step 2
  12. Click the Web IDE button
  13. The modal should now list both forks, and still give you the option to create a new fork
  14. Create a personal fork this time
  15. Go back to the canonical project from step 2
  16. The Web IDE button should now read Edit fork in Web IDE and clicking it should open your personal fork directly in the Web IDE

MR acceptance checklist

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

Edited by Lee Tickett

Merge request reports

Loading