Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 64 additions & 25 deletions .buildkite/pull-requests.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,65 @@
{
"jobs": [
{
"enabled": true,
"pipeline_slug": "logstash-pull-request-pipeline",
"allow_org_users": true,
"allowed_repo_permissions": ["admin", "write"],
"allowed_list": ["dependabot[bot]", "mergify[bot]", "github-actions[bot]", "elastic-vault-github-plugin-prod[bot]"],
"set_commit_status": true,
"build_on_commit": true,
"build_on_comment": true,
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
"skip_ci_labels": [ ],
"skip_target_branches": [ ],
"skip_ci_on_only_changed": [
"^.github/",
"^docs/",
"^.mergify.yml$",
"^.pre-commit-config.yaml",
"\\.md$"
],
"always_require_ci_on_changed": [ ]
}
]
}
"jobs": [
{
"enabled": true,
"pipeline_slug": "logstash-pull-request-pipeline",
"allow_org_users": true,
"allowed_repo_permissions": [
"admin",
"write"
],
"allowed_list": [
"dependabot[bot]",
"mergify[bot]",
"github-actions[bot]",
"elastic-vault-github-plugin-prod[bot]"
],
"set_commit_status": true,
"build_on_commit": true,
"build_on_comment": true,
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
"skip_ci_labels": [],
"skip_target_branches": [],
"skip_ci_on_only_changed": [
"^.github/",
"^docs/",
"^.mergify.yml$",
"^.pre-commit-config.yaml",
"\\.md$"
],
"always_require_ci_on_changed": []
},
{
"enabled": true,
"pipeline_slug": "logstash-smart-exhaustive-tests-pipeline",
"allow_org_users": true,
"allowed_repo_permissions": [
"admin",
"write"
],
"allowed_list": [
"dependabot[bot]",
"mergify[bot]",
"github-actions[bot]"
],
"set_commit_status": true,
"build_on_commit": true,
"build_on_comment": true,
"trigger_comment_regex": "^(?:(?:/run\\W+)?(?:exhaustive)\\W+(?:tests))",
"always_trigger_comment_regex": "^(?:(?:/run\\W+)(?:exhaustive)\\W+(?:tests))",
"skip_ci_labels": [],
"skip_target_branches": [],
"skip_ci_on_only_changed": [
"^.github/",
"^docs/",
"^.mergify.yml$",
"^.pre-commit-config.yaml",
"\\.md$"
],
"always_require_ci_on_changed": [
"^qa/acceptance/"
]
}
]
}
33 changes: 33 additions & 0 deletions .buildkite/smart_exhaustive_tests_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
steps:
- label: "Trigger logstash-exhaustive-tests-pipeline for PRs with qa/acceptance/ changes"
if: build.pull_request.id != null
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
interpolation: false
watch:
- path:
- ^qa/acceptance/
- .buildkite/smart_exhaustive_tests_pipeline.yml
config:
trigger: "logstash-exhaustive-tests-pipeline"
build:
commit: "${BUILDKITE_COMMIT}"
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}
- ELASTIC_SLACK_NOTIFICATIONS_ENABLE=false

- label: "Trigger logstash-exhaustive-tests-pipeline for GitHub comments"
if: build.env("GITHUB_PR_TRIGGER_COMMENT") != ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if a file has changed in the qa/acceptance/ and a comment in the PR is made?
will be the pipeline logstash-exhaustive-tests-pipeline executed twice?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two different events:

Each event should be treated independently.

Otherwise, what do you mean by your question?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. We want to execute the tests in both cases and every time when push and the right files have changed or when a comment that matches has made.
Thanks!

trigger: "logstash-exhaustive-tests-pipeline"
build:
commit: "${BUILDKITE_COMMIT}"
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}
- ELASTIC_SLACK_NOTIFICATIONS_ENABLE=false
51 changes: 51 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,57 @@ spec:
# SECTION END: Exhaustive tests pipeline
# **************************************

# ****************************************
# SECTION START: Smart exhaustive tests pipeline
# ****************************************

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
name: logstash-smart-exhaustive-tests-pipeline
description: 'Logstash Smart Exhaustive tests pipeline'
links:
- title: 'Logstash Smart Exhaustive tests pipeline'
url: https://buildkite.com/elastic/logstash-smart-exhaustive-tests-pipeline
spec:
type: buildkite-pipeline
owner: group:logstash
system: platform-ingest
implementation:
apiVersion: buildkite.elastic.dev/v1
kind: Pipeline
metadata:
name: "Logstash Smart Exhaustive tests pipeline"
description: '🔍 Run smart exhaustive tests against Logstash using different operating systems'
spec:
repository: elastic/logstash
pipeline_file: ".buildkite/smart_exhaustive_tests_pipeline.yml"
provider_settings:
build_pull_request_forks: false
build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot
build_branches: false
build_tags: false
filter_enabled: true
filter_condition: >-
build.creator.name == 'elasticmachine' && build.pull_request.id != null
cancel_intermediate_builds: true
skip_intermediate_builds: true
teams:
ingest-fp:
access_level: MANAGE_BUILD_AND_READ
logstash:
access_level: MANAGE_BUILD_AND_READ
ingest-eng-prod:
access_level: MANAGE_BUILD_AND_READ
everyone:
access_level: READ_ONLY

# **************************************
# SECTION END: Smart exhaustive tests pipeline
# **************************************

# ********************************************
# Declare supported plugin tests pipeline
# ********************************************
Expand Down