Skip to content

Commit

Permalink
Build: Upgrade Golang version to 1.23.1
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->
Upgrade `go.work` file, kdl-server, repo-cloner, cleaner and gitea-oauth2-setup to Go 1.23. Also all their dockerfiles now use `golang:1.23.1-alpine3.20` as builder.
 

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
Modernize Golang dependencies to ensure platform is not stagnant.

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [X] Other changes (ci configuration, documentation or any other kind of changes)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] I have created tests for my code changes, and the tests are passing.
- [ ] I have executed the pre-commit hooks locally.
- [ ] My change requires a change to the documentation (create a new issue if the documentation has not been updated).
- [ ] I have updated the documentation accordingly.
  • Loading branch information
alexrodfe authored Sep 27, 2024
1 parent d2dc378 commit b1fabf2
Show file tree
Hide file tree
Showing 17 changed files with 244 additions and 236 deletions.
2 changes: 1 addition & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build API.
FROM golang:1.18.3-alpine3.16 as api-builder
FROM golang:1.23.1-alpine3.20 as api-builder
# 1.18

# Pass Hadolint
Expand Down
69 changes: 42 additions & 27 deletions app/api/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ linters-settings:
dupl:
threshold: 100
funlen:
lines: 200
lines: 120
statements: 50
gci:
local-prefixes: github.com/golangci/golangci-lint
sections:
- standard
- default
- prefix(github.com/konstellation-io/kdl-server)
- blank
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -28,14 +32,16 @@ linters-settings:
golint:
min-confidence: 0
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
checks:
- argument
- case
- condition
- operation
- return
- assign
ignored-numbers: []
ignored-files: []
ignored-functions: []
lll:
line-length: 140
maligned:
Expand All @@ -54,17 +60,20 @@ linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- asciicheck
- bodyclose
- depguard
- dogsled
- dupl
- errcheck
- exhaustive
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- err113
- gofmt
- goimports
- goprintffuncname
Expand All @@ -75,31 +84,41 @@ linters:
- lll
- misspell
- nakedret
- nestif
- noctx
- nolintlint
- prealloc
- rowserrcheck
- staticcheck
- stylecheck
- testpackage
- typecheck
- unconvert
- unparam
- unused
- whitespace
- asciicheck
- gochecknoglobals
- gocognit
- godot
- godox
- nestif
- prealloc
- wsl
- testpackage
- goerr113
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test.go
linters:
- gomnd
- goconst
- dupl
- gosec
- gochecknoglobals
- testpackage
- goerr113
- path: _test\.go
linters:
- gomnd
- goconst
- dupl
- gosec
- gochecknoglobals
- testpackage
- goerr113
# https://github.com/go-critic/go-critic/issues/926
- linters:
- gocritic
Expand Down Expand Up @@ -129,10 +148,6 @@ issues:
- Potential file inclusion via variable
# EXC0011 stylecheck: Annoying issue about not having a comment. The rare codebase has such comments
- (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)
# EXC0012 gosec: Use of net/http's ListenAndServe function has no support for setting timeouts
- Use of net/http serve function that has no support for setting timeouts

run:
skip-dirs:
exclude-dirs:
- test_krt
- scripts
29 changes: 14 additions & 15 deletions app/api/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/konstellation-io/kdl-server/app/api

go 1.18
go 1.23.1

require (
code.gitea.io/sdk/gitea v0.14.1
Expand All @@ -15,8 +15,8 @@ require (
github.com/minio/minio-go/v7 v7.0.49
github.com/stretchr/testify v1.8.2
github.com/vektah/gqlparser/v2 v2.5.1
go.mongodb.org/mongo-driver v1.4.6
golang.org/x/crypto v0.6.0
go.mongodb.org/mongo-driver v1.17.0
golang.org/x/crypto v0.26.0
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.18.18
Expand All @@ -29,16 +29,14 @@ require (
github.com/ProtonMail/go-crypto v0.0.0-20220113124808-70ae35bab23f // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/aws/aws-sdk-go v1.34.28 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.0 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gnostic v0.1.0 // indirect
Expand All @@ -47,7 +45,6 @@ require (
github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.1.0 // indirect
github.com/klauspost/compress v1.15.15 // indirect
Expand All @@ -58,21 +55,23 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be // indirect
github.com/rs/xid v1.4.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xanzy/ssh-agent v0.3.1 // indirect
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
google.golang.org/appengine v1.5.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
Expand Down
Loading

0 comments on commit b1fabf2

Please sign in to comment.