Skip to content

Commit 8e4958f

Browse files
authored
Manage 3rd party tools via dedicated go.mod (jaegertracing#5509)
1 parent f2b46d4 commit 8e4958f

File tree

10 files changed

+1319
-23
lines changed

10 files changed

+1319
-23
lines changed

.codecov.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ignore:
1414
- "examples/hotrod"
1515
- "plugin/storage/integration"
1616
- "cmd/jaeger/internal/integration"
17+
- "internal/tools"
1718

1819
coverage:
1920
precision: 2

.github/dependabot.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ updates:
1919
patterns:
2020
- "go.opentelemetry.io/contrib/instrumentation/*"
2121

22+
- package-ecosystem: gomod
23+
directory: "/internal/tools"
24+
schedule:
25+
interval: daily
26+
labels: [ "changelog:dependencies" ]
27+
2228
- package-ecosystem: "github-actions"
2329
directory: "/"
2430
schedule:
@@ -129,4 +135,4 @@ updates:
129135
interval: daily
130136
allow:
131137
- dependency-name: "bitnami/kafka"
132-
update-types: ["version-update:semver-minor"]
138+
update-types: ["version-update:semver-minor"]

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
go.work
22
go.work.sum
33

4+
.tools/
5+
46
*.out
57
*.test
68
*.xml
@@ -15,6 +17,8 @@ cover.html
1517
.tmp/
1618
.mkdocs-virtual-env/
1719
vendor/
20+
21+
# Jaeger binaries
1822
examples/hotrod/hotrod
1923
examples/hotrod/hotrod-*
2024
cmd/all-in-one/all-in-one-*
@@ -36,6 +40,7 @@ cmd/query/query-*
3640
cmd/tracegen/tracegen
3741
cmd/tracegen/tracegen-*
3842
crossdock/crossdock-*
43+
3944
run-crossdock.log
4045
proto-gen/.patched-otel-proto/
4146
__pycache__

Makefile

+8-22
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ JAEGER_V2_STORAGE_PKGS = ./cmd/jaeger/internal/integration
1010
DOCKER_NAMESPACE?=jaegertracing
1111
DOCKER_TAG?=latest
1212

13+
# SRC_ROOT is the top of the source tree.
14+
SRC_ROOT := $(shell git rev-parse --show-toplevel)
15+
1316
# TODO we can compartmentalize this Makefile better, by separting:
1417
# - integration tests
1518
# - all the binary building targets
@@ -32,6 +35,7 @@ ALL_SRC = $(shell find . -name '*.go' \
3235
-not -name 'mocks*' \
3336
-not -name '*.pb.go' \
3437
-not -path './vendor/*' \
38+
-not -path './internal/tools/*' \
3539
-not -path '*/mocks/*' \
3640
-not -path '*/*-gen/*' \
3741
-not -path '*/thrift-0.9.2/*' \
@@ -59,7 +63,6 @@ GOTEST_QUIET=$(GO) test $(RACE)
5963
GOTEST=$(GOTEST_QUIET) -v
6064
COVEROUT=cover.out
6165
GOFMT=gofmt
62-
GOFUMPT=gofumpt
6366
FMT_LOG=.fmt.log
6467
IMPORT_LOG=.import.log
6568
COLORIZE ?= | $(SED) 's/PASS/✅ PASS/g' | $(SED) 's/FAIL/❌ FAIL/g' | $(SED) 's/SKIP/🔕 SKIP/g'
@@ -78,11 +81,10 @@ DATE=$(shell TZ=UTC0 git show --quiet --date='format-local:%Y-%m-%dT%H:%M:%SZ' -
7881
BUILD_INFO_IMPORT_PATH=$(JAEGER_IMPORT_PATH)/pkg/version
7982
BUILD_INFO=-ldflags "-X $(BUILD_INFO_IMPORT_PATH).commitSHA=$(GIT_SHA) -X $(BUILD_INFO_IMPORT_PATH).latestVersion=$(GIT_CLOSEST_TAG) -X $(BUILD_INFO_IMPORT_PATH).date=$(DATE)"
8083

81-
MOCKERY=mockery
82-
GOVERSIONINFO=goversioninfo
8384
SYSOFILE=resource.syso
8485

8586
# import other Makefiles after the variables are defined
87+
include Makefile.Tools.mk
8688
include docker/Makefile
8789
include Makefile.Protobuf.mk
8890
include Makefile.Thrift.mk
@@ -187,7 +189,7 @@ fmt:
187189

188190
.PHONY: lint
189191
lint: goleak
190-
golangci-lint -v run
192+
$(LINT) -v run
191193
@./scripts/updateLicense.py $(ALL_SRC) > $(FMT_LOG)
192194
@./scripts/import-order-cleanup.py -o stdout -t $(ALL_SRC) > $(IMPORT_LOG)
193195
@[ ! -s "$(FMT_LOG)" -a ! -s "$(IMPORT_LOG)" ] || (echo "License check or import ordering failures, run 'make fmt'" | cat - $(FMT_LOG) $(IMPORT_LOG) && false)
@@ -452,22 +454,6 @@ changelog:
452454
draft-release:
453455
./scripts/draft-release.py
454456

455-
.PHONY: install-test-tools
456-
install-test-tools:
457-
$(GO) install github.com/golangci/golangci-lint/cmd/[email protected]
458-
$(GO) install mvdan.cc/gofumpt@latest
459-
460-
.PHONY: install-build-tools
461-
install-build-tools:
462-
$(GO) install github.com/josephspurrier/goversioninfo/cmd/[email protected]
463-
464-
.PHONY: install-tools
465-
install-tools: install-test-tools install-build-tools
466-
$(GO) install github.com/vektra/mockery/[email protected]
467-
468-
.PHONY: install-ci
469-
install-ci: install-test-tools install-build-tools
470-
471457
.PHONY: test-ci
472458
test-ci: GOTEST := $(GOTEST_QUIET)
473459
test-ci: build-examples cover
@@ -477,8 +463,8 @@ init-submodules:
477463
git submodule update --init --recursive
478464

479465
.PHONY: generate-mocks
480-
generate-mocks: install-tools
481-
$(MOCKERY) --all --dir ./pkg/es/ --output ./pkg/es/mocks && rm pkg/es/mocks/ClientBuilder.go
466+
generate-mocks: $(MOCKERY)
467+
$(MOCKERY) --all --dir ./pkg/es/ --output ./pkg/es/mocks
482468
$(MOCKERY) --all --dir ./storage/spanstore/ --output ./storage/spanstore/mocks
483469
$(MOCKERY) --all --dir ./proto-gen/storage_v1/ --output ./proto-gen/storage_v1/mocks
484470

Makefile.Tools.mk

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2024 The Jaeger Authors.
2+
# Copyright The OpenTelemetry Authors
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
TOOLS_MOD_DIR := $(SRC_ROOT)/internal/tools
6+
TOOLS_BIN_DIR := $(SRC_ROOT)/.tools
7+
TOOLS_MOD_REGEX := "\s+_\s+\".*\""
8+
TOOLS_PKG_NAMES := $(shell grep -E $(TOOLS_MOD_REGEX) < $(TOOLS_MOD_DIR)/tools.go | tr -d " _\"")
9+
TOOLS_BIN_NAMES := $(addprefix $(TOOLS_BIN_DIR)/, $(notdir $(shell echo $(TOOLS_PKG_NAMES) | sed 's|/v[0-9]||g')))
10+
11+
GOFUMPT := $(TOOLS_BIN_DIR)/gofumpt
12+
GOVERSIONINFO := $(TOOLS_BIN_DIR)/goversioninfo
13+
LINT := $(TOOLS_BIN_DIR)/golangci-lint
14+
MOCKERY := $(TOOLS_BIN_DIR)/mockery
15+
16+
# this target is useful for setting up local workspace, but from CI we want to call more specific ones
17+
.PHONY: install-tools
18+
install-tools: $(TOOLS_BIN_NAMES)
19+
20+
.PHONY: install-test-tools
21+
install-test-tools: $(LINT) $(GOFUMPT)
22+
23+
.PHONY: install-build-tools
24+
install-build-tools: $(GOVERSIONINFO)
25+
26+
.PHONY: install-ci
27+
install-ci: install-test-tools install-build-tools
28+
29+
list-internal-tools:
30+
@echo Third party tool modules:
31+
@echo $(TOOLS_PKG_NAMES) | tr ' ' '\n' | sed 's/^/- /g'
32+
@echo Third party tool binaries:
33+
@echo $(TOOLS_BIN_NAMES) | tr ' ' '\n' | sed 's/^/- /g'
34+
35+
$(TOOLS_BIN_DIR):
36+
mkdir -p $@
37+
38+
$(TOOLS_BIN_NAMES): $(TOOLS_BIN_DIR) $(TOOLS_MOD_DIR)/go.mod
39+
cd $(TOOLS_MOD_DIR) && $(GO) build -o $@ -trimpath $(shell echo $(TOOLS_PKG_NAMES) | tr ' ' '\n' | grep $(notdir $@))

internal/tools/empty.go

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright (c) 2024 The Jaeger Authors.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// Package tools is used to track versions of 3rd party tools used for building / testing CI.
5+
// See tools.go for imported tools and go.mod for the versions of those tools.
6+
package tools

internal/tools/go.mod

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
module github.com/jaegertracing/jaeger/internal/tools
2+
3+
go 1.22.3
4+
5+
require (
6+
github.com/golangci/golangci-lint v1.55.2
7+
github.com/josephspurrier/goversioninfo v1.4.0
8+
github.com/vektra/mockery/v2 v2.42.3
9+
mvdan.cc/gofumpt v0.6.0
10+
)
11+
12+
require (
13+
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
14+
4d63.com/gochecknoglobals v0.2.1 // indirect
15+
github.com/4meepo/tagalign v1.3.3 // indirect
16+
github.com/Abirdcfly/dupword v0.0.13 // indirect
17+
github.com/Antonboom/errname v0.1.12 // indirect
18+
github.com/Antonboom/nilnil v0.1.7 // indirect
19+
github.com/Antonboom/testifylint v0.2.3 // indirect
20+
github.com/BurntSushi/toml v1.3.2 // indirect
21+
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
22+
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 // indirect
23+
github.com/Masterminds/semver v1.5.0 // indirect
24+
github.com/OpenPeeDeeP/depguard/v2 v2.1.0 // indirect
25+
github.com/akavel/rsrc v0.10.2 // indirect
26+
github.com/alecthomas/go-check-sumtype v0.1.3 // indirect
27+
github.com/alexkohler/nakedret/v2 v2.0.2 // indirect
28+
github.com/alexkohler/prealloc v1.0.0 // indirect
29+
github.com/alingse/asasalint v0.0.11 // indirect
30+
github.com/ashanbrown/forbidigo v1.6.0 // indirect
31+
github.com/ashanbrown/makezero v1.1.1 // indirect
32+
github.com/beorn7/perks v1.0.1 // indirect
33+
github.com/bkielbasa/cyclop v1.2.1 // indirect
34+
github.com/blizzy78/varnamelen v0.8.0 // indirect
35+
github.com/bombsimon/wsl/v3 v3.4.0 // indirect
36+
github.com/breml/bidichk v0.2.7 // indirect
37+
github.com/breml/errchkjson v0.3.6 // indirect
38+
github.com/butuzov/ireturn v0.2.2 // indirect
39+
github.com/butuzov/mirror v1.1.0 // indirect
40+
github.com/catenacyber/perfsprint v0.2.0 // indirect
41+
github.com/ccojocar/zxcvbn-go v1.0.1 // indirect
42+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
43+
github.com/charithe/durationcheck v0.0.10 // indirect
44+
github.com/chavacava/garif v0.1.0 // indirect
45+
github.com/chigopher/pathlib v0.19.1 // indirect
46+
github.com/curioswitch/go-reassign v0.2.0 // indirect
47+
github.com/daixiang0/gci v0.11.2 // indirect
48+
github.com/davecgh/go-spew v1.1.1 // indirect
49+
github.com/denis-tingaikin/go-header v0.4.3 // indirect
50+
github.com/esimonov/ifshort v1.0.4 // indirect
51+
github.com/ettle/strcase v0.1.1 // indirect
52+
github.com/fatih/color v1.15.0 // indirect
53+
github.com/fatih/structtag v1.2.0 // indirect
54+
github.com/firefart/nonamedreturns v1.0.4 // indirect
55+
github.com/fsnotify/fsnotify v1.6.0 // indirect
56+
github.com/fzipp/gocyclo v0.6.0 // indirect
57+
github.com/ghostiam/protogetter v0.2.3 // indirect
58+
github.com/go-critic/go-critic v0.9.0 // indirect
59+
github.com/go-toolsmith/astcast v1.1.0 // indirect
60+
github.com/go-toolsmith/astcopy v1.1.0 // indirect
61+
github.com/go-toolsmith/astequal v1.1.0 // indirect
62+
github.com/go-toolsmith/astfmt v1.1.0 // indirect
63+
github.com/go-toolsmith/astp v1.1.0 // indirect
64+
github.com/go-toolsmith/strparse v1.1.0 // indirect
65+
github.com/go-toolsmith/typep v1.1.0 // indirect
66+
github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect
67+
github.com/gobwas/glob v0.2.3 // indirect
68+
github.com/gofrs/flock v0.8.1 // indirect
69+
github.com/golang/protobuf v1.5.2 // indirect
70+
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect
71+
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect
72+
github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect
73+
github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect
74+
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect
75+
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect
76+
github.com/golangci/misspell v0.4.1 // indirect
77+
github.com/golangci/revgrep v0.5.2 // indirect
78+
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect
79+
github.com/google/go-cmp v0.6.0 // indirect
80+
github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect
81+
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
82+
github.com/gostaticanalysis/comment v1.4.2 // indirect
83+
github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect
84+
github.com/gostaticanalysis/nilerr v0.1.1 // indirect
85+
github.com/hashicorp/errwrap v1.0.0 // indirect
86+
github.com/hashicorp/go-multierror v1.1.1 // indirect
87+
github.com/hashicorp/go-version v1.6.0 // indirect
88+
github.com/hashicorp/hcl v1.0.0 // indirect
89+
github.com/hexops/gotextdiff v1.0.3 // indirect
90+
github.com/huandu/xstrings v1.4.0 // indirect
91+
github.com/iancoleman/strcase v0.2.0 // indirect
92+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
93+
github.com/jgautheron/goconst v1.6.0 // indirect
94+
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
95+
github.com/jinzhu/copier v0.3.5 // indirect
96+
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect
97+
github.com/julz/importas v0.1.0 // indirect
98+
github.com/kisielk/errcheck v1.6.3 // indirect
99+
github.com/kisielk/gotool v1.0.0 // indirect
100+
github.com/kkHAIKE/contextcheck v1.1.4 // indirect
101+
github.com/kulti/thelper v0.6.3 // indirect
102+
github.com/kunwardeep/paralleltest v1.0.8 // indirect
103+
github.com/kyoh86/exportloopref v0.1.11 // indirect
104+
github.com/ldez/gomoddirectives v0.2.3 // indirect
105+
github.com/ldez/tagliatelle v0.5.0 // indirect
106+
github.com/leonklingele/grouper v1.1.1 // indirect
107+
github.com/lufeee/execinquery v1.2.1 // indirect
108+
github.com/macabu/inamedparam v0.1.2 // indirect
109+
github.com/magiconair/properties v1.8.7 // indirect
110+
github.com/maratori/testableexamples v1.0.0 // indirect
111+
github.com/maratori/testpackage v1.1.1 // indirect
112+
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect
113+
github.com/mattn/go-colorable v0.1.13 // indirect
114+
github.com/mattn/go-isatty v0.0.17 // indirect
115+
github.com/mattn/go-runewidth v0.0.9 // indirect
116+
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
117+
github.com/mbilski/exhaustivestruct v1.2.0 // indirect
118+
github.com/mgechev/revive v1.3.4 // indirect
119+
github.com/mitchellh/go-homedir v1.1.0 // indirect
120+
github.com/mitchellh/mapstructure v1.5.0 // indirect
121+
github.com/moricho/tparallel v0.3.1 // indirect
122+
github.com/nakabonne/nestif v0.3.1 // indirect
123+
github.com/nishanths/exhaustive v0.11.0 // indirect
124+
github.com/nishanths/predeclared v0.2.2 // indirect
125+
github.com/nunnatsa/ginkgolinter v0.14.1 // indirect
126+
github.com/olekukonko/tablewriter v0.0.5 // indirect
127+
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
128+
github.com/pmezard/go-difflib v1.0.0 // indirect
129+
github.com/polyfloyd/go-errorlint v1.4.5 // indirect
130+
github.com/prometheus/client_golang v1.12.1 // indirect
131+
github.com/prometheus/client_model v0.2.0 // indirect
132+
github.com/prometheus/common v0.32.1 // indirect
133+
github.com/prometheus/procfs v0.7.3 // indirect
134+
github.com/quasilyte/go-ruleguard v0.4.0 // indirect
135+
github.com/quasilyte/gogrep v0.5.0 // indirect
136+
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
137+
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
138+
github.com/rs/zerolog v1.29.0 // indirect
139+
github.com/ryancurrah/gomodguard v1.3.0 // indirect
140+
github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect
141+
github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect
142+
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
143+
github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect
144+
github.com/securego/gosec/v2 v2.18.2 // indirect
145+
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
146+
github.com/sirupsen/logrus v1.9.3 // indirect
147+
github.com/sivchari/containedctx v1.0.3 // indirect
148+
github.com/sivchari/nosnakecase v1.7.0 // indirect
149+
github.com/sivchari/tenv v1.7.1 // indirect
150+
github.com/sonatard/noctx v0.0.2 // indirect
151+
github.com/sourcegraph/go-diff v0.7.0 // indirect
152+
github.com/spf13/afero v1.9.3 // indirect
153+
github.com/spf13/cast v1.5.0 // indirect
154+
github.com/spf13/cobra v1.7.0 // indirect
155+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
156+
github.com/spf13/pflag v1.0.5 // indirect
157+
github.com/spf13/viper v1.15.0 // indirect
158+
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
159+
github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect
160+
github.com/stretchr/objx v0.5.0 // indirect
161+
github.com/stretchr/testify v1.8.4 // indirect
162+
github.com/subosito/gotenv v1.4.2 // indirect
163+
github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect
164+
github.com/tdakkota/asciicheck v0.2.0 // indirect
165+
github.com/tetafro/godot v1.4.15 // indirect
166+
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect
167+
github.com/timonwong/loggercheck v0.9.4 // indirect
168+
github.com/tomarrell/wrapcheck/v2 v2.8.1 // indirect
169+
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
170+
github.com/ultraware/funlen v0.1.0 // indirect
171+
github.com/ultraware/whitespace v0.0.5 // indirect
172+
github.com/uudashr/gocognit v1.1.2 // indirect
173+
github.com/xen0n/gosmopolitan v1.2.2 // indirect
174+
github.com/yagipy/maintidx v1.0.0 // indirect
175+
github.com/yeya24/promlinter v0.2.0 // indirect
176+
github.com/ykadowak/zerologlint v0.1.3 // indirect
177+
gitlab.com/bosi/decorder v0.4.1 // indirect
178+
go-simpler.org/sloglint v0.1.2 // indirect
179+
go.tmz.dev/musttag v0.7.2 // indirect
180+
go.uber.org/atomic v1.9.0 // indirect
181+
go.uber.org/multierr v1.8.0 // indirect
182+
go.uber.org/zap v1.24.0 // indirect
183+
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect
184+
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect
185+
golang.org/x/mod v0.14.0 // indirect
186+
golang.org/x/sync v0.6.0 // indirect
187+
golang.org/x/sys v0.16.0 // indirect
188+
golang.org/x/term v0.5.0 // indirect
189+
golang.org/x/text v0.13.0 // indirect
190+
golang.org/x/tools v0.17.0 // indirect
191+
google.golang.org/protobuf v1.28.1 // indirect
192+
gopkg.in/ini.v1 v1.67.0 // indirect
193+
gopkg.in/yaml.v2 v2.4.0 // indirect
194+
gopkg.in/yaml.v3 v3.0.1 // indirect
195+
honnef.co/go/tools v0.4.6 // indirect
196+
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
197+
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
198+
mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d // indirect
199+
)

0 commit comments

Comments
 (0)