Skip to content

Commit

Permalink
chore: get rid of third_party dir for managing tool versions
Browse files Browse the repository at this point in the history
  • Loading branch information
programmer04 committed Oct 25, 2024
1 parent 9ce405a commit 879190b
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 190 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ generators/
Dockerfile*
test/
keps/
third_party/
*.md
6 changes: 0 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ updates:
- k8s.io/klog/*
- k8s.io/utils
- k8s.io/kube-openapi
- package-ecosystem: gomod
directory: /third_party/
schedule:
interval: daily
labels:
- dependencies
- package-ecosystem: github-actions
directory: /
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: third_party/go.mod
go-version-file: go.mod

- uses: jdx/mise-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: setup golang
uses: actions/setup-go@v5
with:
go-version-file: third_party/go.mod
go-version-file: go.mod
- uses: jdx/mise-action@v2
with:
install: false
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ railgun
*~

# Delve Debugger Output
__debug_bin
__debug_bin*

# tmp files
client-gen-tmp/*
Expand Down
4 changes: 3 additions & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[env]

MISE_DATA_DIR='bin/'

[settings]
experimental = true
2 changes: 2 additions & 0 deletions .tools_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ gojunit-report: "2.1.0"
gotestsum: "1.12.0"
# renovate: datasource=github-releases depName=dominikh/go-tools
staticcheck: "2024.1.1"
# renovate: datasource=github-releases depName=go-delve/delve
delve: "1.23.1"
18 changes: 7 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,12 @@ LDFLAGS_METADATA ?= \

PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))

.PHONY: _download_tool
_download_tool:
(cd third_party && go mod tidy && \
GOBIN=$(PROJECT_DIR)/bin go generate -tags=third_party ./$(TOOL).go )

TOOLS_VERSIONS_FILE = .tools_versions.yaml

MISE := $(shell which mise)
.PHONY: mise
mise:
@mise -V >/dev/null || (echo "mise - https://github.com/jdx/mise - not found. Please install it." && exit 1)
@mise -V >/dev/null || (echo "mise - https://github.com/jdx/mise - not found. Please install it" && exit 1)

.PHONY: tools
tools: controller-gen kustomize client-gen golangci-lint.download gotestsum crd-ref-docs skaffold staticcheck.download
Expand Down Expand Up @@ -133,10 +128,11 @@ yq: mise # Download yq locally if necessary.
@$(MAKE) mise-plugin-install DEP=yq
@$(MAKE) mise-install DEP_VER=yq@$(YQ_VERSION)

DLV = $(PROJECT_DIR)/bin/dlv
DELVE_VERSION = $(shell yq -ojson -r '.delve' < $(TOOLS_VERSIONS_FILE))
DLV = $(PROJECT_DIR)/bin/installs/go-github-com-go-delve-delve-cmd-dlv/$(DELVE_VERSION)/bin/dlv
.PHONY: dlv
dlv: ## Download dlv locally if necessary.
@$(MAKE) _download_tool TOOL=dlv
mise install go:github.com/go-delve/delve/cmd/dlv@$(DELVE_VERSION)

SETUP_ENVTEST_VERSION = $(shell yq -ojson -r '.setup-envtest' < $(TOOLS_VERSIONS_FILE))
SETUP_ENVTEST = $(PROJECT_DIR)/bin/installs/setup-envtest/$(SETUP_ENVTEST_VERSION)/bin/setup-envtest
Expand Down Expand Up @@ -209,7 +205,7 @@ fmt:
go fmt ./...

.PHONY: lint
lint: verify.tidy golangci-lint staticcheck
lint: verify.tidy golangci-lint staticcheck

.PHONY: golangci-lint
golangci-lint: golangci-lint.download
Expand Down Expand Up @@ -647,7 +643,7 @@ _ensure-namespace:
@kubectl create ns $(KONG_NAMESPACE) 2>/dev/null || true

.PHONY: debug
debug: install _ensure-namespace
debug: dlv install _ensure-namespace
$(DLV) debug ./internal/cmd/main.go -- \
--anonymous-reports=false \
--kong-admin-url $(KONG_ADMIN_URL) \
Expand All @@ -667,7 +663,7 @@ debug: install _ensure-namespace
# specific substitution paths can be isolated to this project only and not shared
# across projects under $HOME or common XDG_CONFIG_HOME.
.PHONY: debug.connect
debug.connect:
debug.connect: dlv
XDG_CONFIG_HOME="$(PROJECT_DIR)/.config" $(DLV) connect localhost:40000

SKAFFOLD_DEBUG_PROFILE ?= debug_multi_gw
Expand Down
9 changes: 0 additions & 9 deletions third_party/dlv.go

This file was deleted.

41 changes: 0 additions & 41 deletions third_party/go.mod

This file was deleted.

111 changes: 0 additions & 111 deletions third_party/go.sum

This file was deleted.

7 changes: 0 additions & 7 deletions third_party/looppointer.go

This file was deleted.

0 comments on commit 879190b

Please sign in to comment.