Skip to content

Commit

Permalink
[7.17](backport elastic#38964) migrate x-pack/libbeat to static (elas…
Browse files Browse the repository at this point in the history
…tic#39082)

* migrate x-pack/libbeat to static (elastic#38964)

* migrate x-pack/libbeat to static

* Update pull-requests.json

* change paths

* Update pull-requests.json

* change conditions for group-steps

* change the pipeline.yml

* work with remarks

* work with remarks

* remove libbeat and x-pack/libbeat changesets from the common.sh

* remove libbeat and x-pack/libbeat changesets from the common.sh

* fix merge issues

* Update .buildkite/x-pack/pipeline.xpack.libbeat.yml

Co-authored-by: Dimitrios Liappis <[email protected]>

* apply common.sh from main and cleanup it

* change paths

---------

Co-authored-by: Dimitrios Liappis <[email protected]>
(cherry picked from commit b0690b5)

# Conflicts:
#	.buildkite/pipeline.yml
#	.buildkite/pull-requests.json
#	.buildkite/scripts/common.sh
#	.buildkite/x-pack/pipeline.xpack.libbeat.yml

* Update pipeline.yml

* Update pull-requests.json

* Update pull-requests.json

* Update common.sh

* Update pipeline.xpack.libbeat.yml

* Update pipeline.xpack.libbeat.yml

* Update pipeline.xpack.libbeat.yml

---------

Co-authored-by: Siarhei Harbuz <[email protected]>
  • Loading branch information
mergify[bot] and sharbuz authored Apr 22, 2024
1 parent e3f61e4 commit 9b27c91
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 262 deletions.
1 change: 0 additions & 1 deletion .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ ENABLED_BEATS_PIPELINES_SLUGS=(
"beats-packetbeat"
"beats-winlogbeat"
"beats-winlogbeat"
"beats-xpack-libbeat"
"beats-xpack-packetbeat"
"beats-xpack-winlogbeat"
"beats-xpack-dockerlogbeat"
Expand Down
26 changes: 26 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,32 @@ steps:
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}

- label: "Trigger x-pack/libbeat"
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
watch:
- path:
- x-pack/libbeat/
- .buildkite/x-pack/pipeline.xpack.libbeat.yml
- .buildkite/scripts
- .buildkite/hooks
# x-pack
- go.mod
- pytest.ini
- dev-tools/
- libbeat/
- testing/
config:
trigger: "beats-xpack-libbeat"
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}

- label: "Trigger x-pack/auditbeat"
plugins:
- monorepo-diff#v1.0.1:
Expand Down
16 changes: 0 additions & 16 deletions .buildkite/pull-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,6 @@
"skip_ci_on_only_changed": [ ],
"always_require_ci_on_changed": ["^x-pack/packetbeat/.*", "^.buildkite/.*", "^go.mod", "^pytest.ini", "^dev-tools/.*", "^libbeat/.*", "^testing/.*", "^x-pack/libbeat/.*"]
},
{
"enabled": true,
"pipelineSlug": "beats-xpack-libbeat",
"allow_org_users": true,
"allowed_repo_permissions": ["admin", "write"],
"allowed_list": [ ],
"set_commit_status": true,
"build_on_commit": true,
"build_on_comment": true,
"trigger_comment_regex": "^/test x-pack/libbeat$",
"always_trigger_comment_regex": "^/test x-pack/libbeat$",
"skip_ci_labels": [ ],
"skip_target_branches": [ ],
"skip_ci_on_only_changed": [ ],
"always_require_ci_on_changed": ["^x-pack/libbeat/.*", "^.buildkite/.*", "^go.mod", "^pytest.ini", "^dev-tools/.*", "^libbeat/.*", "^testing/.*", "^x-pack/libbeat/.*"]
},
{
"enabled": true,
"pipelineSlug": "beats-xpack-auditbeat",
Expand Down
19 changes: 1 addition & 18 deletions .buildkite/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ XPACK_MODULE_PATTERN="^x-pack\\/[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*"
# define if needed run the whole pipeline for the particular beat
[ -z "${run_filebeat+x}" ] && run_filebeat="$(buildkite-agent meta-data get run_filebeat --default "false")"
[ -z "${run_packetbeat+x}" ] && run_packetbeat="$(buildkite-agent meta-data get run_packetbeat --default "false")"
[ -z "${run_xpack_libbeat+x}" ] && run_xpack_libbeat="$(buildkite-agent meta-data get run_xpack_libbeat --default "false")"
[ -z "${run_xpack_metricbeat+x}" ] && run_xpack_metricbeat="$(buildkite-agent meta-data get run_xpack_metricbeat --default "false")"
[ -z "${run_xpack_packetbeat+x}" ] && run_xpack_packetbeat="$(buildkite-agent meta-data get run_xpack_packetbeat --default "false")"

# define if needed run ARM platform-specific tests for the particular beat
[ -z "${run_filebeat_arm_tests+x}" ] && run_filebeat_arm_tests="$(buildkite-agent meta-data get run_filebeat_arm_tests --default "false")"
[ -z "${run_packetbeat_arm_tests+x}" ] && run_packetbeat_arm_tests="$(buildkite-agent meta-data get run_packetbeat_arm_tests --default "false")"
[ -z "${run_xpack_libbeat_arm_tests+x}" ] && run_xpack_libbeat_arm_tests="$(buildkite-agent meta-data get run_xpack_libbeat_arm_tests --default "false")"
[ -z "${run_xpack_packetbeat_arm_tests+x}" ] && run_xpack_packetbeat_arm_tests="$(buildkite-agent meta-data get run_xpack_packetbeat_arm_tests --default "false")"
# define if needed run MacOS platform-specific tests for the particular beat
[ -z "${run_packetbeat_macos_tests+x}" ] && run_packetbeat_macos_tests="$(buildkite-agent meta-data get run_packetbeat_macos_tests --default "false")"
Expand All @@ -31,10 +29,6 @@ XPACK_MODULE_PATTERN="^x-pack\\/[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*"
# define if needed run cloud-specific tests for the particular beat
[ -z "${run_xpack_metricbeat_aws_tests+x}" ] && run_xpack_metricbeat_aws_tests="$(buildkite-agent meta-data get run_xpack_metricbeat_aws_tests --default "false")"

libbeat_changeset=(
"^libbeat/.*"
)

packetbeat_changeset=(
"^packetbeat/.*"
)
Expand All @@ -47,10 +41,6 @@ xpack_dockerlogbeat_changeset=(
"^x-pack/dockerlogbeat/.*"
)

xpack_libbeat_changeset=(
"^x-pack/libbeat/.*"
)

xpack_packetbeat_changeset=(
"^x-pack/packetbeat/.*"
)
Expand All @@ -76,7 +66,6 @@ oss_changeset=(
)

xpack_changeset=(
"${xpack_libbeat_changeset[@]}"
"${oss_changeset[@]}"
)

Expand All @@ -91,18 +80,12 @@ packaging_changeset=(
)

case "${BUILDKITE_PIPELINE_SLUG}" in
"beats-libbeat")
BEAT_CHANGESET_REFERENCE=${libbeat_changeset[@]}
;;
"beats-packetbeat")
BEAT_CHANGESET_REFERENCE=${packetbeat_changeset[@]}
;;
"beats-winlogbeat")
BEAT_CHANGESET_REFERENCE=${winlogbeat_changeset[@]}
;;
"beats-xpack-libbeat")
BEAT_CHANGESET_REFERENCE=${xpack_libbeat_changeset[@]}
;;
"beats-xpack-metricbeat")
BEAT_CHANGESET_REFERENCE=${xpack_metricbeat_changeset[@]}
;;
Expand Down Expand Up @@ -347,7 +330,7 @@ are_conditions_met_mandatory_tests() {

are_conditions_met_arm_tests() {
if are_conditions_met_mandatory_tests; then #from https://github.com/elastic/beats/blob/c5e79a25d05d5bdfa9da4d187fe89523faa42afc/Jenkinsfile#L145-L171
if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-libbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-packetbeat" ]]; then
if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-packetbeat" ]]; then
if [[ "${GITHUB_PR_TRIGGER_COMMENT}" == "${BEATS_GH_ARM_COMMENT}" || "${GITHUB_PR_LABELS}" =~ ${BEATS_GH_ARM_LABEL} || "${!TRIGGER_SPECIFIC_ARM_TESTS}" == "true" ]]; then
return 0
fi
Expand Down
188 changes: 0 additions & 188 deletions .buildkite/scripts/generate_xpack_libbeat_pipeline.sh

This file was deleted.

Loading

0 comments on commit 9b27c91

Please sign in to comment.