Skip to content

Commit 333e7c9

Browse files
authored
Merge branch 'main' into dependabot/go_modules/github.com/elastic/gosigar-0.14.3
2 parents 3d69369 + f3b4eec commit 333e7c9

File tree

232 files changed

+12756
-4160
lines changed

Some content is hidden

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

232 files changed

+12756
-4160
lines changed

.agent-versions.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"testVersions": [
3-
"8.14.0-SNAPSHOT",
4-
"8.13.0-SNAPSHOT",
3+
"8.13.3-SNAPSHOT",
4+
"8.13.2",
55
"8.12.2",
6-
"7.17.18"
6+
"7.17.21-SNAPSHOT",
7+
"7.17.20"
78
]
89
}

.buildkite/hooks/pre-exit

+2-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent" && "$BUILDKITE_STEP_KEY" ==
1010

1111
# Perform cleanup of integration tests resources
1212
echo "--- Cleaning up integration test resources"
13-
if [[ "$BUILDKITE_STEP_KEY" == "serverless-integration-tests" ]]; then
14-
STACK_PROVISIONER=serverless SNAPSHOT=true mage integration:clean
15-
else
16-
SNAPSHOT=true mage integration:clean
17-
fi
13+
STACK_PROVISIONER=serverless SNAPSHOT=true mage integration:clean
14+
SNAPSHOT=true mage integration:clean
1815
fi
1916

2017
if [ -n "$GOOGLE_APPLICATION_CREDENTIALS" ]; then

.buildkite/misc/gce-cleanup.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ scanners:
1818
filters:
1919
- type: "<"
2020
pointer: "/extra/creationTimestamp"
21-
param: "${CREATION_DATE}"
21+
param: "${DELETE_CREATED_AFTER_DATE}"
2222
converters:
2323
param: "date"
2424
value: "date"

.buildkite/pipeline.elastic-agent-package.yml

+14-12
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ env:
1010

1111
steps:
1212
- input: "Build parameters"
13-
if: build.env("ManifestURL") == null
13+
if: build.env("MANIFEST_URL") == null
1414
fields:
15-
- text: "ManifestURL"
16-
key: "ManifestURL"
15+
- text: "MANIFEST_URL"
16+
key: "MANIFEST_URL"
1717
default: ""
1818
required: true
1919
hint: "Link to the build manifest URL."
@@ -51,7 +51,7 @@ steps:
5151
hint: "If the DRA release manager script would actually publish anything or just print"
5252

5353
- wait: ~
54-
if: build.env("ManifestURL") == null
54+
if: build.env("MANIFEST_URL") == null
5555

5656
- group: ":Packaging Artefacts"
5757
key: "package"
@@ -63,10 +63,10 @@ steps:
6363
machineType: "c2-standard-16"
6464
diskSizeGb: 400
6565
command: |
66-
if [[ -z "${ManifestURL}" ]]; then
67-
export ManifestURL=$(buildkite-agent meta-data get ManifestURL --default "")
68-
if [[ -z "${ManifestURL}" ]]; then
69-
echo ":broken_heart: Missing ManifestURL variable or empty string provided"
66+
if [[ -z "${MANIFEST_URL}" ]]; then
67+
export MANIFEST_URL=$(buildkite-agent meta-data get MANIFEST_URL --default "")
68+
if [[ -z "${MANIFEST_URL}" ]]; then
69+
echo ":broken_heart: Missing MANIFEST_URL variable or empty string provided"
7070
exit 1
7171
fi
7272
fi
@@ -86,10 +86,10 @@ steps:
8686
PLATFORMS: "linux/arm64"
8787
PACKAGES: "docker"
8888
command: |
89-
if [[ -z "${ManifestURL}" ]]; then
90-
export ManifestURL=$(buildkite-agent meta-data get ManifestURL --default "")
91-
if [[ -z "${ManifestURL}" ]]; then
92-
echo ":broken_heart: Missing ManifestURL variable or empty string provided"
89+
if [[ -z "${MANIFEST_URL}" ]]; then
90+
export MANIFEST_URL=$(buildkite-agent meta-data get MANIFEST_URL --default "")
91+
if [[ -z "${MANIFEST_URL}" ]]; then
92+
echo ":broken_heart: Missing MANIFEST_URL variable or empty string provided"
9393
exit 1
9494
fi
9595
fi
@@ -134,6 +134,8 @@ steps:
134134
depends_on: package
135135
agents:
136136
provider: "gcp"
137+
machineType: "n2-standard-8"
138+
diskSizeGb: 250
137139
env:
138140
DRA_PROJECT_ID: "elastic-agent-package"
139141
DRA_PROJECT_ARTIFACT_ID: "agent-package"

