GitLab issueshttps://gitlab.com/gitlab-org/gitlab/-/issues2021-10-28T13:50:47Zhttps://gitlab.com/gitlab-org/gitlab/-/issues/215362Routing improvements2021-10-28T13:50:47ZDmytro Zaporozhets (DZ)Routing improvementsTo get GitLab routing in a better share there are several initiatives I am working on:
### Scoped routing `/-/`
The reasoning explained in https://gitlab.com/gitlab-org/gitlab/-/issues/214217.
To achieve that we need to move global a...To get GitLab routing in a better share there are several initiatives I am working on:
### Scoped routing `/-/`
The reasoning explained in https://gitlab.com/gitlab-org/gitlab/-/issues/214217.
To achieve that we need to move global and project routes under `-` scope:
- [x] Move all existing group routes under `/-/` scope.
- [ ] Move all existing project routes under `/-/` scope https://gitlab.com/gitlab-org/gitlab/-/issues/29572
- [ ] Move all global routes under `/-/` scope https://gitlab.com/gitlab-org/gitlab/-/issues/210024
- [x] Ensure new routes are going under `/-/` scope https://gitlab.com/gitlab-org/gitlab/-/issues/29130
### Route regex
Reduce routing regex complexity and prevent introducing new reserved words
- [x] Ensure we don't add new entries to `TOP_LEVEL_ROUTES` and `PROJECT_WILDCARD_ROUTES`. https://gitlab.com/gitlab-org/gitlab/-/merge_requests/30162
- [ ] Reduce amount of items above to minimize regex complexity. https://gitlab.com/gitlab-org/gitlab/-/issues/28803
- [ ] Investigate regex use in project and group constraints
### Routing cleanup
- [ ] Order routes alphabetically https://gitlab.com/gitlab-org/gitlab/-/issues/210490
- [ ] Remove deprecated routes https://gitlab.com/gitlab-org/gitlab/-/issues/28848
- [x] Update `robots.txt` to keep up with routing changes => https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34773Backloghttps://gitlab.com/gitlab-org/gitlab/-/issues/214217Recent changes in GitLab routing2023-09-07T20:23:03ZDmytro Zaporozhets (DZ)Recent changes in GitLab routing**This is "For Your Information" issue. Treat it as a lightweight alternative to a blog post.**
- - -
Since we created the GitLab [subgroups](/solutions/subgroups/) feature,
we introduced more complexity to routing within the GitLab...**This is "For Your Information" issue. Treat it as a lightweight alternative to a blog post.**
- - -
Since we created the GitLab [subgroups](/solutions/subgroups/) feature,
we introduced more complexity to routing within the GitLab application.
Let's say you visit URL like `https://gitlab.com/gitlab-org/gitlab-foss`. In this
particular case, GitLab sees that you request `gitlab-foss` project page
within `gitlab-org` group. By identifying group and project name, routing can
run a corresponding piece of code and render a correct page to end user.
Things become more complex with subgroups. Let's use the same URL as before.
With subgroups feature, `gitlab-foss` can be project or a subgroup. We must
query the database to find out if `gitlab-foss` is a project or a subgroup so
we can show user a correct page.
It becomes even trickier when we include page name in it. For example this URL:
`https://gitlab.com/gitlab-org/creator-pairing/issues`. Is it `issues` project
within `creator-pairing` subgroup? Or simply issues page within `creator-pairing` project?
To make routing job easier we introduced a special separator almost 2 years ago.
If you visit cluster page for your project now, you will see that URL looks like this:
`https://gitlab.com/gitlab-org/gitlab-foss/-/issues`. Now, by having `/-/`, we
know exactly where group or project name ends and page name starts.
Here are few examples:
https://gitlab.com/gitlab-org/gitlab
| |
group project
https://gitlab.com/gitlab-org/gitlab/-/blob/master/Gemfile
| | |
group project page
https://gitlab.com/gitlab-org/creator-pairing/rails-app/issues
| | | |
group subgroup subgroup project
https://gitlab.com/gitlab-org/creator-pairing/rails-app/-/issues
| | | |
group subgroup project page
### Why we do it
There are several reasons to use the special separator:
1. Performance. The Separator helps to speed up things up, which processes the URL the better.
2. Stability. Separator allows for more predictable and reliable routing, which means less bugs.
3. Simplicity. It's much easier to build a new routing when you know its unlikely to conflict with an existing one.
### How it affects our users
For the last two years we are slowly moving all existing routes to use this `/-/` separator.
During every release, we converted more and more pages to use the new format.
By 12.9 we adopted the new routing system for most of the pages . We are trying to make
ease the inconvenience so we will have redirects and support for old URLs for a period of time.
Every major release we are going to do a cleanup and remove old deprecated routes.
Some URL's will stay longer than others. For example issue, merge request, and raw pages:
https://gitlab.com/gitlab-org/gitlab/raw/master/Gemfile
https://gitlab.com/gitlab-org/gitlab/issues/123
https://gitlab.com/gitlab-org/gitlab/merge_requests/123
Some will be gone soon. Like:
https://gitlab.com/gitlab-org/gitlab/branches
https://gitlab.com/gitlab-org/gitlab/deploy_keys
https://gitlab.com/gitlab-org/gitlab/settings
For most URLS, you are likely already using the new URL format. If you did not notice the change
then we did everything right. If you did, we are sorry for the inconvenience.
Feel free to share your experience with us.
P.S. Thanks [Sean](/company/team/#smcgivern) for suggesting this [blog post idea](https://gitlab.com/gitlab-org/gitlab/-/issues/118850#note_315523092).
### Further read
If you are interested in details and progress on this subject you can take a look
at following issues:
* [Overall issue with plan and progress](https://gitlab.com/gitlab-org/gitlab/-/issues/215362)
* [Move all existing project routes under /-/ scope](https://gitlab.com/gitlab-org/gitlab/-/issues/29572)
* [Remove legacy routes](https://gitlab.com/gitlab-org/gitlab/-/issues/28848)
* [Reduce top-level routes](https://gitlab.com/gitlab-org/gitlab/-/issues/28803)https://gitlab.com/gitlab-org/gitlab/-/issues/210490Order the routes alphabetically2020-06-11T00:12:15ZAsh McKenzieamckenzie@gitlab.comOrder the routes alphabeticallyThe following discussion from !26983 should be addressed:
- [ ] @ashmckenzie started a [discussion](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26983#note_304273056):
> Question for a follow-up Issue, should we attempt t...The following discussion from !26983 should be addressed:
- [ ] @ashmckenzie started a [discussion](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26983#note_304273056):
> Question for a follow-up Issue, should we attempt to order the routes alphabetically so as to make the file easier to parse?
cc @dzaporozhetsBackloghttps://gitlab.com/gitlab-org/gitlab/-/issues/210024Move all existing global routes under /-/ scope2021-10-28T13:50:52ZDmytro Zaporozhets (DZ)Move all existing global routes under /-/ scopeLike https://gitlab.com/gitlab-org/gitlab/-/issues/29572 but for global routes.
The problem was raised in https://gitlab.com/gitlab-org/gitlab-foss/-/issues/61985
Example.
We have `notification_settings` route that is a reserved work...Like https://gitlab.com/gitlab-org/gitlab/-/issues/29572 but for global routes.
The problem was raised in https://gitlab.com/gitlab-org/gitlab-foss/-/issues/61985
Example.
We have `notification_settings` route that is a reserved work in TOP_LEVEL_ROUTES. It can be easily put under `-` scope and remove reserve word. This will increase performance of every route as it reduce the size of regex that is build from TOP_LEVEL_ROUTES.
## TODO:
12.9
- [x] Move `notification_settings` => https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26983
12.10
- [x] Move `abuse_reports`, `invites`, `sent_notifications` => https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27106
- [x] Move `autocomplete` routes => https://gitlab.com/gitlab-org/gitlab/-/merge_requests/30173
13.2
- [x] Copy snippet routes under `/-/` scope. https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35020
13.3
- [x] Make snippet routes under `/-/` as default one. https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36091
13.5
- [x] Copy profile routes under `/-/` scope. https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45045
13.6
- [x] Make profile routes under `/-/` as default one. https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45307
14.0
- [x] Redirect `/snippets` to `/-/snippets`. Except `raw`. https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54461
Unplanned
- [ ] Move `clusterable`, `search`, `users` etc
## Removing deprecated routes
Should be handled in separate issue => https://gitlab.com/gitlab-org/gitlab/issues/28848Backloghttps://gitlab.com/gitlab-org/gitlab/-/issues/118850Keep some routes without `-` for non-redirect-following clients2023-03-01T11:24:28ZSean McGivernKeep some routes without `-` for non-redirect-following clientsFrom https://gitlab.com/gitlab-org/gitlab/issues/118840:
>>>
Some clients don't follow redirects and we should think carefully about breaking them (`/raw/`)
>>>
Also:
>>>
we have .diff and .patch routes that are meant for machine cons...From https://gitlab.com/gitlab-org/gitlab/issues/118840:
>>>
Some clients don't follow redirects and we should think carefully about breaking them (`/raw/`)
>>>
Also:
>>>
we have .diff and .patch routes that are meant for machine consumption. Don't know how much they are used.
We could considering doing a log analysis where we look at the user agent.
>>>
It seems like it would be worth making some kind of commitment to 'never' break raw URLs, and possibly some others too.Backloghttps://gitlab.com/gitlab-org/gitlab/-/issues/35260Consider Rspec tag for reloading routes2023-10-16T20:50:44ZJames Edwards-JonesConsider Rspec tag for reloading routesThe following discussion from !18749 should be addressed:
- [ ] @ifarkas started a [discussion](https://gitlab.com/gitlab-org/gitlab/merge_requests/18749#note_237799828): (+1 comment)
> I wonder if it would make more sense to crea...The following discussion from !18749 should be addressed:
- [ ] @ifarkas started a [discussion](https://gitlab.com/gitlab-org/gitlab/merge_requests/18749#note_237799828): (+1 comment)
> I wonder if it would make more sense to create an rspec tag for reloading routes. :thinking: WDYT?https://gitlab.com/gitlab-org/gitlab/-/issues/29572Move all existing project routes under /-/ scope2023-05-23T14:38:45ZDmytro Zaporozhets (DZ)Move all existing project routes under /-/ scopeFrom https://gitlab.com/gitlab-org/gitlab-ce/issues/61985#note_172148991
> Because both project and group have wildcard in their path.
> Every time a Rails controller has to match an endpoint, it has to do this giant regex comparison. ...From https://gitlab.com/gitlab-org/gitlab-ce/issues/61985#note_172148991
> Because both project and group have wildcard in their path.
> Every time a Rails controller has to match an endpoint, it has to do this giant regex comparison. I've seen this show up in our performance traces, somewhere.
- - -
**For more information see https://gitlab.com/gitlab-org/gitlab/-/issues/214217**
## Project routes based on sidebar nav
- [ ] Project activity
- [x] Repository - https://gitlab.com/gitlab-org/gitlab/issues/118849
- [x] Issues - https://gitlab.com/gitlab-org/gitlab/issues/118849
- [x] Merge Requests - https://gitlab.com/gitlab-org/gitlab/issues/118849
- [x] CI/CD - https://gitlab.com/gitlab-org/gitlab/issues/118849
- [x] Security & Compliance - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24287
- [x] Operations - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20456
- [ ] Packages
- [x] Wiki - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21185
- [ ] Analytics
- [x] Snippets - https://gitlab.com/gitlab-org/gitlab/-/issues/223719
- [x] Project members - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26967
- [x] Settings - https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/28435
- [x] Webhooks - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57734
- [ ] Pages
## Removing deprecated routes
Should be handled in separate issue => https://gitlab.com/gitlab-org/gitlab/issues/28848Backloghttps://gitlab.com/gitlab-org/gitlab/-/issues/22107Alternative, short route for merge requests2020-12-07T16:39:04ZGhost UserAlternative, short route for merge requests### Description
Compared to routes like `/issues` or `/snippets`, `/merge_requests` is an outlier in terms of length and ease of typing.
### Proposal
Introduce alias at `/mr` which, importantly, isn't a mere redirect. This reduces the...### Description
Compared to routes like `/issues` or `/snippets`, `/merge_requests` is an outlier in terms of length and ease of typing.
### Proposal
Introduce alias at `/mr` which, importantly, isn't a mere redirect. This reduces the length and, by avoiding `_requests`, reduces likelihood of typos, too. Suggestions for alternatives that are not longer than, say, `/merges` welcome.
##### Before
https://server/org/proj/merge_requests
https://server/org/proj/merge_requests/123
##### After
https://server/org/proj/mr
https://server/org/proj/mr/123
### Why
Not everything involving a GitLab instance happens inside the web app, so it's important to have ergonomic and easy to remember/type urls, too.