Skip to content

Commit 2ab967c

Browse files
committed
Introduce env variable on pipeline definition level
1 parent 7a47b53 commit 2ab967c

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

.buildkite/pipeline-utils/pr_labels.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ export const LABEL_MAPPING: Record<string, Record<string, string>> = {
1414
'ci:use-chrome-beta': {
1515
USE_CHROME_BETA: 'true', // Use if you want to run tests with Chrome Beta
1616
},
17-
'ci:beta-faster-pr-build': {
18-
KIBANA_CI_PIPELINE_TYPE: 'faster_pr_build', // Tracks the optimized PR build pipeline
19-
},
2017
};
2118

2219
/**

.buildkite/scripts/pipelines/pull_request/pipeline.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
set -euo pipefail
44

5+
# Set environment variables based on PR labels for OTEL tracking
56
if [[ "${GITHUB_PR_LABELS:-}" == *"ci:beta-faster-pr-build"* ]]; then
7+
export KIBANA_CI_PIPELINE_TYPE="faster_pr_build"
8+
69
# Quietly upload the cache-warmup step before everything else,
710
# in order to run it sooner than others, and have a warm cache by the time other steps run.
811
(buildkite-agent pipeline upload .buildkite/pipelines/pull_request/store_moon_cache.yml > /dev/null \

.buildkite/scripts/pipelines/pull_request/pipeline.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@
1616
] */
1717

1818
import fs from 'fs';
19-
import { dump } from 'js-yaml';
2019
import prConfigs from '../../../pull_requests.json';
2120
import { runPreBuild } from './pre_build';
2221
import {
2322
areChangesSkippable,
2423
doAnyChangesMatch,
2524
getAgentImageConfig,
2625
emitPipeline,
27-
collectEnvFromLabels,
2826
} from '#pipeline-utils';
2927

3028
const prConfig = prConfigs.jobs.find((job) => job.pipelineSlug === 'kibana-pull-request');
@@ -67,11 +65,6 @@ const getPipeline = (filename: string, removeSteps = true) => {
6765

6866
if (GITHUB_PR_LABELS.includes('ci:beta-faster-pr-build')) {
6967
await runPreBuild();
70-
// KIBANA_CI_PIPELINE_TYPE is auto-set from the label via LABEL_MAPPING
71-
const envFromLabels = collectEnvFromLabels(GITHUB_PR_LABELS);
72-
if (Object.keys(envFromLabels).length > 0) {
73-
pipeline.push(dump({ env: envFromLabels }));
74-
}
7568
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/base_merged_phases.yml', false));
7669
} else {
7770
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/base.yml', false));

0 commit comments

Comments
 (0)