Skip to content

Commit

Permalink
migrate x-pack/libbeat to static (elastic#38964)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
sharbuz and dliappis authored Apr 19, 2024
1 parent 0d726a6 commit b0690b5
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 267 deletions.
1 change: 0 additions & 1 deletion .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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
29 changes: 28 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ steps:
- label: "Trigger Libbeat"
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:
- libbeat/
Expand All @@ -284,6 +284,33 @@ 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 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"
Expand Down
18 changes: 1 addition & 17 deletions .buildkite/pull-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,6 @@
"skip_target_branches": [ ],
"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/.*"]
}
]
}
}
23 changes: 4 additions & 19 deletions .buildkite/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ 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")"
[ -z "${run_xpack_metricbeat_macos_tests+x}" ] && run_xpack_metricbeat_macos_tests="$(buildkite-agent meta-data get run_xpack_metricbeat_macos_tests --default "false")"
Expand All @@ -30,10 +30,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 @@ -46,10 +42,6 @@ xpack_dockerlogbeat_changeset=(
"^x-pack/dockerlogbeat/.*"
)

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

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

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

Expand All @@ -90,18 +81,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 +332,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 Expand Up @@ -539,4 +524,4 @@ if [[ "$BUILDKITE_STEP_KEY" == "xpack-winlogbeat-pipeline" || "$BUILDKITE_STEP_K
defineModuleFromTheChangeSet "${BEATS_PROJECT_NAME}"
fi

check_and_set_beat_vars
check_and_set_beat_vars
188 changes: 0 additions & 188 deletions .buildkite/scripts/generate_xpack_libbeat_pipeline.sh

This file was deleted.

Loading

0 comments on commit b0690b5

Please sign in to comment.