Skip to content

Commit 1ef7dea

Browse files
Merge pull request #844 from nr-swilloughby/release_3_29_1
Release 3.29.1
2 parents 20541a9 + 555b143 commit 1ef7dea

File tree

62 files changed

+260
-448
lines changed

Some content is hidden

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

62 files changed

+260
-448
lines changed

.github/workflows/ci.yaml

+112-197
Original file line numberDiff line numberDiff line change
@@ -1,225 +1,140 @@
1-
# Copyright 2020 New Relic Corporation. All rights reserved.
1+
# Copyright 2023 New Relic Corporation. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
3-
43
name: Go Agent CI
5-
64
on: pull_request
5+
env:
6+
# Specifies which go version to run integration tests on
7+
INTEGRATION_TESTS_GO_VERSION: 1.21.5
78

89
jobs:
910
go-agent-v3:
1011
runs-on: ubuntu-latest
11-
env:
12-
# Required when using older versions of Go that do not support gomod.
13-
GOPATH: ${{ github.workspace }}
14-
1512
strategy:
1613
# if one test fails, do not abort the rest
1714
fail-fast: false
1815
matrix:
1916
include:
20-
- go-version: 1.19.x
17+
# Core Tests on 3 most recent major Go versions
18+
- go-version: 1.19.0
2119
dirs: v3/newrelic,v3/internal,v3/examples
22-
- go-version: 1.20.x
20+
- go-version: 1.20.0
2321
dirs: v3/newrelic,v3/internal,v3/examples
24-
- go-version: 1.21.x
22+
- go-version: 1.21.0
2523
dirs: v3/newrelic,v3/internal,v3/examples
2624

