Skip to content

Commit

Permalink
Fix the monorepo diff command for PR triggers (#38870)
Browse files Browse the repository at this point in the history
This commit fixes the buildkite plugin monorepo-diff so that it correctly detects the changed files and properly propagates the env vars to the triggering pipelines.

Fixes: elastic/ingest-dev#3159

Signed-off-by: Alexandros Sapranidis <[email protected]>
  • Loading branch information
alexsapran authored Apr 12, 2024
1 parent 8fc385b commit e06b8ef
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ steps:
- label: "Trigger Auditbeat"
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only HEAD~1"
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
watch:
- path:
- auditbeat/
Expand All @@ -22,12 +22,13 @@ steps:
branch: "${BUILDKITE_BRANCH}"
env:
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}

- label: "Trigger Heartbeat"
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only HEAD~1"
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
watch:
- path:
- heartbeat/
Expand All @@ -45,12 +46,13 @@ steps:
branch: "${BUILDKITE_BRANCH}"
env:
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}

- label: "Trigger Xpack/Dockerlogbeat"
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only ${GITHUB_PR_TARGET_BRANCH}...HEAD"
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
watch:
- path:
- x-pack/dockerlogbeat/
Expand All @@ -68,12 +70,13 @@ steps:
branch: "${BUILDKITE_BRANCH}"
env:
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}

- label: "Trigger Metricbeat"
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only ${GITHUB_PR_TARGET_BRANCH}...HEAD"
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
watch:
- path:
- metricbeat/
Expand All @@ -92,12 +95,13 @@ steps:
branch: "${BUILDKITE_BRANCH}"
env:
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}

- label: "Trigger Deploy/K8S"
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only HEAD~1"
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
watch:
- path:
- .buildkite/deploy/kubernetes/**
Expand All @@ -110,4 +114,5 @@ steps:
branch: "${BUILDKITE_BRANCH}"
env:
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}

0 comments on commit e06b8ef

Please sign in to comment.