Skip to content

Commit

Permalink
feat: migrate grpc-middleware to v2, update deps
Browse files Browse the repository at this point in the history
Update removing multiple old middlewares, rework
the way data is passed through the context, logging fields, etc.

Fix minimum keepalive interval enforcement.

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Mar 12, 2024
1 parent 6af92b5 commit c551426
Show file tree
Hide file tree
Showing 36 changed files with 277 additions and 357 deletions.
77 changes: 44 additions & 33 deletions .conform.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,48 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-01-22T17:51:41Z by kres latest.
# Generated on 2024-03-12T11:40:32Z by kres latest.

---
policies:
- type: commit
spec:
dco: true
gpg:
required: true
identity:
gitHubOrganization: siderolabs
spellcheck:
locale: US
maximumOfOneCommit: true
header:
length: 89
imperative: true
case: lower
invalidLastCharacters: .
body:
required: true
conventional:
types: ["chore","docs","perf","refactor","style","test","release"]
scopes: [".*"]
- type: license
spec:
skipPaths:
- .git/
- testdata/
includeSuffixes:
- .go
excludeSuffixes:
- .pb.go
- .pb.gw.go
header: "// Copyright (c) 2021 Sidero Labs, Inc.\u000A//\u000A// Use of this software is governed by the Business Source License\u000A// included in the LICENSE file.\u000A"
- type: commit
spec:
dco: true
gpg:
required: true
identity:
gitHubOrganization: siderolabs
spellcheck:
locale: US
maximumOfOneCommit: true
header:
length: 89
imperative: true
case: lower
invalidLastCharacters: .
body:
required: true
conventional:
types:
- chore
- docs
- perf
- refactor
- style
- test
- release
scopes:
- .*
- type: license
spec:
skipPaths:
- .git/
- testdata/
includeSuffixes:
- .go
excludeSuffixes:
- .pb.go
- .pb.gw.go
header: |
// Copyright (c) 2024 Sidero Labs, Inc.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-01-22T17:52:47Z by kres latest.
# Generated on 2024-03-12T11:34:19Z by kres latest.

name: default
concurrency:
Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/'))
services:
buildkitd:
image: moby/buildkit:v0.12.4
image: moby/buildkit:v0.12.5
options: --privileged
ports:
- 1234:1234
Expand All @@ -48,7 +48,8 @@ jobs:
uses: docker/setup-buildx-action@v3
with:
driver: remote
endpoint: tcp://localhost:1234
endpoint: tcp://127.0.0.1:1234
timeout-minutes: 1
- name: base
run: |
make base
Expand Down
5 changes: 2 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-01-12T12:34:10Z by kres latest.
# Generated on 2024-03-12T11:34:19Z by kres latest.

# options for analysis running
run:
Expand Down Expand Up @@ -74,8 +74,6 @@ linters-settings:
govet:
check-shadowing: true
enable-all: true
disable:
- loopclosure
lll:
line-length: 200
tab-width: 4
Expand Down Expand Up @@ -153,6 +151,7 @@ linters:
- inamedparam
- testifylint # complains about our assert recorder and has a number of false positives for assert.Greater(t, thing, 1)
- protogetter # complains about us using Value field on typed spec, instead of GetValue which has a different signature
- perfsprint # complains about us using fmt.Sprintf in non-performance critical code, updating just kres took too long
# abandoned linters for which golangci shows the warning that the repo is archived by the owner
- interfacer
- maligned
Expand Down
29 changes: 15 additions & 14 deletions .kres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@ spec:
---
kind: common.Repository
spec:
license:
id: BSL-1.1
params:
Licensor: Sidero Labs, Inc.
LicensedWork: Discovery Service
Copyright: (c) 2021 Sidero Labs, Inc.
ChangeDate: "2025-10-28"
ChangeLicense: Mozilla Public License, version 2.0
EnterpriseLink: https://www.siderolabs.com/contact/
header: |
// Copyright (c) 2021 Sidero Labs, Inc.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
licenses:
- enabled: true
id: BSL-1.1
params:
Licensor: Sidero Labs, Inc.
LicensedWork: Discovery Service
Copyright: (c) 2024 Sidero Labs, Inc.
ChangeDate: "2028-03-12"
ChangeLicense: Mozilla Public License, version 2.0
EnterpriseLink: https://www.siderolabs.com/contact/
header: |
// Copyright (c) 2024 Sidero Labs, Inc.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
2 changes: 1 addition & 1 deletion .license-header.go.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021 Sidero Labs, Inc.
// Copyright (c) 2024 Sidero Labs, Inc.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# syntax = docker/dockerfile-upstream:1.6.0-labs
# syntax = docker/dockerfile-upstream:1.7.0-labs

# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-01-22T17:51:41Z by kres latest.
# Generated on 2024-03-12T11:34:19Z by kres latest.

ARG TOOLCHAIN

