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
69 changes: 27 additions & 42 deletions .ci/updatecli/updatecli.d/update-beats.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,56 @@
---
name: Update Elastic Beats go.mod Version
pipelineid: 'updatecli-beats-{{ requiredEnv "GIT_BRANCH" }}'
pipelineid: 'updatecli-beats-{{ requiredEnv "BRANCH_NAME" }}'

scms:
default:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
branch: '{{ requiredEnv "GIT_BRANCH" }}'
email: 'cloudsecmachine@elastic.co'

actions:
default:
title: '[updatecli] {{ requiredEnv "GIT_BRANCH" }} - Update to elastic/beats@{{ source "beats" }}'
kind: github/pullrequest
scmid: default
spec:
automerge: false
labels:
- automation
- backport-skip
- dependency
- go
description: |-
### What
`elastic/beats` automatic sync

*Changeset*
* https://github.com/elastic/beats/commit/{{ source "beats" }}

Generated automatically with {{ requiredEnv "JOB_URL" }}
# Note: This pipeline only edits files on disk. It is run with `--commit=false`
# and the resulting Pull Request is created by the `bump-beats-version.yml`
# workflow via peter-evans/create-pull-request, mirroring how elastic-agent does
# it. updatecli does NOT push commits or open the PR itself.

sources:
beats:
kind: json
spec:
file: 'https://api.github.com/repos/elastic/beats/commits?sha={{ requiredEnv "GIT_BRANCH" }}&per_page=1'
file: 'https://api.github.com/repos/elastic/beats/commits?sha={{ requiredEnv "BRANCH_NAME" }}&per_page=1'
key: '.[0].sha'
transformers:
# substring 12 chars so it works for the condition
# substring 12 chars so it matches the go.mod pseudo-version suffix
- findsubmatch:
pattern: ^(.{12}).*
captureindex: 1
gomod:
kind: golang/gomod
spec:
module: github.com/elastic/beats/v7
transformers:
# the commit hash is the last 12 chars of the pseudo-version
- findsubmatch:
pattern: .*(.{12})$
captureindex: 1

conditions:
is:
is-already-updated:
name: Is version 'github.com/elastic/beats@{{ source "beats" }}' not updated in 'go.mod'?
kind: file
kind: shell
disablesourceinput: true
scmid: default
spec:
file: go.mod
matchpattern: 'github\.com/elastic/beats.*-{{ source "beats" }}'
failwhen: true
command: '[ {{ source "beats" }} != {{ source "gomod" }} ]'
failwhen: false

targets:
beats:
name: 'Update to elastic/beats@{{ source "beats" }}'
sourceid: beats
scmid: default
kind: shell
spec:
command: .ci/updatecli/scripts/update-beats.sh
environments:
- name: PATH
- name: HOME
export-versions:
name: "Export the previous and new beats version to /tmp/.beats-previous-version and /tmp/.beats-new-version files"
disablesourceinput: true
kind: shell
spec:
command: |
echo "{{ source "gomod" }}" > /tmp/.beats-previous-version && echo "{{ source "beats" }}" > /tmp/.beats-new-version
6 changes: 4 additions & 2 deletions .github/workflows/updatecli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:
strategy:
fail-fast: false
matrix:
pipeline-name: [ beats, golang, hermit, mods ]
# beats is handled by the dedicated bump-beats-version.yml workflow.
pipeline-name: [ golang, hermit, mods ]
git-branch: [ main ]
steps:
# Disk cleanup
Expand Down Expand Up @@ -93,7 +94,8 @@ jobs:
strategy:
fail-fast: false
matrix:
pipeline-name: [ golang, beats ]
# beats is handled by the dedicated bump-beats-version.yml workflow.
pipeline-name: [ golang ]
git-branch: ${{ fromJSON(needs.active-branches.outputs.matrix) }}
steps:
# Disk cleanup
Expand Down
18 changes: 4 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ require (
github.com/aws/smithy-go v1.27.0
github.com/dgraph-io/ristretto/v2 v2.4.0
github.com/djherbis/times v1.6.0
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20260430192410-12fb790eb7d9
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20260605135444-44d0911195dc
github.com/elastic/e2e-testing v1.2.3
github.com/elastic/elastic-agent-autodiscover v0.10.2
github.com/elastic/elastic-agent-autodiscover v0.10.3-0.20260423154939-e990715f9426
github.com/elastic/elastic-agent-client/v7 v7.18.1
github.com/elastic/elastic-agent-libs v0.36.0
github.com/elastic/elastic-agent-libs v0.43.1
github.com/elastic/go-licenser v0.4.2
github.com/elastic/go-ucfg v0.9.1
github.com/go-logr/zapr v1.3.0
Expand All @@ -81,17 +81,12 @@ require (
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/collector/client v1.59.0 // indirect
go.opentelemetry.io/collector/component v1.59.0 // indirect
go.opentelemetry.io/collector/component/componenttest v0.153.0 // indirect
go.opentelemetry.io/collector/consumer v1.59.0 // indirect
go.opentelemetry.io/collector/consumer/consumererror v0.153.0 // indirect
go.opentelemetry.io/collector/consumer/xconsumer v0.153.0 // indirect
go.opentelemetry.io/collector/featuregate v1.59.0 // indirect
go.opentelemetry.io/collector/pdata v1.59.0 // indirect
go.opentelemetry.io/collector/pdata/pprofile v0.153.0 // indirect
go.opentelemetry.io/collector/pipeline v1.59.0 // indirect
go.opentelemetry.io/collector/receiver v1.59.0 // indirect
go.opentelemetry.io/collector/receiver/receivertest v0.153.0 // indirect
go.opentelemetry.io/collector/receiver/xreceiver v0.153.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.43.0 // indirect
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.68.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0 // indirect
Expand Down Expand Up @@ -302,10 +297,6 @@ require (
go.opentelemetry.io/collector/internal/componentalias v0.153.0 // indirect
go.opentelemetry.io/collector/pdata/xpdata v0.153.0 // indirect
go.opentelemetry.io/collector/pipeline/xpipeline v0.153.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.19.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.65.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.19.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.43.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
Expand Down Expand Up @@ -394,7 +385,6 @@ require (
github.com/dlclark/regexp2 v1.12.0 // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/docker/cli v29.5.3+incompatible // indirect
github.com/docker/docker v28.5.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.9.7 // indirect
github.com/docker/go-connections v0.7.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
Expand All @@ -404,7 +394,7 @@ require (
github.com/eapache/go-resiliency v1.7.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/elastic/elastic-agent-system-metrics v0.14.3 // indirect
github.com/elastic/elastic-agent-system-metrics v0.14.4 // indirect
github.com/elastic/go-concert v0.3.1 // indirect
github.com/elastic/go-lumber v0.1.2-0.20240913080619-93ccc4a69e6a // indirect
github.com/elastic/go-seccomp-bpf v1.6.0 // indirect
Expand Down
Loading
Loading