Skip to content

Commit fdc46f3

Browse files
mergify[bot]pazone
andauthored
[8.14](backport #4906) [CI] Monorepo diff plugin for integration tests (#4922)
* [CI] Monorepo diff plugin for integration tests (#4906) * [CI] Monorepo diff plugin for integration tests * [CI] Monorepo diff plugin for integration tests * [CI] Monorepo diff plugin for integration tests * [CI] Monorepo diff plugin for integration tests * Debug * Debug * Debug * Debug * Debug * Debug * Debug * Debug * Debug * Debug * Cleanup * Cleanup * added missing watch paths (cherry picked from commit fd8d1ee) # Conflicts: # .buildkite/pull-requests.json * Fixed conflicts * Fixed conflicts --------- Co-authored-by: Pavel Zorin <pavel.zorin@elastic.co>
1 parent d183968 commit fdc46f3

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

.buildkite/pipeline.yml

+48
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,51 @@ steps:
232232
image: "family/core-ubuntu-2204"
233233
env:
234234
- GH_VERSION=2.4.0
235+
236+
# Trigger for pull requests
237+
- label: "Trigger Integration tests for Pull request"
238+
if: |
239+
(build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) ||
240+
build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /.*extended.*/
241+
242+
plugins:
243+
- monorepo-diff#v1.0.1:
244+
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
245+
watch:
246+
- path:
247+
- internal/
248+
- dev-tools/
249+
- pkg/
250+
- testing/
251+
- version/
252+
- specs/
253+
- .agent-versions.json
254+
- .go-version
255+
- .package-version
256+
- go.mod
257+
- go.sum
258+
- magefile.go
259+
- main.go
260+
261+
- .buildkite/integration.pipeline.yml
262+
- .buildkite/pipeline.yml
263+
- .buildkite/scripts/
264+
- .buildkite/hooks/
265+
266+
config:
267+
trigger: "elastic-agent-extended-testing"
268+
build:
269+
commit: "${BUILDKITE_COMMIT}"
270+
branch: "${BUILDKITE_BRANCH}"
271+
env:
272+
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
273+
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
274+
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}
275+
276+
# Trigger for branches
277+
- label: "Triggering Integration tests for branches"
278+
if: build.pull_request.id == null
279+
trigger: "elastic-agent-extended-testing"
280+
build:
281+
commit: "${BUILDKITE_COMMIT}"
282+
branch: "${BUILDKITE_BRANCH}"

.buildkite/pull-requests.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"set_commit_status": true,
1010
"build_on_commit": true,
1111
"build_on_comment": true,
12-
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$",
13-
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$",
14-
"skip_ci_labels": [ ],
12+
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test\\W*(?:extended|)",
13+
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test\\W*(?:extended|)",
14+
"skip_ci_labels": [ "skip-ci" ],
1515
"skip_target_branches": [ ],
16-
"skip_ci_on_only_changed": [ ],
16+
"skip_ci_on_only_changed": [ "^.ci/", "^changelog", "^docs/", "\\.md$", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"],
1717
"always_require_ci_on_changed": [ ]
1818
},
1919
{

0 commit comments

Comments
 (0)