调用GitLabs后接收挂钩的SubGit不起作用

时间:2017-08-19 18:48:36

标签: git gitlab subgit

我们尝试使用SubGit作为镜像从svn到git(GitLab)的软迁移。一切正常,除了提交到svn repo没有正确触发GitLabs post-recive钩子(我想)。

git repo中的提交就在那里,但之后不会更新活动流,CI管道也不会被触发等等。

我可以看到从SubGit调用post-receive挂钩:

[daemon][20] Executing [/var/opt/gitlab/git-
data/repositories/repo.git/hooks/post-receive]; environmentVariables=
{SVN_LAST_FETCHED_REVISION=33957, GIT_DIR=., GL_ID=user-
1};workingDirectory=/var/opt/gitlab/git-data/repositories/repo.git

(我用repo替换了真实的组/项目名称)

Sidekiq日志告诉我GL Repository

存在问题
WARN: ArgumentError: Invalid GL Repository "/var/opt/gitlab/git-
data/repositories/repo.git"

抛出gitlab-rails / lib / gitlab / gl_repository.rb:10:

def self.parse(gl_repository)
  match_data = /\A(project|wiki)-([1-9][0-9]*)\z/.match(gl_repository)
  unless match_data
    raise ArgumentError, "Invalid GL Repository \"#{gl_repository}\""
  end

浏览代码时,钩子本身似乎使用了一个未由SubGit设置的GL_REPOSITORY环境变量。

我尝试手动调用钩子并将GL_REPOSITORY设置为满足以上正则表达式的内容(“project-13”,13是此repo的项目ID),但是这会导致a { {1}}例外。(我的错,如果我使用了正确的钩子数据,那会有效)

那么,Ambiguous lookup - OID prefix is too short环境变量是什么,我该如何让SubGit设置呢?

我正在使用:

  • GitLab 9.4.5
  • SubGit 3.2.5

更新

我发现GL_REPOSITORY只是一个字符串GL_REPOSITORY。 现在我在每个存储库中放置了一个带有正确字符串的文本文件,并调整了project-<GitLabDBProjectId>挂钩本身以读出该文件并将其用作内容而不是post-receive变量。

GitLab中有一些与项目标识符有关的重复工作,似乎SubGit没有赶上这些变化(Bug报告存在)。

0 个答案:

没有答案
相关问题