Expand All @@ -14,9 +14,9 @@ FROM ghcr.io/siderolabs/ca-certificates:v1.6.0 AS image-ca-certificates
FROM ghcr.io/siderolabs/fhs:v1.6.0 AS image-fhs

# runs markdownlint
FROM docker.io/node:21.5.0-alpine3.19 AS lint-markdown
FROM docker.io/node:21.7.1-alpine3.19 AS lint-markdown
WORKDIR /src
RUN npm i -g markdownlint-cli@0.38.0
RUN npm i -g markdownlint-cli@0.39.0
RUN npm i [email protected]
COPY .markdownlint.json .
COPY ./README.md ./README.md
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Parameters

Licensor: Sidero Labs, Inc.
Licensed Work: Discovery Service
The Licensed Work is (c) 2021 Sidero Labs, Inc.
The Licensed Work is (c) 2024 Sidero Labs, Inc.
Additional Use Grant: None

Change Date: 2025-10-28
Change Date: 2028-03-12

Change License: Mozilla Public License, version 2.0

Expand Down
27 changes: 13 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-01-22T17:51:41Z by kres latest.
# Generated on 2024-03-12T11:34:19Z by kres latest.

# common variables

SHA := $(shell git describe --match=none --always --abbrev=8 --dirty)
TAG := $(shell git describe --tag --always --dirty)
TAG := $(shell git describe --tag --always --dirty --match v[0-9]\*)
ABBREV_TAG := $(shell git describe --tags >/dev/null 2>/dev/null && git describe --tag --always --match v[0-9]\* --abbrev=0 || echo 'undefined')
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ARTIFACTS := _out
Expand All @@ -14,20 +14,19 @@ WITH_RACE ?= false
REGISTRY ?= ghcr.io
USERNAME ?= siderolabs
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME)
PROTOBUF_GO_VERSION ?= 1.32.0
PROTOBUF_GO_VERSION ?= 1.33.0
GRPC_GO_VERSION ?= 1.3.0
GRPC_GATEWAY_VERSION ?= 2.19.0
VTPROTOBUF_VERSION ?= 0.5.0
DEEPCOPY_VERSION ?= v0.5.5
GOLANGCILINT_VERSION ?= v1.55.2
GOFUMPT_VERSION ?= v0.5.0
GO_VERSION ?= 1.21.6
GOIMPORTS_VERSION ?= v0.17.0
GRPC_GATEWAY_VERSION ?= 2.19.1
VTPROTOBUF_VERSION ?= 0.6.0
DEEPCOPY_VERSION ?= v0.5.6
GOLANGCILINT_VERSION ?= v1.56.2
GOFUMPT_VERSION ?= v0.6.0
GO_VERSION ?= 1.22.1
GOIMPORTS_VERSION ?= v0.19.0
GO_BUILDFLAGS ?=
GO_LDFLAGS ?=
CGO_ENABLED ?= 0
GOTOOLCHAIN ?= local
GOEXPERIMENT ?= loopvar
TESTPKGS ?= ./...
KRES_IMAGE ?= ghcr.io/siderolabs/kres:latest
CONFORMANCE_IMAGE ?= ghcr.io/siderolabs/conform:latest
Expand Down Expand Up @@ -65,7 +64,7 @@ COMMON_ARGS += --build-arg=GOLANGCILINT_VERSION="$(GOLANGCILINT_VERSION)"
COMMON_ARGS += --build-arg=GOIMPORTS_VERSION="$(GOIMPORTS_VERSION)"
COMMON_ARGS += --build-arg=GOFUMPT_VERSION="$(GOFUMPT_VERSION)"
COMMON_ARGS += --build-arg=TESTPKGS="$(TESTPKGS)"
TOOLCHAIN ?= docker.io/golang:1.21-alpine
TOOLCHAIN ?= docker.io/golang:1.22-alpine

# help menu

Expand Down Expand Up @@ -126,7 +125,7 @@ endif
ifneq (, $(filter $(WITH_DEBUG), t true TRUE y yes 1))
GO_BUILDFLAGS += -tags sidero.debug
else
GO_LDFLAGS += -s -w
GO_LDFLAGS += -s
endif

all: unit-tests discovery-service image-discovery-service lint
Expand All @@ -150,7 +149,7 @@ lint-gofumpt: ## Runs gofumpt linter.
.PHONY: fmt
fmt: ## Formats the source code
@docker run --rm -it -v $(PWD):/src -w /src golang:$(GO_VERSION) \
bash -c "export GOEXPERIMENT=loopvar; export GOTOOLCHAIN=local; \
bash -c "export GOTOOLCHAIN=local; \
export GO111MODULE=on; export GOPROXY=https://proxy.golang.org; \
go install mvdan.cc/gofumpt@$(GOFUMPT_VERSION) && \
gofumpt -w ."
Expand Down
Loading

0 comments on commit c551426

Please sign in to comment.