Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: screwdriver-cd/screwdriver
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.0.20
Choose a base ref
...
head repository: screwdriver-cd/screwdriver
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.1.0
Choose a head ref
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on Oct 13, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0933d72 View commit details
Showing with 309 additions and 82 deletions.
  1. +4 −5 plugins/pipelines/create.js
  2. +9 −11 plugins/pipelines/update.js
  3. +188 −59 plugins/webhooks/index.js
  4. +1 −1 test/plugins/pipelines.test.js
  5. +107 −6 test/plugins/webhooks.test.js
9 changes: 4 additions & 5 deletions plugins/pipelines/create.js
Original file line number Diff line number Diff line change
@@ -113,18 +113,17 @@ module.exports = () => ({
});
}

const results = await Promise.all([
pipeline.sync(),
pipeline.addWebhooks(`${request.server.info.uri}/v4/webhooks`)
]);
const results = await pipeline.sync();

await pipeline.addWebhooks(`${request.server.info.uri}/v4/webhooks`);

const location = urlLib.format({
host: request.headers.host,
port: request.headers.port,
protocol: request.server.info.protocol,
pathname: `${request.path}/${pipeline.id}`
});
const data = await results[0].toJson();
const data = await results.toJson();

return h
.response(data)
20 changes: 9 additions & 11 deletions plugins/pipelines/update.js
Original file line number Diff line number Diff line change
@@ -135,17 +135,15 @@ module.exports = () => ({
oldPipeline.name = scmRepo.name;

// update pipeline with new scmRepo and branch
return oldPipeline
.update()
.then(updatedPipeline =>
Promise.all([
updatedPipeline.sync(),
updatedPipeline.addWebhooks(
`${request.server.info.uri}/v4/webhooks`
)
])
)
.then(results => h.response(results[0].toJson()).code(200));
return oldPipeline.update().then(async updatedPipeline => {
await updatedPipeline.addWebhooks(
`${request.server.info.uri}/v4/webhooks`
);

const result = await updatedPipeline.sync();

return h.response(result.toJson()).code(200);
});
})
)
);
Loading