Skip to content

Commit d8125be

Browse files
authored
Update 8.x from main (#5488)
Update 8.x from main
1 parent fd477ec commit d8125be

File tree

918 files changed

+27069
-9738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

918 files changed

+27069
-9738
lines changed

.buildkite/hooks/pre-command

+6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ if [[ "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then
5858
export API_KEY_TOKEN=$(vault kv get -field apiKey ${CI_ESS_PATH})
5959
echo ${API_KEY_TOKEN} > ./apiKey
6060
export TEST_INTEG_AUTH_ESS_APIKEY_FILE=$(realpath ./apiKey)
61+
62+
# BK analytics
63+
echo "--- Prepare BK test analytics token :vault:"
64+
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_analytics_token)
65+
export BUILDKITE_ANALYTICS_TOKEN
66+
6167
fi
6268

6369
if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-binary-dra" ]]; then

.buildkite/hooks/pre-exit

100755100644
-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ if [ -n "$TEST_INTEG_AUTH_GCP_SERVICE_TOKEN_FILE" ]; then
2626
fi
2727
fi
2828

29-
source .buildkite/scripts/unset-secrets.sh
30-
3129
if command -v docker &>/dev/null; then
3230
DOCKER_REGISTRY="docker.elastic.co"
3331
docker logout $DOCKER_REGISTRY

.buildkite/integration.pipeline.yml

+8
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ steps:
7777
notify:
7878
- github_commit_status:
7979
context: "buildkite/elastic-agent-extended-testing - Integration tests"
80+
plugins:
81+
- test-collector#v1.10.1:
82+
files: "build/TEST-*.xml"
83+
format: "junit"
84+
branches: "main"
85+
debug: true
8086

8187
- label: "Serverless Beats Tests"
8288
depends_on:
@@ -96,3 +102,5 @@ steps:
96102
notify:
97103
- github_commit_status:
98104
context: "buildkite/elastic-agent-extended-testing - Serverless Beats Tests"
105+
106+

.buildkite/pipeline.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ steps:
171171
artifact_paths:
172172
- "build/TEST-go-unit.cov"
173173
agents:
174-
image: "golang:1.20.10"
174+
image: "golang:1.22.6"
175175
depends_on:
176176
- unit-tests
177177
- extended-windows

.buildkite/scripts/common.sh

+1-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ if [[ -z "${WORKSPACE-""}" ]]; then
66
WORKSPACE=$(git rev-parse --show-toplevel)
77
export WORKSPACE
88
fi
9-
if [[ -z "${SETUP_MAGE_VERSION-""}" ]]; then
10-
SETUP_MAGE_VERSION="1.14.0"
11-
fi
129
if [[ -z "${SETUP_GVM_VERSION-""}" ]]; then
13-
SETUP_GVM_VERSION="v0.5.0" # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
10+
SETUP_GVM_VERSION="v0.5.2" # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
1411
fi
1512
BEAT_VERSION=$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+(\-[a-zA-Z]+[0-9]+)?' "${WORKSPACE}/version/version.go")
1613
export BEAT_VERSION
@@ -54,7 +51,6 @@ mage() {
5451
go version
5552
if ! [ -x "$(type -P mage | sed 's/mage is //g')" ];
5653
then
57-
echo "installing mage ${SETUP_MAGE_VERSION}"
5854
make mage
5955
fi
6056
pushd "$WORKSPACE"

.buildkite/scripts/steps/sync-k8s.sh

+4-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ source .buildkite/scripts/install-gh.sh
77
source .buildkite/scripts/common.sh
88

99
echo "--- [Prepare env] Create required env variables"
10-
GITHUB_TOKEN_VAULT_PATH="kv/ci-shared/platform-ingest/github_token"
11-
GITHUB_USERNAME_SECRET=$(retry 5 vault kv get -field username ${GITHUB_TOKEN_VAULT_PATH})
12-
export GITHUB_USERNAME_SECRET
13-
GITHUB_EMAIL_SECRET=$(retry 5 vault kv get -field email ${GITHUB_TOKEN_VAULT_PATH})
14-
export GITHUB_EMAIL_SECRET
15-
GITHUB_TOKEN_SECRET=$(retry 5 vault kv get -field token ${GITHUB_TOKEN_VAULT_PATH})
16-
export GITHUB_TOKEN_SECRET
10+
GITHUB_USERNAME_SECRET="elasticmachine"
11+
export GITHUB_USERNAME_SECRET=$GITHUB_USERNAME_SECRET
12+
export GITHUB_EMAIL_SECRET="elasticmachine@elastic.co"
13+
export GITHUB_TOKEN_SECRET=$VAULT_GITHUB_TOKEN
1714

1815
cd deploy/kubernetes
1916

.buildkite/scripts/unset-secrets.sh

-9
This file was deleted.

.ci/bump-golang.yml

-143
This file was deleted.

.ci/scripts/install-go.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ mkdir %WORKSPACE%\bin
1414
IF EXIST "%PROGRAMFILES(X86)%" (
1515
REM Force the gvm installation.
1616
SET GVM_BIN=gvm.exe
17-
curl -L -o %WORKSPACE%\bin\gvm.exe https://github.com/andrewkroh/gvm/releases/download/v0.3.0/gvm-windows-amd64.exe
17+
curl -L -o %WORKSPACE%\bin\gvm.exe https://github.com/andrewkroh/gvm/releases/download/v0.5.2/gvm-windows-amd64.exe
1818
IF ERRORLEVEL 1 (
1919
REM gvm installation has failed.
2020
del bin\gvm.exe /s /f /q
2121
exit /b 1
2222
)
2323
) ELSE (
2424
REM Windows 7 workers got a broken gvm installation.
25-
curl -L -o %WORKSPACE%\bin\gvm.exe https://github.com/andrewkroh/gvm/releases/download/v0.3.0/gvm-windows-386.exe
25+
curl -L -o %WORKSPACE%\bin\gvm.exe https://github.com/andrewkroh/gvm/releases/download/v0.5.2/gvm-windows-386.exe
2626
IF ERRORLEVEL 1 (
2727
REM gvm installation has failed.
2828
del bin\gvm.exe /s /f /q

.ci/scripts/install-go.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fi
3535
echo "UNMET DEP: Installing Go"
3636
mkdir -p "${HOME}/bin"
3737

38-
curl -sSLo "${GVM_CMD}" "https://github.com/andrewkroh/gvm/releases/download/v0.3.0/gvm-${OS}-${GVM_ARCH_SUFFIX}"
38+
curl -sSLo "${GVM_CMD}" "https://github.com/andrewkroh/gvm/releases/download/v0.5.2/gvm-${OS}-${GVM_ARCH_SUFFIX}"
3939
chmod +x "${GVM_CMD}"
4040

4141
${GVM_CMD} "${GO_VERSION}" |cut -d ' ' -f 2|tr -d '\"' > ${PROPERTIES_FILE}

.github/updatecli-bump-golang.yml .ci/updatecli/updatecli-bump-golang.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ scms:
66
githubConfig:
77
kind: github
88
spec:
9-
user: '{{ requiredEnv "GIT_USER" }}'
10-
email: '{{ requiredEnv "GIT_EMAIL" }}'
11-
owner: elastic
12-
repository: elastic-agent
9+
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
10+
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
11+
owner: '{{ .scm.owner }}'
12+
repository: '{{ .scm.repository }}'
1313
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
14-
username: '{{ requiredEnv "GIT_USER" }}'
14+
commitusingapi: true
1515
branch: main
1616

1717
actions:
@@ -52,7 +52,7 @@ sources:
5252
owner: golang
5353
repository: go
5454
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
55-
username: '{{ requiredEnv "GIT_USER" }}'
55+
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
5656
versionfilter:
5757
kind: regex
5858
pattern: go1\.{{ source "minor" }}\.(\d*)$
@@ -124,12 +124,21 @@ targets:
124124
- Dockerfile
125125
- Dockerfile.skaffold
126126
matchpattern: 'ARG GO_VERSION=\d+.\d+.\d+'
127-
update-gomod:
128-
name: "Update go.mod"
127+
update-gomod-minor-version:
128+
name: "Update go.mod minor version"
129129
sourceid: gomod
130130
scmid: githubConfig
131131
kind: file
132132
spec:
133133
content: 'go {{ source "gomod" }}'
134134
file: go.mod
135135
matchpattern: 'go \d+.\d+'
136+
update-gomod-toolchain-version:
137+
name: "Update go.mod toolchain version"
138+
sourceid: latestGoVersion
139+
scmid: githubConfig
140+
kind: file
141+
spec:
142+
content: 'toolchain go{{ source "latestGoVersion" }}'
143+
file: go.mod
144+
matchpattern: 'toolchain go\d+.\d+.\d+'

.ci/updatecli/values.d/ironbank.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
config:
2+
- path: dev-tools/packaging/templates/ironbank
3+
dockerfile: Dockerfile.tmpl
4+
manifest: hardening_manifest.yaml.tmpl

.ci/updatecli/values.d/scm.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
scm:
2+
enabled: true
3+
owner: elastic
4+
repository: elastic-agent
5+
branch: main
6+
commitusingapi: true
7+
# begin updatecli-compose policy values
8+
user: 'github-actions[bot]'
9+
email: '41898282+github-actions[bot]@users.noreply.github.com'
10+
# end updatecli-compose policy values
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
spec:
2+
files:
3+
- "updatecli-compose.yaml"

.github/workflows/bump-agent-versions.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: ./.github/workflows/bump-agent-versions.sh
4545

4646
- if: ${{ failure() }}
47-
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
47+
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
4848
with:
4949
channel-id: '#ingest-notifications'
5050
payload: |
@@ -66,7 +66,7 @@ jobs:
6666

6767
# if a PR was created as a result of this job, we notify on the Slack channel
6868
- if: ${{ startsWith(steps.update.outputs.pr, 'https') }}
69-
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
69+
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
7070
with:
7171
channel-id: '#ingest-notifications'
7272
payload: |

.github/workflows/bump-golang.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,15 @@ jobs:
2222
- uses: actions/checkout@v4
2323

2424
- name: Install Updatecli in the runner
25-
uses: updatecli/updatecli-action@d0950ebbe80f4f80c3392b288d6a218fae872f69 # v0.76.1
25+
uses: updatecli/updatecli-action@6b8881a17fc8038e884ec94ff72a49e8e8a4069f # v0.76.1
2626

2727
- name: Run Updatecli in Apply mode
28-
run: updatecli apply --config .github/updatecli-bump-golang.yml
28+
run: updatecli apply --config .ci/updatecli/updatecli-bump-golang.yml --values .ci/updatecli/values.d/scm.yml
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
GIT_USER: "github-actions[bot]"
32-
GIT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
3331

3432
- if: ${{ failure() }}
35-
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
33+
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
3634
with:
3735
channel-id: '#ingest-notifications'
3836
payload: |

0 commit comments

Comments
 (0)