From c8dc96ef9d00d5199eea3b275505b06c672f32ac Mon Sep 17 00:00:00 2001 From: edmocosta <11836452+edmocosta@users.noreply.github.com> Date: Tue, 12 May 2026 14:04:07 +0200 Subject: [PATCH 1/3] Use GH actions instead of buildkite --- .buildkite/hooks/post-checkout | 53 ----------------------- .buildkite/hooks/pre-command | 8 ---- .buildkite/hooks/pre-command.ps1 | 15 ------- .buildkite/pipeline.yml | 32 -------------- .buildkite/pull-requests.json | 16 ------- .buildkite/scripts/lint.sh | 14 ------ .buildkite/scripts/pre-install-command.sh | 53 ----------------------- .buildkite/scripts/test.ps1 | 30 ------------- .buildkite/scripts/test.sh | 21 --------- .buildkite/scripts/tooling.sh | 21 --------- .github/CODEOWNERS | 3 ++ .github/actions/setup/action.yml | 12 +++++ ".github/dependabot.yml\342\200\216" | 15 +++++++ .github/workflows/ci.yml | 46 ++++++++++++++++++++ catalog-info.yaml | 43 ------------------ 15 files changed, 76 insertions(+), 306 deletions(-) delete mode 100644 .buildkite/hooks/post-checkout delete mode 100644 .buildkite/hooks/pre-command delete mode 100644 .buildkite/hooks/pre-command.ps1 delete mode 100644 .buildkite/pipeline.yml delete mode 100644 .buildkite/pull-requests.json delete mode 100755 .buildkite/scripts/lint.sh delete mode 100755 .buildkite/scripts/pre-install-command.sh delete mode 100755 .buildkite/scripts/test.ps1 delete mode 100644 .buildkite/scripts/test.sh delete mode 100755 .buildkite/scripts/tooling.sh create mode 100644 .github/actions/setup/action.yml create mode 100644 ".github/dependabot.yml\342\200\216" create mode 100644 .github/workflows/ci.yml diff --git a/.buildkite/hooks/post-checkout b/.buildkite/hooks/post-checkout deleted file mode 100644 index 5f052f1..0000000 --- a/.buildkite/hooks/post-checkout +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -checkout_merge() { - local target_branch=$1 - local pr_commit=$2 - local merge_branch=$3 - - if [[ -z "${target_branch}" ]]; then - echo "No pull request target branch" - exit 1 - fi - - git fetch -v origin "${target_branch}" - git checkout FETCH_HEAD - echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" - - # create temporary branch to merge the PR with the target branch - git checkout -b ${merge_branch} - echo "New branch created: $(git rev-parse --abbrev-ref HEAD)" - - # set author identity so it can be run git merge - git config user.name "github-merged-pr-post-checkout" - git config user.email "auto-merge@buildkite" - - git merge --no-edit "${BUILDKITE_COMMIT}" || { - local merge_result=$? - echo "Merge failed: ${merge_result}" - git merge --abort - exit ${merge_result} - } -} - -pull_request="${BUILDKITE_PULL_REQUEST:-false}" - -if [[ "${pull_request}" == "false" ]]; then - echo "Not a pull request, skipping" - exit 0 -fi - -TARGET_BRANCH="${BUILDKITE_PULL_REQUEST_BASE_BRANCH:-master}" -PR_COMMIT="${BUILDKITE_COMMIT}" -PR_ID=${BUILDKITE_PULL_REQUEST} -MERGE_BRANCH="pr_merge_${PR_ID}" - -checkout_merge "${TARGET_BRANCH}" "${PR_COMMIT}" "${MERGE_BRANCH}" - -echo "Commit information" -git --no-pager log --format=%B -n 1 - -# Ensure buildkite groups are rendered -echo "" diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command deleted file mode 100644 index 56385d2..0000000 --- a/.buildkite/hooks/pre-command +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -echo "Golang version:" -version=$(cat .go-version) -export GO_VERSION="${version}" -echo "${GO_VERSION}" diff --git a/.buildkite/hooks/pre-command.ps1 b/.buildkite/hooks/pre-command.ps1 deleted file mode 100644 index 75ae8be..0000000 --- a/.buildkite/hooks/pre-command.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -$env:GO_VERSION = Get-Content -Path .go-version - -# Install gvm and go -# TODO: Move GVM download to the base VM image -$env:GvmVersion = "0.5.2" -[Net.ServicePointManager]::SecurityProtocol = "tls12" -$env:GoVersion = Get-Content -Path .go-version -Invoke-WebRequest -URI https://github.com/andrewkroh/gvm/releases/download/v$env:GvmVersion/gvm-windows-amd64.exe -Outfile C:\Windows\System32\gvm.exe -gvm --format=powershell $env:GO_VERSION | Invoke-Expression -go version - -$GOPATH = $(go env GOPATH) -$env:Path = "$GOPATH\bin;" + $env:Path -[Environment]::SetEnvironmentVariable("GOPATH", "$GOPATH", [EnvironmentVariableTarget]::Machine) -[Environment]::SetEnvironmentVariable("Path", "$GOPATH\bin;$env:Path", [EnvironmentVariableTarget]::Machine) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml deleted file mode 100644 index 002a274..0000000 --- a/.buildkite/pipeline.yml +++ /dev/null @@ -1,32 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json -env: - SETUP_MAGE_VERSION: '1.15.0' - SETUP_GVM_VERSION: 'v0.5.0' - -steps: - - label: ":buildkite: Lint" - command: - - ".buildkite/scripts/lint.sh" - agents: - image: golang:${GO_VERSION} - cpu: "8" - memory: "4G" - - - label: ":linux: Test Linux" - key: test-lin - command: - - ".buildkite/scripts/test.sh" - agents: - image: golang:${GO_VERSION} - cpu: "8" - memory: "12G" - - - label: ":windows: Test Windows" - key: test-win - command: - - ".buildkite/scripts/test.ps1" - agents: - provider: "gcp" - image: "family/core-windows-2019" - cpu: "8" - memory: "12G" diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json deleted file mode 100644 index 9e30c96..0000000 --- a/.buildkite/pull-requests.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "jobs": [ - { - "enabled": true, - "pipeline_slug": "lunes", - "allow_org_users": true, - "allowed_repo_permissions": ["admin", "write"], - "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-ci"], - "skip_ci_on_only_changed": ["\\.md$"] - } - ] - } diff --git a/.buildkite/scripts/lint.sh b/.buildkite/scripts/lint.sh deleted file mode 100755 index c499dd1..0000000 --- a/.buildkite/scripts/lint.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -echo "--- Pre install" -source .buildkite/scripts/pre-install-command.sh -add_bin_path -with_mage - -echo "--- Mage notice" -mage notice - -echo "--- Mage check" -mage -v check diff --git a/.buildkite/scripts/pre-install-command.sh b/.buildkite/scripts/pre-install-command.sh deleted file mode 100755 index 9294cdf..0000000 --- a/.buildkite/scripts/pre-install-command.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -set -euo pipefail - -source .buildkite/scripts/tooling.sh - -add_bin_path(){ - mkdir -p "${WORKSPACE}/bin" - export PATH="${WORKSPACE}/bin:${PATH}" -} - -with_mage() { - mkdir -p "${WORKSPACE}/bin" - retry 5 curl -sL -o "${WORKSPACE}/bin/mage.tar.gz" "https://github.com/magefile/mage/releases/download/v${SETUP_MAGE_VERSION}/mage_${SETUP_MAGE_VERSION}_Linux-64bit.tar.gz" - - tar -xvf "${WORKSPACE}/bin/mage.tar.gz" -C "${WORKSPACE}/bin" - chmod +x "${WORKSPACE}/bin/mage" - mage --version -} - -with_go_junit_report() { - go install github.com/jstemmer/go-junit-report/v2@latest -} - -with_go() { - local go_version=$1 - local gvm_version=$2 - url=$(get_gvm_link "${gvm_version}") - WORKSPACE=${WORKSPACE:-"$(pwd)"} - mkdir -p "${WORKSPACE}/bin" - export PATH="${PATH}:${WORKSPACE}/bin" - retry 5 curl -L -o "${WORKSPACE}/bin/gvm" "${url}" - chmod +x "${WORKSPACE}/bin/gvm" - ls ${WORKSPACE}/bin/ - eval "$(gvm $go_version)" - go_path="$(go env GOPATH):$(go env GOPATH)/bin" - export PATH="${PATH}:${go_path}" - go version -} - -# for gvm link -get_gvm_link() { - local gvm_version=$1 - platform_type="$(uname)" - arch_type="$(uname -m)" - [[ ${arch_type} == "aarch64" ]] && arch_type="arm64" # gvm do not have 'aarch64' name for archetecture type - [[ ${arch_type} == "x86_64" ]] && arch_type="amd64" - echo "https://github.com/andrewkroh/gvm/releases/download/${gvm_version}/gvm-${platform_type}-${arch_type}" -} - -# Required env variables: -# WORKSPACE -# SETUP_MAGE_VERSION -WORKSPACE=${WORKSPACE:-"$(pwd)"} diff --git a/.buildkite/scripts/test.ps1 b/.buildkite/scripts/test.ps1 deleted file mode 100755 index 6874a26..0000000 --- a/.buildkite/scripts/test.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -$ErrorActionPreference = "Stop" # set -e -# Forcing to checkout again all the files with a correct autocrlf. -# Doing this here because we cannot set git clone options before. -function fixCRLF { - Write-Host "-- Fixing CRLF in git checkout --" - git config core.autocrlf input - git rm --quiet --cached -r . - git reset --quiet --hard -} - -Write-Host "--- Prepare environment" -fixCRLF - -Write-Host "--- Run test" -$ErrorActionPreference = "Continue" # set +e -mkdir -p build -$OUT_FILE="output-report.out" -go test "./..." -v > $OUT_FILE -$EXITCODE=$LASTEXITCODE -$ErrorActionPreference = "Stop" - -# Buildkite collapse logs under --- symbols -# need to change --- to anything else or switch off collapsing (note: not available at the moment of this commit) -$contest = Get-Content $OUT_FILE -foreach ($line in $contest) { - $changed = $line -replace '---', '----' - Write-Host $changed -} - -Exit $EXITCODE diff --git a/.buildkite/scripts/test.sh b/.buildkite/scripts/test.sh deleted file mode 100644 index 6e09948..0000000 --- a/.buildkite/scripts/test.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -echo "--- Pre install" -source .buildkite/scripts/pre-install-command.sh -go version -add_bin_path - -echo "--- Go Test" -set +ex -go test -race -v ./... > tests-report.txt -exit_code=$? -set -ex - -# Buildkite collapse logs under --- symbols -# need to change --- to anything else or switch off collapsing (note: not available at the moment of this commit) -echo "--- Test Results" -awk '{gsub("---", "----"); print }' tests-report.txt - -exit $exit_code diff --git a/.buildkite/scripts/tooling.sh b/.buildkite/scripts/tooling.sh deleted file mode 100755 index 49dedab..0000000 --- a/.buildkite/scripts/tooling.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -retry() { - local retries=$1 - shift - - local count=0 - until "$@"; do - exit=$? - wait=$((2 ** count)) - count=$((count + 1)) - if [ $count -lt "$retries" ]; then - >&2 echo "Retry $count/$retries exited $exit, retrying in $wait seconds..." - sleep $wait - else - >&2 echo "Retry $count/$retries exited $exit, no more retries left." - return $exit - fi - done - return 0 -} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 38d2db0..c61a8b4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,6 @@ # These owners will be the default owners for everything in # the repo. * @elastic/logstash + +# CI workflows +/.github/workflows/ @elastic/observablt-ci diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..179404d --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,12 @@ +--- +name: setup + +runs: + using: "composite" + steps: + - uses: actions/setup-go@v6 + with: + go-version-file: .go-version + + - run: go install github.com/magefile/mage@v1.15.0 + shell: bash diff --git "a/.github/dependabot.yml\342\200\216" "b/.github/dependabot.yml\342\200\216" new file mode 100644 index 0000000..b9a9834 --- /dev/null +++ "b/.github/dependabot.yml\342\200\216" @@ -0,0 +1,15 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directories: + - "/" + - "/.github/actions/*" + schedule: + interval: "weekly" + day: "sunday" + time: "22:00" + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0a8073a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +--- +name: ci + +on: + push: + branches: + - main + pull_request: + merge_group: + +# limit the access of the generated GITHUB_TOKEN +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/setup + - run: mage notice + - run: mage check + + test: + needs: lint + strategy: + fail-fast: false + matrix: + os: ['ubuntu-22.04', 'windows-2022'] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/setup + - run: go test -v -race ./... + + test-preview: + needs: lint + strategy: + fail-fast: false + matrix: + os: ['macos-15', 'ubuntu-24.04-arm', 'windows-11-arm'] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/setup + - run: go test -v ./... diff --git a/catalog-info.yaml b/catalog-info.yaml index f29a2b7..1a846eb 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -12,46 +12,3 @@ spec: owner: group:logstash system: platform-ingest lifecycle: production - ---- -# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json -apiVersion: backstage.io/v1alpha1 -kind: Resource -metadata: - name: buildkite-pipeline-lunes - description: Buildkite Pipeline for lunes - links: - - title: Pipeline - url: https://buildkite.com/elastic/lunes - -spec: - type: buildkite-pipeline - owner: group:logstash - system: platform-ingest - implementation: - apiVersion: buildkite.elastic.dev/v1 - kind: Pipeline - metadata: - name: lunes - description: Buildkite pipeline for the lunes library - spec: - branch_configuration: "main" - repository: elastic/lunes - pipeline_file: ".buildkite/pipeline.yml" - maximum_timeout_in_minutes: 60 - 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_tags: true - filter_enabled: true - filter_condition: >- - build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null) - cancel_intermediate_builds: true - cancel_intermediate_builds_branch_filter: '!main' - skip_intermediate_builds: true - skip_intermediate_builds_branch_filter: '!main' - teams: - logstash: - access_level: MANAGE_BUILD_AND_READ - everyone: - access_level: READ_ONLY From c1ca70bf47d007a190f03b4dc600fa58e0e14fc6 Mon Sep 17 00:00:00 2001 From: edmocosta <11836452+edmocosta@users.noreply.github.com> Date: Tue, 12 May 2026 14:08:08 +0200 Subject: [PATCH 2/3] Update NOTICE.txt --- NOTICE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE.txt b/NOTICE.txt index 294e1a3..780a228 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,5 +1,5 @@ Lunes -Copyright 2022-2025 Elasticsearch BV +Copyright 2022-2026 Elasticsearch BV This product includes software developed by The Apache Software Foundation (http://www.apache.org/). From 08896d564290680691d99926d09b269bb0b1cf1e Mon Sep 17 00:00:00 2001 From: edmocosta <11836452+edmocosta@users.noreply.github.com> Date: Tue, 12 May 2026 15:47:49 +0200 Subject: [PATCH 3/3] Update CODEOWNERS file --- .github/CODEOWNERS | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c61a8b4..38d2db0 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,6 +1,3 @@ # These owners will be the default owners for everything in # the repo. * @elastic/logstash - -# CI workflows -/.github/workflows/ @elastic/observablt-ci