27-
# v3 integrations
28-
- go-version: 1.19.x
29-
dirs: v3/integrations/nramqp
30-
- go-version: 1.19.x
31-
dirs: v3/integrations/nrfasthttp
32-
- go-version: 1.19.x
33-
dirs: v3/integrations/nrsarama
34-
- go-version: 1.19.x
35-
dirs: v3/integrations/logcontext/nrlogrusplugin
36-
# extratesting: go get -u github.com/sirupsen/logrus@master
37-
- go-version: 1.19.x
38-
dirs: v3/integrations/logcontext-v2/nrlogrus
39-
# extratesting: go get -u github.com/sirupsen/logrus@master
40-
- go-version: 1.19.x
41-
dirs: v3/integrations/logcontext-v2/nrzerolog
42-
extratesting: go get -u github.com/rs/zerolog@master
43-
- go-version: 1.19.x
44-
dirs: v3/integrations/logcontext-v2/nrzap
45-
- go-version: 1.19.x
46-
dirs: v3/integrations/logcontext-v2/nrwriter
47-
- go-version: 1.19.x
48-
dirs: v3/integrations/logcontext-v2/zerologWriter
49-
extratesting: go get -u github.com/rs/zerolog@master
50-
- go-version: 1.19.x
51-
dirs: v3/integrations/logcontext-v2/logWriter
52-
- go-version: 1.19.x
53-
dirs: v3/integrations/nrawssdk-v1
54-
extratesting: go get -u github.com/aws/aws-sdk-go@main
55-
- go-version: 1.19.x
56-
dirs: v3/integrations/nrawssdk-v2
57-
extratesting: go get -u github.com/aws/aws-sdk-go-v2@main
58-
- go-version: 1.19.x
59-
dirs: v3/integrations/nrecho-v3
60-
# Test against the latest v3 Echo:
61-
extratesting: go get -u github.com/labstack/echo@v3
62-
# go/new/http no longer stable under go 1.18.x
63-
- go-version: 1.19.x
64-
dirs: v3/integrations/nrecho-v4
65-
extratesting: go get -u github.com/labstack/echo/v4@master
66-
- go-version: 1.19.x
67-
dirs: v3/integrations/nrelasticsearch-v7
68-
extratesting: go get -u github.com/elastic/go-elasticsearch/[email protected]
69-
- go-version: 1.19.x
70-
dirs: v3/integrations/nrgin
71-
extratesting: go get -u github.com/gin-gonic/gin@master
72-
- go-version: 1.19.x
73-
dirs: v3/integrations/nrgorilla
74-
extratesting: go get -u github.com/gorilla/mux@master
75-
- go-version: 1.19.x
76-
dirs: v3/integrations/nrgraphgophers
77-
- go-version: 1.19.x
78-
dirs: v3/integrations/nrlogrus
79-
- go-version: 1.19.x
80-
dirs: v3/integrations/nrlogxi
81-
extratesting: go get -u github.com/mgutz/logxi@master
82-
- go-version: 1.19.x
83-
dirs: v3/integrations/nrpkgerrors
84-
extratesting: go get -u github.com/pkg/errors@master
85-
- go-version: 1.19.x
86-
dirs: v3/integrations/nrlambda
87-
extratesting: go get -u github.com/aws/aws-lambda-go@master
88-
- go-version: 1.19.x
89-
dirs: v3/integrations/nrmysql
90-
extratesting: go get -u github.com/go-sql-driver/mysql@master
91-
- go-version: 1.19.x
92-
dirs: v3/integrations/nrpq
93-
extratesting: go get -u github.com/lib/pq@master
94-
- go-version: 1.19.x
95-
dirs: v3/integrations/nrpgx5
96-
- go-version: 1.19.x
97-
dirs: v3/integrations/nrpq/example/sqlx
98-
- go-version: 1.19.x
99-
dirs: v3/integrations/nrredis-v7
100-
extratesting: go get -u github.com/go-redis/redis/v7@master
101-
- go-version: 1.19.x
102-
dirs: v3/integrations/nrredis-v9
103-
extratesting: go get -u github.com/redis/go-redis/v9@master
104-
- go-version: 1.19.x
105-
dirs: v3/integrations/nrsqlite3
106-
extratesting: go get -u github.com/mattn/go-sqlite3@master
107-
- go-version: 1.19.x
108-
dirs: v3/integrations/nrsnowflake
109-
- go-version: 1.19.x
110-
dirs: v3/integrations/nrgrpc
111-
extratesting: go get -u google.golang.org/grpc@master
112-
- go-version: 1.19.x
113-
dirs: v3/integrations/nrmicro
114-
# As of Dec 2019, there is a race condition in when using go-micro@master
115-
# in their logging system. Instead, we'll test against the latest
116-
# released version.
117-
# As of Jan 2019, it is impossible to go get the latest micro version.
118-
# As of June 2020, confirmed errors still result
119-
# extratesting: go get -u github.com/micro/go-micro@latest
120-
# If we are using the latest released version to test, we need to use a newer version of go
121-
- go-version: 1.19.x
122-
dirs: v3/integrations/nrnats
123-
extratesting: go get -u github.com/nats-io/nats.go
124-
goproxy: direct
125-
- go-version: 1.19.x
126-
dirs: v3/integrations/nrstan
127-
extratesting: go get -u github.com/nats-io/stan.go/@master
128-
- go-version: 1.19.x
129-
dirs: v3/integrations/nrstan/test
130-
- go-version: 1.19.x
131-
dirs: v3/integrations/nrstan/examples
132-
- go-version: 1.19.x
133-
dirs: v3/integrations/logcontext
134-
extratesting: go get -u github.com/sirupsen/logrus@master
135-
# nrzap only supports the two most recent minor go releases
136-
- go-version: 1.19.x
137-
dirs: v3/integrations/nrzap
138-
- go-version: 1.19.x
139-
dirs: v3/integrations/nrhttprouter
140-
extratesting: go get -u github.com/julienschmidt/httprouter@master
141-
- go-version: 1.19.x
142-
dirs: v3/integrations/nrb3
143-
- go-version: 1.19.x
144-
dirs: v3/integrations/nrmongo
145-
- go-version: 1.19.x
146-
dirs: v3/integrations/nrgraphqlgo,v3/integrations/nrgraphqlgo/example
147-
extratesting: go get -u github.com/graphql-go/graphql@master
148-
- go-version: 1.19.x
149-
dirs: v3/integrations/nrmssql
150-
extratesting: go get -u github.com/microsoft/go-mssqldb@main
151-
25+
# Integration Tests on highest Supported Go Version
26+
- dirs: v3/integrations/nramqp
27+
- dirs: v3/integrations/nrfasthttp
28+
- dirs: v3/integrations/nrsarama
29+
- dirs: v3/integrations/logcontext/nrlogrusplugin
30+
- dirs: v3/integrations/logcontext-v2/nrlogrus
31+
- dirs: v3/integrations/logcontext-v2/nrzerolog
32+
- dirs: v3/integrations/logcontext-v2/nrzap
33+
- dirs: v3/integrations/logcontext-v2/nrwriter
34+
- dirs: v3/integrations/logcontext-v2/zerologWriter
35+
- dirs: v3/integrations/logcontext-v2/logWriter
36+
- dirs: v3/integrations/nrawssdk-v1
37+
- dirs: v3/integrations/nrawssdk-v2
38+
- dirs: v3/integrations/nrecho-v3
39+
- dirs: v3/integrations/nrecho-v4
40+
- dirs: v3/integrations/nrelasticsearch-v7
41+
- dirs: v3/integrations/nrgin
42+
- dirs: v3/integrations/nrgorilla
43+
- dirs: v3/integrations/nrgraphgophers
44+
- dirs: v3/integrations/nrlogrus
45+
- dirs: v3/integrations/nrlogxi
46+
- dirs: v3/integrations/nrpkgerrors
47+
- dirs: v3/integrations/nrlambda
48+
- dirs: v3/integrations/nrmysql
49+
- dirs: v3/integrations/nrpq
50+
- dirs: v3/integrations/nrpgx5
51+
- dirs: v3/integrations/nrpq/example/sqlx
52+
- dirs: v3/integrations/nrredis-v7
53+
- dirs: v3/integrations/nrredis-v9
54+
- dirs: v3/integrations/nrsqlite3
55+
- dirs: v3/integrations/nrsnowflake
56+
- dirs: v3/integrations/nrgrpc
57+
- dirs: v3/integrations/nrmicro
58+
- dirs: v3/integrations/nrnats
59+
- dirs: v3/integrations/nrstan
60+
- dirs: v3/integrations/nrstan/test
61+
- dirs: v3/integrations/nrstan/examples
62+
- dirs: v3/integrations/logcontext
63+
- dirs: v3/integrations/nrzap
64+
- dirs: v3/integrations/nrhttprouter
65+
- dirs: v3/integrations/nrb3
66+
- dirs: v3/integrations/nrmongo
67+
- dirs: v3/integrations/nrgraphqlgo,v3/integrations/nrgraphqlgo/example
68+
- dirs: v3/integrations/nrmssql
15269
steps:
153-
- name: Install Go
154-
uses: actions/setup-go@v4
155-
with:
156-
go-version: ${{ matrix.go-version }}
157-
15870
- name: Checkout Code
159-
uses: actions/checkout@v1
71+
uses: actions/checkout@v2
16072
with:
161-
# Required when using older versions of Go that do not support gomod.
162-
# Note the required presence of the /go-agent/ directory at the
163-
# beginning of this path. It is required in order to match the
164-
# ${{ github.workspace }} used by the GOPATH env var. pwd when cloning
165-
# the repo is <something>/go-agent/ whereas ${{ github.workspace }}
166-
# returns <something/go-agent/go-agent/.
167-
path: ./go-agent/src/github.com/newrelic/go-agent
73+
path: "go-agent"
74+
75+
76+
- name: Build Docker Image
77+
run: docker build -f ${{ github.workspace }}/go-agent/Dockerfile ${{ github.workspace }} --build-arg GO_VERSION=${{ matrix.go-version || env.INTEGRATION_TESTS_GO_VERSION }} -t go-agent-tests-amd64
16878

