Add Gitpod button to MR page
What does this MR do?
Closes #338741 (closed)
EDIT:
This MR does two things:
- (minor) It changes the "Open in Web IDE" button to also include "Open in Gitpod", if enabled. This is done simply by replacing the custom button with our standard
web_ide_link
component. - (major) It changes when we show an enabled "Open in Web IDE" button. Previously, this was only visible and enabled if the user could edit the MR branch. Now, we always show this button. Since the "Open in Web IDE" button was originally added, the Web IDE has been enhanced to gracefully handle a number of different permission states (see relevant issue), such that we shouldn't worry about preventing the user from visiting this page.
Why shouldn't we worry about hiding this button?
- The Web IDE will direct the user to a fork, if possible, otherwise it'll display a persistent warning to the user that they are not allowed to make edits. This warning was not available before the button disability was put in place.
- Editing / committing is not the only action a user may wish to take with "Open in Web IDE" or "Open in Gitpod". For instance, they may just want to run some tests in Gitpod. The user may just want to create a patch through the Web IDE (coming soon).
ORIGINAL:
This MR adds the Gitpod button introduced in !37985 (merged) to the MR pages (we decided to move this to a separate MR). It uses the same vue
component as in the tree header view. That has the following effects:
- It harmonizes the code base of the Web IDE button on the tree header view and the MR page. The behavior is now more similar.
- However, this also slightly changes the behavior of the Web IDE button on the MR page.
See also the discussions on !37985 (merged), especially !37985 (comment 402770390)
Screenshots
EDIT (2021-08-10):
To enable the Gitpod button to show in the dropdown, go to Admin > Settings > Gitpod.
What should I be looking for?
- It's expected that users need to "Enable Gitpod" for their user preferences.
- If the "Open in Gitpod" button navigates to
<gitpod_url>#<merge_request_url>
it's working.
Description | Before (on master ) |
After (this MR) | After (this MR + Gitpod disabled) | Demo |
---|---|---|---|---|
Anonymous user (not logged in) | 20210810_gitpod_anon_demo | |||
Guest user | 20210810_gitpod_guest_demo | |||
Project member | 20210810_gitpod_user_demo |
What about archived projects?
Showing the button makes sense for archived projects because there are user flows besides editing the target project that can still be accomplished:
- Forking the project
- Running tests in Gitpod
Button still shows up | Owner of archived project is invited to fork |
---|---|
ORIGINAL:
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Eric Schurter