You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
It would be nice to immediately report back the build URL instead of waiting until the build is done. I am using a pipeline so I would guess I would have to add a step other than the existing PhabricatorNotifier at the point in the build where I want the URL reported.
Hey,
Not sure how helpful it is but I've been hitting my head against this today and came up with this scripted pipeline code (which needs the HTTPRequest plugin):
node() {
stage("Report build to Phabricator") {
// Report to Phabricator if this is a diff build
if (params.DIFF_ID && params.DIFF_REPO && params.PHID ) {
try{
withCredentials([string(credentialsId: 'phab_arc_token', variable: 'ARC_TOKEN')]) {
def request_body = "api.token=${ARC_TOKEN}&buildTargetPHID=${params.PHID}&artifactKey=jenkins.uri&artifactType=uri&artifactData[uri]=${BUILD_URL}&artifactData[name]=%5B${JOB_NAME}%20%28Jenins%29%5D&artifactData[ui.external]=1"
httpRequest consoleLogResponseBody: true,
customHeaders: [[maskValue: false, name: 'Content-Type', value: 'application/x-www-form-urlencoded']],
httpMode: 'POST', ignoreSslErrors: true, requestBody: request_body, responseHandle: 'NONE',
url: "${PHABRICATOR_URL}/api/harbormaster.createartifact",
validResponseContent: '"error_code":null'
}
} catch (err) {
// Set build result to failure and report to Phabricator
currentBuild.result = 'FAILURE'
step([$class: 'PhabricatorNotifier', commentFile: '.phabricator-comment', commentOnSuccess: true,
commentSize: '1000', commentWithConsoleLinkOnFailure: true, coverageCheck: false,
coverageReportPattern: '**/coverage*.xml, **/cobertura*.xml, **/jacoco*.xml',
coverageThreshold: 0.0, customComment: false, lintFile: '.phabricator-lint', lintFileSize: '100000',
minCoverageThreshold: 100.0, preserveFormatting: false, processLint: false, uberallsEnabled: false])
throw err
}
}
}
}
For me this reports the build back to buildbot before it starts running on the node to do the job (it is running the HTTPRequest step on the master).
If you need a declarative pipeline version I can try re-writing it for that (but I'm not as familiar with it :).
Hope it helps.
It would be nice to immediately report back the build URL instead of waiting until the build is done. I am using a pipeline so I would guess I would have to add a step other than the existing
PhabricatorNotifier
at the point in the build where I want the URL reported.This looks to be implemented for non-pipelines.
#133
ChaitanyaPramod@cd3a3cb
The text was updated successfully, but these errors were encountered: