Skip to content

Commit 7fa0dd4

Browse files
authored
Merge branch 'main' into dependabot/go_modules/github.com/elastic/elastic-agent-libs-0.9.1
2 parents c5d2431 + ab30cd2 commit 7fa0dd4

9 files changed

+71
-43
lines changed
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
git commit -m "[$GITHUB_REF_NAME](automation) Update .agent-versions.json" -m "This file is used for picking agent versions in integration tests.\n\nThe file's content is based on responses from https://www.elastic.co/api/product_versions and https://snapshots.elastic.co\n\nThe current update is generated based on the following requirements:\n\`\`\`json\n$version_requirements\n\`\`\`"
20+
git push --set-upstream origin "update-agent-versions-$GITHUB_RUN_ID"
21+
gh pr create \
22+
--base "$GITHUB_REF_NAME" \
23+
--fill-first \
24+
--head "update-agent-versions-$GITHUB_RUN_ID" \
25+
--label 'Team:Elastic-Agent' \
26+
--label 'update-versions' \
27+
--label 'skip-changelog' \
28+
--label 'backport-skip' \
29+
--repo $GITHUB_REPOSITORY
30+
fi

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

+29-31
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ 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
1423
with:
@@ -32,34 +41,23 @@ jobs:
3241

3342
- name: Update versions file
3443
env:
35-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
run: |
37-
version_requirements=$(mage integration:updateVersions)
38-
changes=$(git status -s -uno .agent-versions.json)
39-
if [ -z "$changes" ]
40-
then
41-
echo "The versions file didn't change, skipping..."
42-
else
43-
echo "The versions file changed"
44-
open=$(gh pr list --repo "$GITHUB_REPOSITORY" --label="update-versions" --limit 1 --state open --base "$GITHUB_REF_NAME")
45-
if [ -n "$open" ]
46-
then
47-
echo "Another PR for $GITHUB_REF_NAME is in review, skipping..."
48-
exit 0
49-
fi
50-
git diff -p
51-
git config --global user.name 'apmmachine'
52-
git config --global user.email 'apmmachine@users.noreply.github.com'
53-
git add ".agent-versions.json"
54-
git commit -m "[$GITHUB_REF_NAME](automation) Update .agent-versions.json" -m "This file is used for picking agent versions in integration tests.\n\nThe file's content is based on responses from https://www.elastic.co/api/product_versions and https://snapshots.elastic.co\n\nThe current update is generated based on the following requirements:\n\`\`\`json\n$version_requirements\n\`\`\`"
55-
git push --set-upstream origin "update-agent-versions-$GITHUB_RUN_ID"
56-
gh pr create \
57-
--base "$GITHUB_REF_NAME" \
58-
--fill-first \
59-
--head "update-agent-versions-$GITHUB_RUN_ID" \
60-
--label 'Team:Elastic-Agent' \
61-
--label 'update-versions' \
62-
--label 'skip-changelog' \
63-
--label 'backport-skip' \
64-
--repo $GITHUB_REPOSITORY
65-
fi
44+
GH_TOKEN: ${{ env.GITHUB_TOKEN }}
45+
run: ./.github/workflows/bump-agent-versions.sh
46+
47+
- if: ${{ failure() }}
48+
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
49+
with:
50+
url: ${{ secrets.VAULT_ADDR }}
51+
roleId: ${{ secrets.VAULT_ROLE_ID }}
52+
secretId: ${{ secrets.VAULT_SECRET_ID }}
53+
message: ":traffic_cone: Elastic Agent versions file update failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
54+
channel: "#ingest-notifications"
55+
56+
- if: ${{ success() }}
57+
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
58+
with:
59+
url: ${{ secrets.VAULT_ADDR }}
60+
roleId: ${{ secrets.VAULT_ROLE_ID }}
61+
secretId: ${{ secrets.VAULT_SECRET_ID }}
62+
message: "Update for Elastic Agent versions file has been created https://github.com/elastic/elastic-agent/pulls?q=is%3Aopen+is%3Apr+label%3Aupdate-versions"
63+
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:

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"

changelog/fragments/1704304944-Upgrade-to-Go-1.21.8.yaml changelog/fragments/1712176768-Upgrade-to-Go-1.21.9.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
kind: security
1212

1313
# Change summary; a 80ish characters long description of the change.
14-
summary: Upgrade to Go 1.21.8
14+
summary: Upgrade to Go 1.21.9.
1515

1616
# Long description; in case the summary is not enough to describe the change
1717
# this field accommodate a description without length limits.
1818
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19-
description: Removes support for Windows 8.1. See https://tip.golang.org/doc/go1.21#windows.
19+
#description:
2020

2121
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
2222
component: "elastic-agent"
@@ -25,7 +25,7 @@ component: "elastic-agent"
2525
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
2626
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
2727
# Please provide it if you are adding a fragment for a different PR.
28-
pr: https://github.com/elastic/elastic-agent/pull/4361
28+
pr: https://github.com/elastic/elastic-agent/pull/4508
2929

3030
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
3131
# If not present is automatically filled by the tooling with the issue linked to the PR number.

pkg/testing/fixture_install.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func (f *Fixture) installNoPkgManager(ctx context.Context, installOpts *InstallO
189189
f.t.Logf("Dumping running processes in %s", filePath)
190190
file, err := os.OpenFile(filePath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0o644)
191191
if err != nil {
192-
f.t.Logf("failed to dump process; failed to create output file %s root: %s", file.Name(), err)
192+
f.t.Logf("failed to dump process; failed to create output file %s root: %s", filePath, err)
193193
return
194194
}
195195
defer func(file *os.File) {

version/docs/version.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FIXME: once elastic.co docs have been switched over to use `main`, remove
44
// the `doc-site-branch` line below as well as any references to it in the code.
55
:doc-site-branch: master
6-
:go-version: 1.21.8
6+
:go-version: 1.21.9
77
:release-state: unreleased
88
:python: 3.7
99
:docker: 1.12

0 commit comments

Comments
 (0)