Use relative _path helper URLs in the GitLab UI
What does this MR do?
EE MR, https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3676
Use _path
helpers instead of _url
for things that are used within the GitLab UI.
The list of fixed things here is extensive but not absolutely exhaustive. I searched through *.haml|*.rb
for _url
and manually found spots.
- Job link,
<namespace>/<project>/-/jobs
-
<link rel="alternate" type="application/atom+xml"
in the<head>
-
/projects/new
, switch to "Import project" tab and look atgitea
button - Outdated browser flash/banner/alert, replace the
if
condition withtrue
to see it - Endpoint used in boards which flows to the FE,
assign_endpoint_vars
-><namespace>/<project>/boards
- Endpoints used on Job page,
javascript_build_options
-><namespace>/<project>/-/jobs
- Endpoints used in the top nav search to construct URLs to redirect to on the FE,
app/views/layouts/_search.html.haml
- Avatar URL used in Issue comment form
<namespace>/<project>/issues/<iid>
Other potential spots to fix
- System notes like
new_issue_branch
but these also may be returned in the API which probably should be absolute URLs- Would need to check if the message is stored or generated to pass a
only_path: true
type option in -
▶ Moved to a separate issue, https://gitlab.com/gitlab-org/gitlab-ce/issues/40860
- Would need to check if the message is stored or generated to pass a
- Other
<link>
tags in the<head>
-
▶ Moved to a separate issue, https://gitlab.com/gitlab-org/gitlab-ce/issues/40861
-
-
avatar_url
fromdiscussions.json
-
▶ Moved to a separate issue, https://gitlab.com/gitlab-org/gitlab-ce/issues/40862
-
Potential tech debt discovered while browsing
Should I create a follow-up issue for these? Update: issue created, https://gitlab.com/gitlab-org/gitlab-ce/issues/40859
-
service_trigger_url
andbuilds_trigger_url
seems like they could use helpers -
flowdock_service
URL construction seems like it could use helpers -
hipchat_service
URL construction seems like it could use helpers
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary- Not a user-facing change unless this fixes some bugs like https://gitlab.com/gitlab-org/gitlab-ce/issues/40555 or https://gitlab.com/gitlab-org/gitlab-ce/issues/39364
-
Tests added for this feature/bug- We could maybe look for the hostname in the markup in a
afterEach
hook but seems pretty intrusive.
- We could maybe look for the hostname in the markup in a
- Review
-
Has been reviewed by Frontend -
Has been reviewed by Backend
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered
What are the relevant issue numbers?
Closes #40825 (closed)
Edited by Eric Eastwood