Skip to content

Commit fc9ad7f

Browse files
authored
feat(ci): support exhaustive tests for PRs (code changes or GH comment) (#18327)
1 parent 915b69f commit fc9ad7f

File tree

3 files changed

+150
-25
lines changed

3 files changed

+150
-25
lines changed

.buildkite/pull-requests.json

Lines changed: 65 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,66 @@
11
{
2-
"jobs": [
3-
{
4-
"enabled": true,
5-
"pipeline_slug": "logstash-pull-request-pipeline",
6-
"allow_org_users": true,
7-
"allowed_repo_permissions": ["admin", "write"],
8-
"allowed_list": ["dependabot[bot]", "mergify[bot]", "github-actions[bot]", "elastic-vault-github-plugin-prod[bot]"],
9-
"set_commit_status": true,
10-
"build_on_commit": true,
11-
"build_on_comment": true,
12-
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
13-
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
14-
"skip_ci_labels": [ ],
15-
"skip_target_branches": [ ],
16-
"skip_ci_on_only_changed": [
17-
"^.github/",
18-
"^docs/",
19-
"^.mergify.yml$",
20-
"^.pre-commit-config.yaml",
21-
"\\.md$"
22-
],
23-
"always_require_ci_on_changed": [ ]
24-
}
25-
]
26-
}
2+
"jobs": [
3+
{
4+
"enabled": true,
5+
"pipeline_slug": "logstash-pull-request-pipeline",
6+
"allow_org_users": true,
7+
"allowed_repo_permissions": [
8+
"admin",
9+
"write"
10+
],
11+
"allowed_list": [
12+
"dependabot[bot]",
13+
"mergify[bot]",
14+
"github-actions[bot]",
15+
"elastic-vault-github-plugin-prod[bot]"
16+
],
17+
"set_commit_status": true,
18+
"build_on_commit": true,
19+
"build_on_comment": true,
20+
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
21+
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
22+
"skip_ci_labels": [],
23+
"skip_target_branches": [],
24+
"skip_ci_on_only_changed": [
25+
"^.github/",
26+
"^docs/",
27+
"^.mergify.yml$",
28+
"^.pre-commit-config.yaml",
29+
"\\.md$"
30+
],
31+
"always_require_ci_on_changed": []
32+
},
33+
{
34+
"enabled": true,
35+
"pipeline_slug": "logstash-smart-exhaustive-tests-pipeline",
36+
"allow_org_users": true,
37+
"allowed_repo_permissions": [
38+
"admin",
39+
"write"
40+
],
41+
"allowed_list": [
42+
"dependabot[bot]",
43+
"mergify[bot]",
44+
"github-actions[bot]"
45+
],
46+
"set_commit_status": true,
47+
"build_on_commit": true,
48+
"build_on_comment": true,
49+
"trigger_comment_regex": "^/?run\s+exhaustive\s+tests$",
50+
"always_trigger_comment_regex": "^/?run\s+exhaustive\s+tests$",
51+
"always_trigger_comment_regex": "^(?:(?:/run\\W+)(?:exhaustive)\\W+(?:tests))",
52+
"skip_ci_labels": [],
53+
"skip_target_branches": [],
54+
"skip_ci_on_only_changed": [
55+
"^.github/",
56+
"^docs/",
57+
"^.mergify.yml$",
58+
"^.pre-commit-config.yaml",
59+
"\\.md$"
60+
],
61+
"always_require_ci_on_changed": [
62+
"^qa/acceptance/"
63+
]
64+
}
65+
]
66+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
steps:
2+
- label: "Trigger logstash-exhaustive-tests-pipeline for PRs with qa/acceptance/ changes"
3+
if: build.pull_request.id != null
4+
plugins:
5+
- monorepo-diff#v1.0.1:
6+
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
7+
interpolation: false
8+
watch:
9+
- path:
10+
- ^qa/acceptance/
11+
- ^ci/acceptance_tests.sh
12+
- .buildkite/smart_exhaustive_tests_pipeline.yml
13+
config:
14+
trigger: "logstash-exhaustive-tests-pipeline"
15+
build:
16+
commit: "${BUILDKITE_COMMIT}"
17+
branch: "${BUILDKITE_BRANCH}"
18+
env:
19+
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
20+
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
21+
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}
22+
- ELASTIC_SLACK_NOTIFICATIONS_ENABLE=false
23+
24+
- label: "Trigger logstash-exhaustive-tests-pipeline for GitHub comments"
25+
if: build.env("GITHUB_PR_TRIGGER_COMMENT") != ""
26+
trigger: "logstash-exhaustive-tests-pipeline"
27+
build:
28+
commit: "${BUILDKITE_COMMIT}"
29+
branch: "${BUILDKITE_BRANCH}"
30+
env:
31+
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
32+
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
33+
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}
34+
- ELASTIC_SLACK_NOTIFICATIONS_ENABLE=false

catalog-info.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,57 @@ spec:
479479
# SECTION END: Exhaustive tests pipeline
480480
# **************************************
481481

482+
# ****************************************
483+
# SECTION START: Smart exhaustive tests pipeline
484+
# ****************************************
485+
486+
---
487+
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
488+
apiVersion: backstage.io/v1alpha1
489+
kind: Resource
490+
metadata:
491+
name: logstash-smart-exhaustive-tests-pipeline
492+
description: 'Logstash Smart Exhaustive tests pipeline'
493+
links:
494+
- title: 'Logstash Smart Exhaustive tests pipeline'
495+
url: https://buildkite.com/elastic/logstash-smart-exhaustive-tests-pipeline
496+
spec:
497+
type: buildkite-pipeline
498+
owner: group:logstash
499+
system: platform-ingest
500+
implementation:
501+
apiVersion: buildkite.elastic.dev/v1
502+
kind: Pipeline
503+
metadata:
504+
name: "Logstash Smart Exhaustive tests pipeline"
505+
description: '🔍 Run smart exhaustive tests against Logstash using different operating systems'
506+
spec:
507+
repository: elastic/logstash
508+
pipeline_file: ".buildkite/smart_exhaustive_tests_pipeline.yml"
509+
provider_settings:
510+
build_pull_request_forks: false
511+
build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot
512+
build_branches: false
513+
build_tags: false
514+
filter_enabled: true
515+
filter_condition: >-
516+
build.creator.name == 'elasticmachine' && build.pull_request.id != null
517+
cancel_intermediate_builds: true
518+
skip_intermediate_builds: true
519+
teams:
520+
ingest-fp:
521+
access_level: MANAGE_BUILD_AND_READ
522+
logstash:
523+
access_level: MANAGE_BUILD_AND_READ
524+
ingest-eng-prod:
525+
access_level: MANAGE_BUILD_AND_READ
526+
everyone:
527+
access_level: READ_ONLY
528+
529+
# **************************************
530+
# SECTION END: Smart exhaustive tests pipeline
531+
# **************************************
532+
482533
# ********************************************
483534
# Declare supported plugin tests pipeline
484535
# ********************************************

0 commit comments

Comments
 (0)