2016-03-03 129 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

相關問題