.buildkite/pipeline.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ steps:
231231
- "build/diagnostics/*"
232232
agents:
233233
provider: "gcp"
234-
machineType: "n1-standard-8"
234+
machineType: "n1-standard-8"
235235

236236
- label: "Integration tests"
237237
key: "integration-tests"
@@ -246,7 +246,7 @@ steps:
246246
- label: "Serverless Beats Tests"
247247
key: "serverless-beats-integration-tests"
248248
command: ".buildkite/scripts/steps/beats_tests.sh"
249-
if: "build.env('CRON') == 'yes'"
249+
# if: "build.env('CRON') == 'yes'"
250250
agents:
251251
provider: "gcp"
252252
machineType: "n1-standard-8"

.buildkite/scripts/steps/gce-cleanup.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ set -euo pipefail
55
export ACCOUNT_KEY_SECRET=$(vault kv get -field=client_email $VAULT_PATH)
66
export ACCOUNT_SECRET=$(vault kv get -field=private_key $VAULT_PATH)
77
export ACCOUNT_PROJECT_SECRET=$(vault kv get -field=project_id $VAULT_PATH)
8-
export CREATION_DATE=$(date -Is -d "24 hours ago")
8+
export DELETE_CREATED_AFTER_DATE=$(date -Is -d "5 hours ago")
99

1010
docker run -v $(pwd)/.buildkite/misc/gce-cleanup.yml:/etc/cloud-reaper/config.yml \
1111
-e ACCOUNT_SECRET="$ACCOUNT_SECRET" \
1212
-e ACCOUNT_KEY="$ACCOUNT_KEY_SECRET" \
1313
-e ACCOUNT_PROJECT=$ACCOUNT_PROJECT_SECRET \
14-
-e CREATION_DATE=$CREATION_DATE \
14+
-e DELETE_CREATED_AFTER_DATE=$DELETE_CREATED_AFTER_DATE \
1515
${DOCKER_REGISTRY}/observability-ci/cloud-reaper:0.3.0 cloud-reaper --config /etc/cloud-reaper/config.yml destroy --confirm

.buildkite/scripts/steps/integration_tests.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ MAGE_SUBTARGET="${3:-""}"
1111
# Override the agent package version using a string with format <major>.<minor>.<patch>
1212
# NOTE: use only after version bump when the new version is not yet available, for example:
1313
# OVERRIDE_AGENT_PACKAGE_VERSION="8.10.3" otherwise OVERRIDE_AGENT_PACKAGE_VERSION="".
14-
OVERRIDE_AGENT_PACKAGE_VERSION=""
14+
OVERRIDE_AGENT_PACKAGE_VERSION="8.14.0"
1515

1616
if [[ -n "$OVERRIDE_AGENT_PACKAGE_VERSION" ]]; then
1717
OVERRIDE_TEST_AGENT_VERSION=${OVERRIDE_AGENT_PACKAGE_VERSION}"-SNAPSHOT"
1818
else
1919
OVERRIDE_TEST_AGENT_VERSION=""
2020
fi
2121
# PACKAGE
22-
AGENT_PACKAGE_VERSION="${OVERRIDE_AGENT_PACKAGE_VERSION}" DEV=true EXTERNAL=true SNAPSHOT=true PLATFORMS=linux/amd64,linux/arm64,windows/amd64 PACKAGES=tar.gz,zip mage package
22+
AGENT_PACKAGE_VERSION="${OVERRIDE_AGENT_PACKAGE_VERSION}" DEV=true EXTERNAL=true SNAPSHOT=true PLATFORMS=linux/amd64,linux/arm64,windows/amd64 PACKAGES=tar.gz,zip,rpm,deb mage package
2323

2424
# Run integration tests
2525
set +e

.buildkite/scripts/steps/package.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ set -euo pipefail
55
_SELF=$(dirname $0)
66
source "${_SELF}/../common.sh"
77

8-
if test -z "${ManifestURL=:""}"; then
9-
echo "Missing variable ManifestURL, export it before use."
8+
if test -z "${MANIFEST_URL=:""}"; then
9+
echo "Missing variable MANIFEST_URL, export it before use."
1010
exit 2
1111
fi
1212

1313
export AGENT_DROP_PATH=build/elastic-agent-drop
1414
mkdir -p $AGENT_DROP_PATH
1515

