2016-03-03 74 views
3

我们的工具Deveo是一个代码托管和协作平台,支持Git,Subversion和Mercurial。我们有一个客户案例,他们利用VersionOne。在VersionOne中有一个commitstream功能,允许他们将Git存储库中的提交链接到VersionOne中的任务。任何git存储库和版本库commitstream之间的集成

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

回答

1

如果给定的VCS或前端(如GitHub,GitLab,Bitbucket,VSO)支持Webhook,那么为CommitStream添加对它的支持的过程是相当标准的。 CommitStream写入与节点和GetEventStore而且是开源的,我们接受拉请求:d

在Deveo的情况下,我看到有关网络挂接的一些文件在你的系统中:http://support.deveo.com/knowledgebase/articles/494691-using-deveo-webhooks

这包括样品有效载荷。如果通过任意的Git仓库,你的意思是与Deveo相关联的Git仓库,因此会导致那些Deveo Webhooks被触发,然后我认为这是可行的乍一看。

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

这里是gitLabTranslator.js,例如:

https://github.com/openAgile/CommitStream.Web/blob/develop/src/app/api/translators/es6/gitLabTranslator.js

而且,一些测试用例为:

https://github.com/openAgile/CommitStream.Web/blob/develop/src/app/test/api/translators/gitLabTranslator.tests.js

GitHub的,GitLab和到位桶翻译是相当类似于彼此。

在Visual Studio在线为Git的翻译是有一点不同:https://github.com/openAgile/CommitStream.Web/blob/develop/src/app/api/translators/es6/vsoGitTranslator.js

然而,每个模块都有相同的基本的“接口”。我不知道,如果Deveo网络挂接消息的格式从一个VCS到另一个不同,但如果我认为不是这样,那么它看起来像:

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' }   
    } 
} 

如果你想聊天更对此,我很乐意。另外,您可以跳入我们的CommitStream的Gitter.im频道https://gitter.im/openAgile/CommitStream.Web

相关问题