1
0
Fork 0

Merge pull request #80 from google/diff-id

Resolve phabricator diff id and add link in description
This commit is contained in:
Mikhail Goncharov 2019-12-12 09:42:33 +01:00 committed by GitHub
commit 9f9ea61930
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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