Skip to content

Commit 56e201e

Browse files
committed
jobName,pipelineId are in updateCommitStatus params
1 parent 63f48e8 commit 56e201e

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

index.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -572,18 +572,15 @@ class BitbucketScm extends Scm {
572572
* @param {String} config.buildStatus The screwdriver build status to translate into scm commit status
573573
* @param {String} config.token The token used to authenticate to the SCM
574574
* @param {String} config.url Target Url of this commit status
575-
* @param {String} [config.jobName] Optional name of the job that finished
576-
* @param {Number} [config.pipelineId] Pipeline ID
575+
* @param {String} config.jobName Optional name of the job that finished
576+
* @param {Number} config.pipelineId Pipeline ID
577577
* @return {Promise}
578578
*/
579579
_updateCommitStatus(config) {
580-
let context = `Screwdriver/${config.pipelineId}`;
581580
const scm = getScmUriParts(config.scmUri);
582-
const jobName = config.jobName && /^PR/.test(config.jobName) ? 'PR' : config.jobName;
581+
let context = `Screwdriver/${config.pipelineId}/`;
583582

584-
if (jobName) {
585-
context += `/${jobName}`;
586-
}
583+
context += /^PR/.test(config.jobName) ? 'PR' : config.jobName;
587584

588585
const options = {
589586
url: `${REPO_URL}/${scm.repoId}/commit/${config.sha}/statuses/build`,

test/index.test.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,18 +1073,6 @@ describe('index', function () {
10731073
})
10741074
);
10751075

1076-
it('successfully update status with correct values', () => {
1077-
config.buildStatus = 'ABORTED';
1078-
delete config.jobName;
1079-
1080-
expectedOptions.body.state = 'STOPPED';
1081-
expectedOptions.body.description = 'Screwdriver/123';
1082-
1083-
return scm.updateCommitStatus(config).then(() => {
1084-
assert.calledWith(requestMock, expectedOptions);
1085-
});
1086-
});
1087-
10881076
it('rejects if status code is not 201 or 200', () => {
10891077
fakeResponse = {
10901078
statusCode: 401,

0 commit comments

Comments
 (0)