1
0
Fork 0

Resolve phabricator diff id and add link in description

This commit is contained in:
Mikhail Goncharov 2019-12-12 09:40:31 +01:00
parent cff541258d
commit 4762ba5c3f

View file

@ -33,7 +33,16 @@ pipeline {
steps { steps {
echo "Building diff ${DIFF_ID} with PHID ${PHID}" echo "Building diff ${DIFF_ID} with PHID ${PHID}"
script { script {
currentBuild.displayName = "diff ${DIFF_ID}" def revision_phid = sh(script:
'echo \'{"constraints":{"ids":[' + DIFF_ID + ']}}\' | '+
'arc call-conduit --conduit-uri=$PHABRICATOR_HOST --conduit-token $CONDUIT_TOKEN differential.diff.search | ' +
'jq -r ".response.data[0].fields.revisionPHID"', returnStdout: true).trim()
def drev_id = sh(script:
'echo \'{"constraints":{"phids":["' + revision_phid + '"]}}\' | ' +
'arc call-conduit --conduit-uri=$PHABRICATOR_HOST --conduit-token $CONDUIT_TOKEN differential.revision.search | ' +
'jq -r ".response.data[0].id"', returnStdout: true).trim()
currentBuild.displayName += " D${drev_id}"
currentBuild.description = "<a href='https://reviews.llvm.org/D${drev_id}'>D${drev_id}</a>"
} }
} }
} }