通过项目 ID 获取 GitLab 存储库 URL
Get GitLab repository URL via project ID
想法是项目 ID 不会改变,而当项目从命名空间移动到 group/subgroup 或重命名任何部分时,项目路径可以改变。
但是 ID 是永久性的 (afaik)。
我找到了一些通过 API 获取项目路径的方法,但我想知道是否有 一种方法可以提供 URL 使用 ID 而不是例如,当在 publication 中引用项目时,将潜在用户发送到存储库首页的路径。
我可以想象一个小 webtool (http://www.gitlabidtourl.com/instance-url/id) 在通过 API 获取路径后 forwards/converts 到 URL。这可能只适用于 public 个存储库,使用外部“翻译”服务似乎也不切实际。
尚不支持,requested/followed与issue 339025
As the project URLs are currently inextricably tied to the group structure, the URL of the project changes when groups or projects are moved.
This causes problems in all cases where project URLs may be embedded in any source code.
Proposal
A super useful feature would be the ability to have a single static URL for each project, ideally just mapped to the project id (which is unique across the instance).
This static URL must always point directly to the current location of the project, without any redirects in the middle. This static URL should, then, be the only URL that is referenced in any source code, as it will never change even when projects are moved.
想法是项目 ID 不会改变,而当项目从命名空间移动到 group/subgroup 或重命名任何部分时,项目路径可以改变。
但是 ID 是永久性的 (afaik)。
我找到了一些通过 API 获取项目路径的方法,但我想知道是否有 一种方法可以提供 URL 使用 ID 而不是例如,当在 publication 中引用项目时,将潜在用户发送到存储库首页的路径。
我可以想象一个小 webtool (http://www.gitlabidtourl.com/instance-url/id) 在通过 API 获取路径后 forwards/converts 到 URL。这可能只适用于 public 个存储库,使用外部“翻译”服务似乎也不切实际。
尚不支持,requested/followed与issue 339025
As the project URLs are currently inextricably tied to the group structure, the URL of the project changes when groups or projects are moved.
This causes problems in all cases where project URLs may be embedded in any source code.
Proposal
A super useful feature would be the ability to have a single static URL for each project, ideally just mapped to the project id (which is unique across the instance).
This static URL must always point directly to the current location of the project, without any redirects in the middle. This static URL should, then, be the only URL that is referenced in any source code, as it will never change even when projects are moved.