-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into lint-bare-return
- Loading branch information
Showing
12 changed files
with
1,325 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ JAEGER_V2_STORAGE_PKGS = ./cmd/jaeger/internal/integration | |
DOCKER_NAMESPACE?=jaegertracing | ||
DOCKER_TAG?=latest | ||
|
||
# SRC_ROOT is the top of the source tree. | ||
SRC_ROOT := $(shell git rev-parse --show-toplevel) | ||
|
||
# TODO we can compartmentalize this Makefile better, by separting: | ||
# - integration tests | ||
# - all the binary building targets | ||
|
@@ -32,6 +35,7 @@ ALL_SRC = $(shell find . -name '*.go' \ | |
-not -name 'mocks*' \ | ||
-not -name '*.pb.go' \ | ||
-not -path './vendor/*' \ | ||
-not -path './internal/tools/*' \ | ||
-not -path '*/mocks/*' \ | ||
-not -path '*/*-gen/*' \ | ||
-not -path '*/thrift-0.9.2/*' \ | ||
|
@@ -59,7 +63,6 @@ GOTEST_QUIET=$(GO) test $(RACE) | |
GOTEST=$(GOTEST_QUIET) -v | ||
COVEROUT=cover.out | ||
GOFMT=gofmt | ||
GOFUMPT=gofumpt | ||
FMT_LOG=.fmt.log | ||
IMPORT_LOG=.import.log | ||
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' - | |
BUILD_INFO_IMPORT_PATH=$(JAEGER_IMPORT_PATH)/pkg/version | ||
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)" | ||
|
||
MOCKERY=mockery | ||
GOVERSIONINFO=goversioninfo | ||
SYSOFILE=resource.syso | ||
|
||
# import other Makefiles after the variables are defined | ||
include Makefile.Tools.mk | ||
include docker/Makefile | ||
include Makefile.Protobuf.mk | ||
include Makefile.Thrift.mk | ||
|
@@ -187,7 +189,7 @@ fmt: | |
|
||
.PHONY: lint | ||
lint: goleak | ||
golangci-lint -v run | ||
$(LINT) -v run | ||
@./scripts/updateLicense.py $(ALL_SRC) > $(FMT_LOG) | ||
@./scripts/import-order-cleanup.py -o stdout -t $(ALL_SRC) > $(IMPORT_LOG) | ||
@[ ! -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: | |
draft-release: | ||
./scripts/draft-release.py | ||
|
||
.PHONY: install-test-tools | ||
install-test-tools: | ||
$(GO) install github.com/golangci/golangci-lint/cmd/[email protected] | ||
$(GO) install mvdan.cc/gofumpt@latest | ||
|
||
.PHONY: install-build-tools | ||
install-build-tools: | ||
$(GO) install github.com/josephspurrier/goversioninfo/cmd/[email protected] | ||
|
||
.PHONY: install-tools | ||
install-tools: install-test-tools install-build-tools | ||
$(GO) install github.com/vektra/mockery/[email protected] | ||
|
||
.PHONY: install-ci | ||
install-ci: install-test-tools install-build-tools | ||
|
||
.PHONY: test-ci | ||
test-ci: GOTEST := $(GOTEST_QUIET) | ||
test-ci: build-examples cover | ||
|
@@ -477,8 +463,8 @@ init-submodules: | |
git submodule update --init --recursive | ||
|
||
.PHONY: generate-mocks | ||
generate-mocks: install-tools | ||
$(MOCKERY) --all --dir ./pkg/es/ --output ./pkg/es/mocks && rm pkg/es/mocks/ClientBuilder.go | ||
generate-mocks: $(MOCKERY) | ||
$(MOCKERY) --all --dir ./pkg/es/ --output ./pkg/es/mocks | ||
$(MOCKERY) --all --dir ./storage/spanstore/ --output ./storage/spanstore/mocks | ||
$(MOCKERY) --all --dir ./proto-gen/storage_v1/ --output ./proto-gen/storage_v1/mocks | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (c) 2024 The Jaeger Authors. | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
TOOLS_MOD_DIR := $(SRC_ROOT)/internal/tools | ||
TOOLS_BIN_DIR := $(SRC_ROOT)/.tools | ||
TOOLS_MOD_REGEX := "\s+_\s+\".*\"" | ||
TOOLS_PKG_NAMES := $(shell grep -E $(TOOLS_MOD_REGEX) < $(TOOLS_MOD_DIR)/tools.go | tr -d " _\"") | ||
TOOLS_BIN_NAMES := $(addprefix $(TOOLS_BIN_DIR)/, $(notdir $(shell echo $(TOOLS_PKG_NAMES) | sed 's|/v[0-9]||g'))) | ||
|
||
GOFUMPT := $(TOOLS_BIN_DIR)/gofumpt | ||
GOVERSIONINFO := $(TOOLS_BIN_DIR)/goversioninfo | ||
LINT := $(TOOLS_BIN_DIR)/golangci-lint | ||
MOCKERY := $(TOOLS_BIN_DIR)/mockery | ||
|
||
# this target is useful for setting up local workspace, but from CI we want to call more specific ones | ||
.PHONY: install-tools | ||
install-tools: $(TOOLS_BIN_NAMES) | ||
|
||
.PHONY: install-test-tools | ||
install-test-tools: $(LINT) $(GOFUMPT) | ||
|
||
.PHONY: install-build-tools | ||
install-build-tools: $(GOVERSIONINFO) | ||
|
||
.PHONY: install-ci | ||
install-ci: install-test-tools install-build-tools | ||
|
||
list-internal-tools: | ||
@echo Third party tool modules: | ||
@echo $(TOOLS_PKG_NAMES) | tr ' ' '\n' | sed 's/^/- /g' | ||
@echo Third party tool binaries: | ||
@echo $(TOOLS_BIN_NAMES) | tr ' ' '\n' | sed 's/^/- /g' | ||
|
||
$(TOOLS_BIN_DIR): | ||
mkdir -p $@ | ||
|
||
$(TOOLS_BIN_NAMES): $(TOOLS_BIN_DIR) $(TOOLS_MOD_DIR)/go.mod | ||
cd $(TOOLS_MOD_DIR) && $(GO) build -o $@ -trimpath $(shell echo $(TOOLS_PKG_NAMES) | tr ' ' '\n' | grep $(notdir $@)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (c) 2024 The Jaeger Authors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Package tools is used to track versions of 3rd party tools used for building / testing CI. | ||
// See tools.go for imported tools and go.mod for the versions of those tools. | ||
package tools |
Oops, something went wrong.