169-
- name: Run Tests
170-
run: bash v3/build-script.sh
171-
env:
172-
DIRS: ${{ matrix.dirs }}
173-
EXTRATESTING: ${{ matrix.extratesting }}
174-
PIN: ${{ matrix.pin }}
175-
GOPROXY: ${{ matrix.goproxy }}
176-
- name: Upload coverage to Codecov
177-
uses: codecov/codecov-action@v3
79+
- name: Set up Docker container and run tests
80+
run: |
81+
IFS=',' read -ra DIRS <<< "${{ matrix.dirs }}"
82+
for dir in "${DIRS[@]}"; do
83+
if [ -d "go-agent/$dir" ]; then
84+
# Create Coverage Report Directory for CodeCov
85+
coverage_dir="${{ github.workspace }}/coverage-reports"
86+
mkdir -p "$coverage_dir"
87+
# Special case for nrnats, which requires direct module proxying
88+
if [[ "$dir" == *"nrnats"* ]]; then
89+
docker run -e GOPROXY=direct -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e GITHUB_HEAD_REF=${GITHUB_HEAD_REF} -v "$coverage_dir:/coverage" go-agent-tests-amd64 ./go-agent/run-tests.sh "$dir" "/coverage"
90+
else
91+
docker run -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e GITHUB_HEAD_REF=${GITHUB_HEAD_REF} -v "$coverage_dir:/coverage" go-agent-tests-amd64 ./go-agent/run-tests.sh "$dir" "/coverage"
92+
fi
93+
else
94+
echo "Directory /app/$dir does not exist."
95+
fi
96+
done
17897
179-
go-agent-arm64:
180-
# Run all unit tests on aarch64 emulator to ensure compatibility with AWS
181-
# Graviton instances
98+
# Arm64 tests
99+
go-agent-v3-arm64:
182100
runs-on: ubuntu-latest
183101
strategy:
184-
# if one test fails, do not abort the rest
102+
# if one test fails, do not abort the rest
185103
fail-fast: false
186104
matrix:
187105
include:
188-
- go-version: 1.19.x
106+
# Core Tests on 3 most recent major Go versions
107+
- go-version: 1.19.0
108+
dirs: v3/newrelic,v3/internal,v3/examples
109+
- go-version: 1.20.0
110+
dirs: v3/newrelic,v3/internal,v3/examples
111+
- go-version: 1.21.0
112+
dirs: v3/newrelic,v3/internal,v3/examples
189113
steps:
190-
- uses: actions/checkout@v1
191-
with:
192-
# Required when using older versions of Go that do not support gomod.
193-
# Note the required presence of the /go-agent/ directory at the
194-
# beginning of this path. It is required in order to match the
195-
# ${{ github.workspace }} used by the GOPATH env var. pwd when cloning
196-
# the repo is <something>/go-agent/ whereas ${{ github.workspace }}
197-
# returns <something/go-agent/go-agent/.
198-
path: ./go-agent/src/github.com/newrelic/go-agent
199-
- uses: uraimo/[email protected]
200-
name: Run Tests
201-
id: runcmd
114+
- name: Checkout Code
115+
uses: actions/checkout@v2
202116
with:
203-
arch: aarch64
204-
distro: ubuntu20.04
205-
githubToken: ${{ github.token }}
206-
install: |
207-
DEBIAN_FRONTEND=noninteractive apt-get -qq update
208-
DEBIAN_FRONTEND=noninteractive apt-get -qq install -y wget build-essential
209-
wget -nv https://go.dev/dl/go${{ matrix.go-version }}.linux-arm64.tar.gz
210-
rm -rf /usr/local/go
211-
tar -C /usr/local -xzf go${{ matrix.go-version }}.linux-arm64.tar.gz
212-
run: |
213-
export PATH=$PATH:/usr/local/go/bin
214-
go version
215-
cd v3/newrelic
216-
go mod download github.com/golang/protobuf
217-
go get -t
218-
echo ==== v3/newrelic tests ====
219-
go test ./...
220-
cd ../internal
221-
echo ==== v3/internal tests ====
222-
go test ./...
223-
cd ../examples
224-
echo ==== v3/examples tests ====
225-
go test ./...
117+
path: "go-agent"
118+
119+
- name: Set up QEMU
120+
uses: docker/setup-qemu-action@v1
121+
122+
- name: Set up Docker Buildx
123+
uses: docker/setup-buildx-action@v1
124+
125+
- name: Build Docker Image
126+
run: |
127+
docker buildx create --use
128+
docker buildx build --platform linux/arm64 -f ${{ github.workspace }}/go-agent/Dockerfile ${{ github.workspace }} --build-arg GO_VERSION=${{ matrix.go-version || env.INTEGRATION_TESTS_GO_VERSION }} -t go-agent-tests-arm64 --load
129+
- name: Run Tests in Docker
130+
run: |
131+
IFS=',' read -ra DIRS <<< "${{ matrix.dirs }}"
132+
for dir in "${DIRS[@]}"; do
133+
if [ -d "go-agent/$dir" ]; then
134+
coverage_dir="${{ github.workspace }}/coverage-reports"
135+
mkdir -p "$coverage_dir"
136+
docker run -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e GITHUB_HEAD_REF=${GITHUB_HEAD_REF} -v "$coverage_dir:/coverage" go-agent-tests-arm64 ./go-agent/run-tests.sh "$dir" "/coverage"
137+
else
138+
echo "Directory /app/$dir does not exist."
139+
fi
140+
done

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 3.29.1
2+
### Added
3+
* Added Dockerized Unit Tests for Github Actions (internal build support)
4+
5+
### Fixes
6+
* Updated version of New Relic Security Agent (enables bug fixes released in that agent code for use with the Go Agent).
7+
8+
### Support statement
9+
We use the latest version of the Go language. At minimum, you should be using no version of Go older than what is supported by the Go team themselves.
10+
See the [Go agent EOL Policy](/docs/apm/agents/go-agent/get-started/go-agent-eol-policy) for details about supported versions of the Go agent and third-party components.
11+
112
## 3.29.0
213
### Added
314
* Security agent integration `nrsecurityagent` now reports security configuraiton information along with the overall Go Agent configuration values. (Updates `nrsecurityagent` to v1.2.0.)

Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file is used to build the docker image for the Go Agent's GitHub Action tests
2+
# Default go version if no arguments passed in
3+
ARG GO_VERSION=1.19
4+
5+
# Takes in go version
6+
FROM golang:${GO_VERSION} as builder
7+
8+
# Set working directory and run go mod tidy
9+
WORKDIR /app
10+
# Copy source code files
11+
COPY . .

0 commit comments

Comments
 (0)