2017-08-14 83 views

回答

1

我發現了一種可能的方式,儘管它受限於構建的數量。通過循環previousBuild層次和其更改日誌,這可能是一個解決方案:

def getAuthors(def build) { 
    def userIds = [] 

    build.changeSets.each { hudson.scm.SubversionChangeLogSet changeLogSet -> 
     userIds += changeLogSet.collect { it.author.id } 
    } 

    userIds.unique() 
} 

def getIndividualsWhoBrokeTheBuild() { 
    def userIds = [] 

    for(def build = currentBuild; build.result != 'SUCCESS'; build = build.previousBuild) { 
     userIds += getAuthors(build) 
    } 

    userIds.unique() 
} 

假設一個工作讓只有五個版本,這將不會返回原來的罪犯,如果它被打破五年多前建立。

+0

當然,如果你刪除數據,你不能再訪問它;-) – StephenKing

+0

是的,但郵件插件以某種方式跟蹤原始提交沒有這種限制,是嗎? – Jazzschmidt

相關問題