Skip to content

Commit 05bba84

Browse files
authored
Merge branch 'main' into feat/drop-go-elasticsearch
2 parents f9a673d + 29e77e6 commit 05bba84

File tree

111 files changed

+1709
-4148
lines changed

Some content is hidden

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

111 files changed

+1709
-4148
lines changed

.github/workflows/ci.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,13 @@ jobs:
5454
with:
5555
go-version-file: go.mod
5656
cache: true
57+
- run: go test -v -race ./...
5758
- env:
58-
CGO_ENABLED: "0"
59-
run: go test -v ./...
60-
- env:
61-
CGO_ENABLED: "0"
6259
KIBANA_URL: "https://kibana.test"
6360
KIBANA_APIKEY: "dummy"
6461
# run functionaltests internal tests
6562
# functionaltests themselves are run in the functional-tests pipeline
66-
run: cd ./functionaltests && go test -v ./internal/...
63+
run: cd ./functionaltests && go test -v -race ./internal/...
6764

6865
test-fips:
6966
runs-on: ubuntu-latest
@@ -74,10 +71,9 @@ jobs:
7471
go-version-file: go.mod
7572
cache: true
7673
- env:
77-
CGO_ENABLED: "0"
7874
GOFIPS140: "latest"
7975
GODEBUG: "fips140=only"
80-
run: go test -v -tags=requirefips ./...
76+
run: go test -v -race -tags=requirefips ./...
8177

8278
system-test:
8379
runs-on: ubuntu-latest
@@ -92,7 +88,7 @@ jobs:
9288
systemtest/go.sum
9389
- run: docker compose up -d
9490
- env:
95-
GOTESTFLAGS: "-v -json"
91+
GOTESTFLAGS: "-v"
9692
GH_TOKEN: ${{ github.token }}
9793
run: make system-test
9894

.github/workflows/comment-on-asciidoc-changes.yml

-19
This file was deleted.

.github/workflows/docs-build.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: docs-build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request_target: ~
8+
merge_group: ~
9+
10+
jobs:
11+
docs-preview:
12+
uses: elastic/docs-builder/.github/workflows/preview-build.yml@main
13+
with:
14+
path-pattern: docs/**
15+
permissions:
16+
deployments: write
17+
id-token: write
18+
contents: read
19+
pull-requests: read

.github/workflows/docs-cleanup.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: docs-cleanup
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
8+
jobs:
9+
docs-preview:
10+
uses: elastic/docs-builder/.github/workflows/preview-cleanup.yml@main
11+
permissions:
12+
contents: none
13+
id-token: write
14+
deployments: write

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/apm-server.keystore
1717
/apm-server
1818
/apm-server-oss
19+
/apm-server-fips
1920
**/*.test
2021
/docs/elastic/
2122
html_docs

.go-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.24.0
1+
1.24.1

CHANGELOG.asciidoc

-46
This file was deleted.

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
<!-- * [Elastic APM v9.x](TBD) -->
4+
* [Elastic APM v8.x](https://www.elastic.co/guide/en/observability/8.x/apm-release-notes.html)
5+
* [Elastic APM v7.x](https://www.elastic.co/guide/en/apm/guide/7.17/release-notes.html)

Makefile

+36-12
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,20 @@ LDFLAGS := \
5353
# the apm-server binaries.
5454
.PHONY: $(APM_SERVER_BINARIES)
5555
$(APM_SERVER_BINARIES):
56-
env CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) \
57-
go build -o $@ -trimpath $(GOFLAGS) $(GOMODFLAG) -ldflags "$(LDFLAGS)" ./x-pack/apm-server
56+
# call make instead of using a prerequisite to force it to run the task when
57+
# multiple targets are specified
58+
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) PKG=$(PKG) GOTAGS=$(GOTAGS) SUFFIX=$(SUFFIX) EXTENSION=$(EXTENSION) NOCP=1 \
59+
$(MAKE) apm-server
60+
61+
.PHONY: apm-server-build
62+
apm-server-build:
63+
env CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) \
64+
go build -o "build/apm-server-$(GOOS)-$(GOARCH)$(SUFFIX)$(EXTENSION)" -trimpath $(GOFLAGS) $(GOTAGS) $(GOMODFLAG) -ldflags "$(LDFLAGS)" $(PKG)
5865

