Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.24.11'
go-version: '1.25.9'
- uses: actions/checkout@v4.1.3
#- name: download libraries
# run: go mod download
Expand All @@ -32,7 +32,7 @@ jobs:
# Caching conflicts happen in GHA, so just disable for now
skip-cache: true
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.64.2
version: v2.11.4
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
- uses: actions/checkout@v4.1.3
- uses: actions/setup-go@v5
with:
go-version: '1.24.11'
go-version: '1.25.9'
- name: Verify image builds
run: |
docker build --tag infrawatch/sg-core:latest --file build/Dockerfile .
Expand Down
53 changes: 12 additions & 41 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,65 +1,36 @@
version: 2

issues:
exclude-rules:
- linters:
- errcheck
text: "[a-zA-Z]+.[a-zA-Z]+.(Error|Info|Debug|Warn)" # from logger
- text: "[A-Z]+" #omit enums
linters:
- deadcode
- text: New
linters:
- deadcode
- linters:
- staticcheck
# https://staticcheck.io/docs/checks#SA4008 (The variable in the loop condition never changes, are you incrementing the wrong variable?)
text: "SA4008:"
# Don't warn on unused parameters.
# Parameter names are useful; replacing them with '_' is undesirable.
- linters: [revive]
text: 'unused-parameter: parameter \S+ seems to be unused, consider removing or renaming it as _'
- linters: [revive]
text: 'redefines-builtin-id: redefinition of the built-in function new'
- linters: [revive]
text: 'redefines-builtin-id: redefinition of the built-in function len'
exclude-dirs:
- plugins/transport/dummy-alertmanager
- plugins/transport/dummy-events
- plugins/transport/dummy-metrics
- plugins/transport/dummy-logs
- plugins/application/print
- devenv

linters:
disable-all: true
disable:
# Disabled linters override golangci-lint v2 defaults
- errcheck # Many unchecked errors in existing codebase
- staticcheck # Code simplification suggestions
# Additional disabled linters
- gosec # Security warnings in test/dummy code
- noctx # Legacy code without context
- revive # Many style issues in existing codebase
enable:
- bodyclose
# - depguard
- copyloopvar
- dogsled
- dupl
- errcheck
# - exhaustive
- copyloopvar
# - gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- noctx
- nolintlint
- revive
- staticcheck
- stylecheck
- typecheck
# - unused
- unconvert
# NOTE: not all application plugins use ability to emit internal events through
# passed bus function in it's constructor.
# - unparam
# - whitespace
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY . $D/
COPY build/repos/opstools.repo /etc/yum.repos.d/CentOS-OpsTools.repo

RUN dnf install golang git qpid-proton-c-devel -y --setopt=tsflags=nodocs
RUN go install golang.org/dl/go1.24.11@latest && /go/bin/go1.24.11 download && PRODUCTION_BUILD=false CONTAINER_BUILD=true GOCMD=/go/bin/go1.24.11 ./build.sh
RUN go install golang.org/dl/go1.25.9@latest && /go/bin/go1.25.9 download && PRODUCTION_BUILD=false CONTAINER_BUILD=true GOCMD=/go/bin/go1.25.9 ./build.sh

# --- end build, create smart gateway layer ---
FROM registry.access.redhat.com/ubi9-minimal:latest
Expand Down
6 changes: 3 additions & 3 deletions ci/integration/logging/run_sg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ dnf install -y git golang gcc make qpid-proton-c-devel
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

go install golang.org/dl/go1.24.11@latest
go1.24.11 download
go install golang.org/dl/go1.25.9@latest
go1.25.9 download

# install sg-core and start sg-core
mkdir -p /usr/lib64/sg-core
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.24.11 BUILD_ARGS=-buildvcs=false ./build.sh
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.25.9 BUILD_ARGS=-buildvcs=false ./build.sh

./sg-core -config ./ci/integration/logging/sg_config.yaml
6 changes: 3 additions & 3 deletions ci/integration/metrics/ceilometer/bridge/run_sg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ dnf install -y git golang gcc make qpid-proton-c-devel
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

go install golang.org/dl/go1.24.11@latest
go1.24.11 download
go install golang.org/dl/go1.25.9@latest
go1.25.9 download

# install sg-core and start sg-core
mkdir -p /usr/lib64/sg-core
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.24.11 BUILD_ARGS=-buildvcs=false ./build.sh
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.25.9 BUILD_ARGS=-buildvcs=false ./build.sh

./sg-core -config ./ci/integration/metrics/ceilometer/bridge/sg_config.yaml
6 changes: 3 additions & 3 deletions ci/integration/metrics/ceilometer/tcp/run_sg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ dnf install -y git golang gcc make qpid-proton-c-devel
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

go install golang.org/dl/go1.24.11@latest
go1.24.11 download
go install golang.org/dl/go1.25.9@latest
go1.25.9 download

# install sg-core and start sg-core
mkdir -p /usr/lib64/sg-core
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.24.11 BUILD_ARGS=-buildvcs=false ./build.sh
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.25.9 BUILD_ARGS=-buildvcs=false ./build.sh

./sg-core -config ./ci/integration/metrics/ceilometer/tcp/sg_config.yaml
6 changes: 3 additions & 3 deletions ci/integration/metrics/collectd/run_sg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ dnf install -y git golang gcc make qpid-proton-c-devel
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

go install golang.org/dl/go1.24.11@latest
go1.24.11 download
go install golang.org/dl/go1.25.9@latest
go1.25.9 download

# install sg-core and start sg-core
mkdir -p /usr/lib64/sg-core
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.24.11 BUILD_ARGS=-buildvcs=false ./build.sh
PLUGIN_DIR=/usr/lib64/sg-core/ GOCMD=go1.25.9 BUILD_ARGS=-buildvcs=false ./build.sh

./sg-core -config ./ci/integration/metrics/collectd/sg_config.yaml
6 changes: 3 additions & 3 deletions ci/unit/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ yum install -y git golang gcc make glibc-langpack-en qpid-proton-c-devel
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

go install golang.org/dl/go1.24.11@latest
go1.24.11 download
go install golang.org/dl/go1.25.9@latest
go1.25.9 download


go1.24.11 test -v -coverprofile=profile.cov ./...
go1.25.9 test -v -coverprofile=profile.cov ./...
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/infrawatch/sg-core

go 1.24.11
go 1.25.9

require (
collectd.org v0.5.0
Expand Down
Loading