GitLab rooms should treat shortlinks as relative to GitLab repo
Problem to solve
When I create a Gitter room for a GitLab project, when I reference an issue like #44
it should link to issue 44 for the project which the room relates to. Currently it is a dead link.
Currently, you can post a full link which does transform into an issue decoration:
https://gitlab.com/gitlab-org/gitter/webapp/issues/1445
->
Further details
Related to https://gitlab.com/gitlab-org/gitter/webapp/issues/757
For example, procps uses Gitter and GitLab. Even though there is integration, all the links are pointing to GitHub not GitLab, so they are broken. This problem occurs for on the right side panel as well as the chat message markup.
Proposal
For rooms created through the new created Gitter rooms based on GitLab projects, these links should work correctly.
For existing rooms that need to be linked to GitLab, follow https://gitlab.com/gitlab-org/gitter/webapp/issues/757
Relevant code
- Permission constants,
GH_ORG
,GH_ORG_MEMBER
,GH_REPO
,GH_REPO_PUSH
so we need to create newGL_GROUP
,GL_GROUP_MEMBER
,GL_PROJECT
,GH_PROJECT_PUSH
- https://gitlab.com/gitlab-org/gitter/webapp/blob/b1df6460ea8dc084ed43b50a74e07af86c265aea/modules/permissions/test/permission-combinations.js
- https://gitlab.com/gitlab-org/gitter/webapp/blob/b1df6460ea8dc084ed43b50a74e07af86c265aea/modules/permissions/lib/security-descriptor-generator.js
- https://gitlab.com/gitlab-org/gitter/webapp/blob/b1df6460ea8dc084ed43b50a74e07af86c265aea/modules/permissions/lib/security-descriptor-validator.js
- https://gitlab.com/gitlab-org/gitter/webapp/blob/b1df6460ea8dc084ed43b50a74e07af86c265aea/modules/gitlab-backend/lib/index.js#L14