5966
build/apm-server-linux-%: GOOS=linux
6067
build/apm-server-darwin-%: GOOS=darwin
6168
build/apm-server-windows-%: GOOS=windows
69+
build/apm-server-windows-%: EXTENSION=.exe
6270
build/apm-server-%-amd64 build/apm-server-%-amd64.exe: GOARCH=amd64
6371
build/apm-server-%-arm64 build/apm-server-%-arm64.exe: GOARCH=arm64
6472

@@ -70,27 +78,43 @@ GOVERSIONINFO_FLAGS := \
7078
build/apm-server-windows-amd64.exe: x-pack/apm-server/versioninfo_windows_amd64.syso
7179
x-pack/apm-server/versioninfo_windows_amd64.syso: GOVERSIONINFO_FLAGS+=-64
7280
x-pack/apm-server/versioninfo_%.syso: $(GITREFFILE) packaging/versioninfo.json
73-
go tool github.com/josephspurrier/goversioninfo/cmd/goversioninfo -o $@ $(GOVERSIONINFO_FLAGS) packaging/versioninfo.json
81+
# this task is only used when building apm-server for windows (GOOS=windows)
82+
# but it could be run from any OS so use the host os and arch.
83+
GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go tool github.com/josephspurrier/goversioninfo/cmd/goversioninfo -o $@ $(GOVERSIONINFO_FLAGS) packaging/versioninfo.json
84+
85+
.PHONY: apm-server apm-server-oss apm-server-fips
86+
87+
apm-server-oss: PKG=./cmd/apm-server
88+
apm-server apm-server-fips: PKG=./x-pack/apm-server
89+
90+
apm-server-fips: CGO_ENABLED=1
91+
apm-server apm-server-oss: CGO_ENABLED=0
92+
93+
apm-server-fips: GOTAGS=-tags=requirefips
7494

75-
.PHONY: apm-server
76-
apm-server: build/apm-server-$(shell go env GOOS)-$(shell go env GOARCH)
77-
@cp $^ $@
95+
apm-server-oss: SUFFIX=-oss
96+
apm-server-fips: SUFFIX=-fips
7897

79-
.PHONY: apm-server-oss
80-
apm-server-oss:
81-
@go build $(GOMODFLAG) -o $@ ./cmd/apm-server
98+
apm-server apm-server-oss apm-server-fips:
99+
# call make instead of using a prerequisite to force it to run the task when
100+
# multiple targets are specified
101+
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) PKG=$(PKG) GOTAGS=$(GOTAGS) SUFFIX=$(SUFFIX) EXTENSION=$(EXTENSION) \
102+
$(MAKE) apm-server-build
103+
@[ "${NOCP}" ] || cp "build/apm-server-$(GOOS)-$(GOARCH)$(SUFFIX)$(EXTENSION)" "apm-server$(SUFFIX)"
82104

83105
.PHONY: test
84106
test:
85-
@go test $(GOMODFLAG) $(GOTESTFLAGS) ./...
107+
@go test $(GOMODFLAG) $(GOTESTFLAGS) -race ./...
86108

87109
.PHONY: system-test
88110
system-test:
89-
@(cd systemtest; go test $(GOMODFLAG) $(GOTESTFLAGS) -timeout=20m ./...)
111+
# CGO is disabled when building APM Server binary, so the race detector in this case
112+
# would only work on the parts that don't involve APM Server binary.
113+
@(cd systemtest; go test $(GOMODFLAG) $(GOTESTFLAGS) -race -timeout=20m ./...)
90114

91115
.PHONY:
92116
clean:
93-
@rm -rf build apm-server apm-server.exe
117+
@rm -rf build apm-server apm-server.exe apm-server-oss apm-server-fips
94118

95119
##############################################################################
96120
# Checks/tests.

0 commit comments

Comments
 (0)