16-
# Download the components from the ManifestURL and then package those downloaded into the $AGENT_DROP_PATH
17-
mage clean downloadManifest package ironbank fixDRADockerArtifacts
16+
# Download the components from the MANIFEST_URL and then package those downloaded into the $AGENT_DROP_PATH
17+
mage clean downloadManifest packageUsingDRA ironbank fixDRADockerArtifacts
1818

1919
echo "+++ Generate dependencies report"
20-
BEAT_VERSION_FULL=$(curl -s -XGET "${ManifestURL}" |jq '.version' -r )
20+
BEAT_VERSION_FULL=$(curl -s -XGET "${MANIFEST_URL}" |jq '.version' -r )
2121
bash "${_SELF}/../../../dev-tools/dependencies-report"
2222
mkdir -p build/distributions/reports
2323
mv dependencies.csv "build/distributions/reports/dependencies-${BEAT_VERSION_FULL}.csv"

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ export PATH=$HOME/bin:${PATH}
66
source .buildkite/scripts/install-gh.sh
77
source .buildkite/scripts/common.sh
88

9-
export GITHUB_TOKEN=$(retry 5 vault kv get -field token kv/ci-shared/platform-ingest/github_token)
9+
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
1017

1118
cd deploy/kubernetes
1219

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
set -e
3+
4+
version_requirements=$(mage integration:updateVersions)
5+
changes=$(git status -s -uno .agent-versions.json)
6+
if [ -z "$changes" ]
7+
then
8+
echo "The versions file didn't change, skipping..."
9+
else
10+
echo "The versions file changed"
11+
open=$(gh pr list --repo "$GITHUB_REPOSITORY" --label="update-versions" --limit 1 --state open --base "$GITHUB_REF_NAME")
12+
if [ -n "$open" ]
13+
then
14+
echo "Another PR for $GITHUB_REF_NAME is in review, skipping..."
15+
exit 0
16+
fi
17+
git diff -p
18+
git add ".agent-versions.json"
19+
20+
nl=$'\n' # otherwise the new line character is not recognized properly
21+
commit_desc="This file is used for picking agent versions in integration tests.${nl}${nl}The file's content is based on responses from https://www.elastic.co/api/product_versions and https://snapshots.elastic.co${nl}${nl}The current update is generated based on the following requirements:${nl}${nl}\`\`\`json${nl}${version_requirements}${nl}\`\`\`"
22+
23+
git commit -m "[$GITHUB_REF_NAME][Automation] Update .agent-versions.json" -m "$commit_desc"
24+
git push --set-upstream origin "update-agent-versions-$GITHUB_RUN_ID"
25+
pr=$(gh pr create \
26+
--base "$GITHUB_REF_NAME" \
27+
--fill-first \
28+
--head "update-agent-versions-$GITHUB_RUN_ID" \
29+
--label 'Team:Elastic-Agent' \
30+
--label 'update-versions' \
31+
--label 'skip-changelog' \
32+
--label 'backport-skip' \
33+
--repo $GITHUB_REPOSITORY)
34+
echo "pr=$pr" >> "$GITHUB_OUTPUT" # set the step output for Slack notifications
35+
echo "Created a PR with the file update: $pr"
36+
fi

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

+38-33
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,21 @@ jobs:
99
update_versions:
1010
runs-on: ubuntu-latest
1111
steps:
12+
- name: Setup Git
13+
uses: elastic/apm-pipeline-library/.github/actions/setup-git@current
14+
15+
- uses: elastic/apm-pipeline-library/.github/actions/github-token@current
16+
with:
17+
url: ${{ secrets.VAULT_ADDR }}
18+
roleId: ${{ secrets.VAULT_ROLE_ID }}
19+
secretId: ${{ secrets.VAULT_SECRET_ID }}
20+
1221
- name: Checkout
1322
uses: actions/checkout@v4
23+
with:
24+
# no depth limit
25+
# so, we can generate snapshot versions based on release branches
26+
fetch-depth: 0
1427

1528
- name: Set up Go
1629
uses: actions/setup-go@v4
@@ -20,41 +33,33 @@ jobs:
2033
- name: Set up branch
2134
run: git checkout -b update-agent-versions-$GITHUB_RUN_ID
2235

23-
- name: Update the agent version file
36+
- name: Install mage
2437
uses: magefile/mage-action@v3
2538
with:
2639
version: v1.13.0
27-
args: integration:updateVersions
40+
install-only: true
2841

