任何git存储库与versionone commitstream之间的集成

任何git存储库与versionone commitstream之间的集成,git,githooks,versionone,Git,Githooks,Versionone,我们的工具是一个代码托管和协作平台,支持Git、Subversion和Mercurial。我们有一个客户案例,他们可以利用。在VersionOne中有一个功能,允许他们将Git存储库中的提交链接到VersionOne中的任务 目前VersionOne commitstream仅支持GitHub、Gitlab和Bitbucket。有没有办法将任意Git存储库集成到VersionOne Commitstream?我最初的想法是设置一个代理,将来自VersionOne commitstream中链接的

我们的工具是一个代码托管和协作平台,支持Git、Subversion和Mercurial。我们有一个客户案例,他们可以利用。在VersionOne中有一个功能,允许他们将Git存储库中的提交链接到VersionOne中的任务


目前VersionOne commitstream仅支持GitHub、Gitlab和Bitbucket。有没有办法将任意Git存储库集成到VersionOne Commitstream?我最初的想法是设置一个代理,将来自VersionOne commitstream中链接的请求转发给Deveo对应方。

如果给定的VCS或前端(如GitHub、GitLab、Bitbucket、VSO)支持Webhook,那么将其支持添加到commitstream的过程是相当标准的。CommitStream是用Node和GetEventStore编写的,是开源的,我们正在接受拉取请求:D

在Deveo的例子中,我看到一些关于系统中webhook的文档,网址是:

这包括一个示例有效负载。如果说任意Git存储库,您指的是与Deveo关联的Git存储库,因此会触发那些Deveo Webhook,那么我认为乍一看这是可行的

对于每个VCS,我们都有一个简单的转换器函数,它接受入站负载,并在将这些公共属性和原始消息保存到EventStore之前选择一些公共属性

下面是gitLabTranslator.js,例如:

还有一些测试用例:

GitHub、GitLab和Bitbucket转换器彼此非常相似

Visual Studio Online for Git translator有点不同:

但是,每个模块都有相同的基本“接口”。我不知道Deveo Webhook消息的格式是否在不同的风投之间有所不同,但如果我假设它没有,那么它看起来会像:

const deveoTranslator = {
  family: 'Deveo', // Provides a unique VCS "family" name for this translator.
  canTranslate(request) {
   // Returns true/false by inspecting the inbound request's headers / body properties.
  },
  translatePush(pushEvent, instanceId, digestId, inboxId) {
   // Returns an array of translated commit messages that conform to the "standard" set of common properties.
  },
  getProperties(event) {
    // Returns an object in the form of { repo : 'text name of the repositoryt', repoHref: 'http://link.to/theRepo', branchHref: 'http://link.to/theRepo/branchName' }        
  }
}
如果你想多聊一聊,我很乐意。此外,您还可以跳到我们的Gitter.im频道,在