Skip to content

Commit

Permalink
move deduplication to emitPipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
delanni committed Jan 6, 2025
1 parent 00f5afd commit 98a29f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .buildkite/pipeline-utils/buildkite/emitPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export function emitPipeline(pipelineStr: string) {
export function emitPipeline(pipelineSteps: string[]) {
const pipelineStr = [...new Set(pipelineSteps)].join('\n');
console.log(pipelineStr);
}
7 changes: 3 additions & 4 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
const skippable = await areChangesSkippable(SKIPPABLE_PR_MATCHERS, REQUIRED_PATHS);

if (skippable) {
emitPipeline(emptyStep);
emitPipeline([emptyStep]);
return;
}

Expand All @@ -58,7 +58,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
if (onlyRunQuickChecks) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/renovate.yml', false));
console.warn('Isolated changes to renovate.json. Skipping main PR pipeline.');
emitPipeline([...new Set(pipeline)].join('\n'));
emitPipeline(pipeline);
return;
}

Expand Down Expand Up @@ -411,8 +411,7 @@ const getPipeline = (filename: string, removeSteps = true) => {

pipeline.push(getPipeline('.buildkite/pipelines/pull_request/post_build.yml'));

// remove duplicated steps
emitPipeline([...new Set(pipeline)].join('\n'));
emitPipeline(pipeline);
} catch (ex) {
console.error('Error while generating the pipeline steps: ' + ex.message, ex);
process.exit(1);
Expand Down

0 comments on commit 98a29f6

Please sign in to comment.