29-
- name: Check for file changes
42+
- name: Update versions file
43+
id: update
3044
env:
31-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
run: |
33-
changes=$(git status -s -uno .agent-versions.json)
34-
if [ -z "$changes" ]
35-
then
36-
echo "The versions file didn't change, skipping..."
37-
else
38-
echo "The versions file changed"
39-
open=$(gh pr list --repo "$GITHUB_REPOSITORY" --label="update-versions" --limit 1 --state open --base "$GITHUB_REF_NAME")
40-
if [ -n "$open" ]
41-
then
42-
echo "Another PR for $GITHUB_REF_NAME is in review, skipping..."
43-
exit 0
44-
fi
45-
git diff -p
46-
git config --global user.name 'apmmachine'
47-
git config --global user.email 'apmmachine@users.noreply.github.com'
48-
git add ".agent-versions.json"
49-
git commit -m "[$GITHUB_REF_NAME](automation) Update .agent-versions.json" -m "This file is used for picking agent versions in integration tests. It's content is based on the reponse from https://artifacts-api.elastic.co/v1/versions/"
50-
git push --set-upstream origin "update-agent-versions-$GITHUB_RUN_ID"
51-
gh pr create \
52-
--base "$GITHUB_REF_NAME" \
53-
--fill-first \
54-
--head "update-agent-versions-$GITHUB_RUN_ID" \
55-
--label 'Team:Elastic-Agent' \
56-
--label 'update-versions' \
57-
--label 'skip-changelog' \
58-
--label 'backport-skip' \
59-
--repo $GITHUB_REPOSITORY
60-
fi
45+
GH_TOKEN: ${{ env.GITHUB_TOKEN }}
46+
run: ./.github/workflows/bump-agent-versions.sh
47+
48+
- if: ${{ failure() }}
49+
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
50+
with:
51+
url: ${{ secrets.VAULT_ADDR }}
52+
roleId: ${{ secrets.VAULT_ROLE_ID }}
53+
secretId: ${{ secrets.VAULT_SECRET_ID }}
54+
message: ":traffic_cone: Elastic Agent versions file update failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
55+
channel: "#ingest-notifications"
56+
57+
# if a PR was created as a result of this job, we notify on the Slack channel
58+
- if: ${{ startsWith(steps.update.outputs.pr, 'https') }}
59+
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
60+
with:
61+
url: ${{ secrets.VAULT_ADDR }}
62+
roleId: ${{ secrets.VAULT_ROLE_ID }}
63+
secretId: ${{ secrets.VAULT_SECRET_ID }}
64+
message: "Update for Elastic Agent versions file has been created: ${{ steps.update.outputs.pr }}"
65+
channel: "#ingest-notifications"

.go-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.21.8
1+
1.21.9

.golangci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ linters-settings:
116116

117117
gosimple:
118118
# Select the Go version to target. The default is '1.13'.
119-
go: "1.21.8"
119+
go: "1.21.9"
120120

121121
nakedret:
122122
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
@@ -136,17 +136,17 @@ linters-settings:
136136

137137
staticcheck:
138138
# Select the Go version to target. The default is '1.13'.
139-
go: "1.21.8"
139+
go: "1.21.9"
140140
checks: ["all"]
141141

142142
stylecheck:
143143
# Select the Go version to target. The default is '1.13'.
144-
go: "1.21.8"
144+
go: "1.21.9"
145145
checks: ["all"]
146146

147147
unused:
148148
# Select the Go version to target. The default is '1.13'.
149-
go: "1.21.8"
149+
go: "1.21.9"
150150

151151
gosec:
152152
excludes:

.mergify.yml

+13
Original file line numberDiff line numberDiff line change
@@ -306,3 +306,16 @@ pull_request_rules:
306306
labels:
307307
- "backport"
308308
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
309+
- name: backport patches to 8.14 branch
310+
conditions:
311+
- merged
312+
- label=backport-v8.14.0
313+
actions:
314+
backport:
315+
assignees:
316+
- "{{ author }}"
317+
branches:
318+
- "8.14"
319+
labels:
320+
- "backport"
321+
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GO_VERSION=1.21.8
1+
ARG GO_VERSION=1.21.9
22
FROM circleci/golang:${GO_VERSION}
33

44

Dockerfile.skaffold

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GO_VERSION=1.21.8
1+
ARG GO_VERSION=1.21.9
22
ARG crossbuild_image="docker.elastic.co/beats-dev/golang-crossbuild"
33
ARG AGENT_VERSION=8.9.0-SNAPSHOT
44
ARG AGENT_IMAGE="docker.elastic.co/beats/elastic-agent"

0 commit comments

Comments
 (0)