Skip to content

Commit a702b68

Browse files
authored
Housekeeping/bring up to date (#281)
* improved devex * fix types when creating bootstrapping models and creating components * imports reordering and structuring * improved devex * migrate completely to go-resty * configure logging more intuitively * upgraded tests with a full working mock server removing the need for kind * type fixes, deprecation fixes * clightly better logging * mass upgrade of dependencies * updated permissions in github workflows * updated gitignore * updated docs * remove golangci-lint for the time being it is having many false positives * fixed github actions
1 parent dbb0928 commit a702b68

33 files changed

Lines changed: 1571 additions & 506 deletions

.github/workflows/build.yml

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,19 @@ on:
2424
workflow_dispatch:
2525

2626
env:
27-
GO_VERSION: "1.20"
28-
KIND_VERSION: "v0.11.1"
27+
GO_VERSION: "1.25"
2928

3029
jobs:
3130
verify-code:
3231
name: Verify code
33-
runs-on: ubuntu-20.04
32+
runs-on: ubuntu-latest
3433
steps:
3534
- name: Setup Go
36-
uses: actions/setup-go@v5
35+
uses: actions/setup-go@v6
3736
with:
3837
go-version: ${{ env.GO_VERSION }}
3938
- name: Checkout code
40-
uses: actions/checkout@v4
39+
uses: actions/checkout@v5
4140
- name: Cached Go dependencies
4241
uses: actions/cache@v4
4342
with:
@@ -46,74 +45,55 @@ jobs:
4645
restore-keys: |
4746
${{ runner.os }}-go-
4847
- name: Verify Go code
49-
uses: golangci/golangci-lint-action@v6.0.1
48+
uses: golangci/golangci-lint-action@v8.0.0
5049
with:
5150
args: --verbose
5251
version: latest
53-
skip-pkg-cache: true
54-
skip-build-cache: true
52+
skip-cache: true
5553
- name: Vendor Go modules
5654
run: go mod vendor
5755
tests:
5856
name: Run tests
5957
needs:
6058
- verify-code
61-
runs-on: ubuntu-20.04
62-
environment: "GITHUB CI"
59+
runs-on: ubuntu-latest
6360
timeout-minutes: 15
6461
steps:
6562
- name: Setup Go
66-
uses: actions/setup-go@v5
63+
uses: actions/setup-go@v6
6764
with:
6865
go-version: ${{ env.GO_VERSION }}
6966
- name: Checkout code
70-
uses: actions/checkout@v4
67+
uses: actions/checkout@v5
7168
- uses: actions/cache@v4
7269
with:
7370
path: ~/go/pkg/mod
7471
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
7572
restore-keys: |
7673
${{ runner.os }}-go-
77-
- name: Setup Kubernetes cluster (KIND)
78-
uses: helm/kind-action@v1.10.0
79-
with:
80-
version: ${{ env.KIND_VERSION }}
81-
cluster_name: kind-test
82-
- name: Test connection to Kubernetes cluster
83-
run: |
84-
kubectl cluster-info
85-
kubectl wait --for=condition=Ready nodes --all --timeout=300s
86-
kubectl describe node
8774
- name: Run tests
8875
run: |
8976
make all-tests
90-
env:
91-
KUBECONFIG: /home/runner/.kube/config
92-
ARDOQ_BASEURI: ${{ secrets.ARDOQ_BASEURI }}
93-
ARDOQ_ORG: ${{ secrets.ARDOQ_ORG }}
94-
ARDOQ_WORKSPACE_ID: ${{ secrets.ARDOQ_WORKSPACE_ID }}
95-
ARDOQ_APIKEY: ${{ secrets.ARDOQ_APIKEY }}
96-
ARDOQ_CLUSTER: ${{ secrets.ARDOQ_CLUSTER }}
9777
release-snapshot:
9878
name: Release unversioned snapshot
9979
needs:
10080
- tests
101-
runs-on: ubuntu-20.04
81+
runs-on: ubuntu-latest
10282
steps:
10383
- name: Setup Go
104-
uses: actions/setup-go@v5
84+
uses: actions/setup-go@v6
10585
with:
10686
go-version: ${{ env.GO_VERSION }}
10787
- name: Checkout code
108-
uses: actions/checkout@v4
88+
uses: actions/checkout@v5
10989
- uses: actions/cache@v4
11090
with:
11191
path: ~/go/pkg/mod
11292
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
11393
restore-keys: |
11494
${{ runner.os }}-go-
11595
- name: Release snapshot
116-
uses: goreleaser/goreleaser-action@v5
96+
uses: goreleaser/goreleaser-action@v6
11797
with:
11898
version: v1.1.0
11999
args: release --snapshot --skip-publish --rm-dist

.github/workflows/publish-chart.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,48 +15,40 @@ on:
1515
workflow_dispatch:
1616

1717
env:
18-
KIND_VERSION: "v0.11.1"
1918
CHART_DIR: helm/chart
2019

20+
permissions:
21+
contents: write
22+
2123
jobs:
2224
test-helm-chart:
2325
name: Test Helm Chart
24-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-latest
2527
steps:
2628
- name: Checkout
27-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
2830
with:
2931
fetch-depth: 0
3032
- name: Install Helm
3133
uses: azure/setup-helm@v3.3
3234
with:
3335
version: v3.5.0
3436
- name: Set up python
35-
uses: actions/setup-python@v5
37+
uses: actions/setup-python@v6
3638
with:
3739
python-version: 3.7
3840
- name: Setup Chart Linting
3941
id: lint
4042
uses: helm/chart-testing-action@v2.6.1
41-
# - name: Setup Kubernetes cluster (KIND)
42-
# uses: helm/kind-action@v1.2.0
43-
# with:
44-
# version: ${{ env.KIND_VERSION }}
45-
# cluster_name: kind-test
46-
# - name: Test connection to Kubernetes cluster
47-
# run: |
48-
# kubectl cluster-info
49-
# kubectl wait --for=condition=Ready nodes --all --timeout=300s
50-
# kubectl describe node
5143
- name: Run chart-testing
5244
run: ct lint --validate-maintainers=false --charts ${{ env.CHART_DIR }}
5345
publish:
5446
name: Release Helm Chart
5547
needs:
5648
- test-helm-chart
57-
runs-on: ubuntu-20.04
49+
runs-on: ubuntu-latest
5850
steps:
59-
- uses: actions/checkout@v4
51+
- uses: actions/checkout@v5
6052
- id: package
6153
name: Package charts
6254
run: |

.github/workflows/release.yml

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,46 @@ on:
88
push:
99
tags:
1010
- "v*"
11+
12+
permissions:
13+
contents: write
14+
1115
env:
12-
GO_VERSION: "1.20"
13-
KIND_VERSION: "v0.11.1"
16+
GO_VERSION: "1.25"
1417

1518
jobs:
1619
tests:
1720
name: Run tests
18-
runs-on: ubuntu-20.04
19-
environment: "GITHUB CI"
21+
runs-on: ubuntu-latest
2022
timeout-minutes: 15
2123
steps:
2224
- name: Setup Go
23-
uses: actions/setup-go@v5
25+
uses: actions/setup-go@v6
2426
with:
2527
go-version: ${{ env.GO_VERSION }}
2628
- name: Checkout code
27-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
2830
- uses: actions/cache@v4
2931
with:
3032
path: ~/go/pkg/mod
3133
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
3234
restore-keys: |
3335
${{ runner.os }}-go-
34-
- name: Setup Kubernetes cluster (KIND)
35-
uses: helm/kind-action@v1.10.0
36-
with:
37-
version: ${{ env.KIND_VERSION }}
38-
cluster_name: kind-test
39-
- name: Test connection to Kubernetes cluster
40-
run: |
41-
kubectl cluster-info
42-
kubectl wait --for=condition=Ready nodes --all --timeout=300s
43-
kubectl describe node
4436
- name: Run tests
4537
run: |
4638
make all-tests
47-
env:
48-
KUBECONFIG: /home/runner/.kube/config
49-
ARDOQ_BASEURI: ${{ secrets.ARDOQ_BASEURI }}
50-
ARDOQ_ORG: ${{ secrets.ARDOQ_ORG }}
51-
ARDOQ_WORKSPACE_ID: ${{ secrets.ARDOQ_WORKSPACE_ID }}
52-
ARDOQ_APIKEY: ${{ secrets.ARDOQ_APIKEY }}
53-
ARDOQ_CLUSTER: ${{ secrets.ARDOQ_CLUSTER }}
5439
release:
5540
name: Release
5641
needs:
5742
- tests
58-
runs-on: ubuntu-20.04
59-
environment: "GITHUB CI"
43+
runs-on: ubuntu-latest
6044
steps:
6145
- name: Setup Go
62-
uses: actions/setup-go@v5
46+
uses: actions/setup-go@v6
6347
with:
6448
go-version: ${{ env.GO_VERSION }}
6549
- name: Checkout code
66-
uses: actions/checkout@v4
50+
uses: actions/checkout@v5
6751
with:
6852
fetch-depth: 0
6953
- name: Set output
@@ -88,15 +72,15 @@ jobs:
8872
username: ${{ secrets.DOCKERHUB_USER }}
8973
password: ${{ secrets.DOCKERHUB_TOKEN }}
9074
- name: Push to Dockerhub
91-
uses: docker/build-push-action@v5
75+
uses: docker/build-push-action@v6
9276
with:
9377
context: .
9478
builder: ${{ steps.buildx.outputs.name }}
9579
platforms: linux/amd64,linux/arm64
9680
push: true
9781
tags: ardoq/k8s-ardoq-bridge:latest,ardoq/k8s-ardoq-bridge:${{ steps.vars.outputs.tag }}
9882
- name: Release
99-
uses: goreleaser/goreleaser-action@v5
83+
uses: goreleaser/goreleaser-action@v6
10084
with:
10185
version: v1.1.0
10286
args: release --rm-dist

.github/workflows/test-chart.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,38 +18,27 @@ on:
1818
workflow_dispatch:
1919

2020
env:
21-
KIND_VERSION: "v0.11.1"
2221
CHART_DIR: helm/chart
2322

2423
jobs:
2524
test-helm-chart:
2625
name: Test Helm Chart
27-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-latest
2827
steps:
2928
- name: Checkout
30-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3130
with:
3231
fetch-depth: 0
3332
- name: Install Helm
3433
uses: azure/setup-helm@v3.3
3534
with:
3635
version: v3.5.0
3736
- name: Set up python
38-
uses: actions/setup-python@v5
37+
uses: actions/setup-python@v6
3938
with:
4039
python-version: 3.7
4140
- name: Setup Chart Linting
4241
id: lint
4342
uses: helm/chart-testing-action@v2.6.1
44-
# - name: Setup Kubernetes cluster (KIND)
45-
# uses: helm/kind-action@v1.2.0
46-
# with:
47-
# version: ${{ env.KIND_VERSION }}
48-
# cluster_name: kind-test
49-
# - name: Test connection to Kubernetes cluster
50-
# run: |
51-
# kubectl cluster-info
52-
# kubectl wait --for=condition=Ready nodes --all --timeout=300s
53-
# kubectl describe node
5443
- name: Run chart-testing
5544
run: ct lint --validate-maintainers=false --charts ${{ env.CHART_DIR }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ devspace*
1212
.env
1313
#ignore sonarqube scanner
1414
.scannerwork
15+
app

.golangci.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
version: "2"
2+
13
run:
24
concurrency: 4
35
timeout: 5m
4-
tests: false
6+
tests: true
57
allow-parallel-runners: true
6-
go: '1.18'
7-
skip-dirs:
8-
- lib/
8+
go: '1.25'
99
linters:
10+
default: standard
1011
enable:
11-
- errorlint
12-
- govet
12+
- ginkgolinter
1313
disable:
14-
- gosimple
1514
- ineffassign
1615
- staticcheck
16+
issues:
17+
new: true

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
default_install_hook_types:
2+
- pre-commit
3+
- pre-push
4+
repos:
5+
- repo: https://github.com/gruntwork-io/pre-commit
6+
rev: v0.1.30
7+
hooks:
8+
- id: helmlint
9+
- id: gofmt
10+
# - id: golangci-lint
11+
- repo: https://github.com/gitleaks/gitleaks
12+
rev: v8.28.0
13+
hooks:
14+
- id: gitleaks
15+
name: "🔒 security · Detect hardcoded secrets"
16+
- repo: https://github.com/python-jsonschema/check-jsonschema
17+
rev: 0.31.0
18+
hooks:
19+
- id: check-github-workflows
20+
name: "🐙 github-actions · Validate gh workflow files"
21+
args: ["--verbose"]

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM golang:1.21-alpine as builder
1+
FROM golang:1.25-alpine AS builder
22
RUN mkdir /src
33
WORKDIR /src
4-
ADD . .
4+
COPY . .
55
RUN go build -ldflags "-s -w -X main.version=$(cat VERSION)" -o main .
66

7-
FROM alpine
7+
FROM alpine:3.22
88
COPY --from=builder /src/main /app/
99
COPY bootstrap_*.yaml /app/
1010
WORKDIR /app

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.ONESHELL:
2+
13
VERSION=`cat VERSION`
24
export KUBECONFIG ?= ${HOME}/.kube/config
35

@@ -9,12 +11,21 @@ GINKGO=$(GOBIN)/ginkgo
911

1012
SOURCES := $(shell find . -name '*.go')
1113

14+
#include .env
15+
16+
install-git-hooks:
17+
pre-commit install --hook-type pre-commit --hook-type pre-push
18+
1219
.PHONY: get-ginkgo
1320
## Installs Ginkgo CLI
1421
get-ginkgo:
1522
@go get github.com/onsi/ginkgo/v2/ginkgo/internal@v2
1623
@go install github.com/onsi/ginkgo/v2/ginkgo
1724

25+
bootstrap: get-ginkgo
26+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.5.0
27+
golangci-lint version
28+
1829
.PHONY: k8s-integration-tests
1930
k8s-integration-tests: $(SOURCES) get-ginkgo
2031
@$(GINKGO) -v --show-node-events ./tests/integrations/k8s

0 commit comments

Comments
 (0)