Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Auto-cloning a Gitlab repo fails with "unable to update url base from redirection"

未关闭
#144 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
git, typescript

调研方向

从模板中引用的 Backstage plugin 和 git_clone 模块开始;先查看 issue #117 和 PR 210。使用以 /-/blob/main/?ref_type=heads 结尾的 GitLab URL 重现,并将其与可正常工作的仓库根目录 URL 进行比较。当在 GitLab SAML SSO 下自动克隆成功,且 workspace 仍与 Backstage entity 一致时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

bug help wanted
Background

My organisation is exploring Coder with the Backstage plugin and Gitlab.com (Gitlab SaaS, i.e. not self-hosted).

In Backstage, before creating anything, the plugin shows:

No workspaces found for repo
https://gitlab.com/myorg/myrepo/-/blob/main/?ref_type=heads

We see #117 and the fact a change was made, and also that a merge was made to the git clone module in PR 210, but we are yet to be able to make it work.

Challenge

With a template that auto-clones, for example using the git_clone module:

data "coder_parameter" "repo_url" {
    name                = "repo_url"
    display_name  = "Git repository"
}

module "git_clone" {
  source     = "registry.coder.com/modules/git-clone/coder"
  version   = "1.0.18"
  agent_id = coder_agent.main.id
  url     = data.coder_parameter.repo_url.value
}

We see the clone fail after redirection:

Cloning https://gitlab.com/myorg/myrepo/-/blob/main/ to /home/coder/main...
Cloning into '/home/coder/main'...

fatal: unable to update url base from redirection:
  asked for: https://gitlab.com/myorg/myrepo/-/blob/main/info/refs?service=git-upload-pack
   redirect: https://gitlab.com/groups/myorg/-/saml/sso?redirect=%2Fmyorg%2Fmyrepo%2F-%2Fblob%2Fmain%2Finfo%2Frefs%3Fservice%3Dgit-upload-pack&token=<token>

We enforce single sign-on, which may explain the saml/sso redirection.

Alternatives

If we do not "auto-clone", and instead try and clone from the Workspace template directly (providing "Git repository" in the GUI), providing "https://gitlab.com/myorg/myrepo", then it works.

The downside is that the Backstage plugin won't "match" the Workspace as being related to the Backstage entity (presumably because we omitted the -/blob/main/?ref_type=heads suffix).

Has anyone been able to make this work with Gitlab yet please?

主要语言
TypeScript
星标
67
派生
9
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

coder/backstage-plugins 的其他 Issue

查看 coder/backstage-plugins 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。