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 Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ARG INSTALL_TOOLS=no

# install build, development and test environment
RUN (dnf module enable -y postgresql:16 || curl -o /etc/yum.repos.d/postgresql.repo \
https://copr.fedorainfracloud.org/coprs/g/insights/postgresql-16/repo/epel-9/group_insights-postgresql-16-epel-9.repo) && \
dnf install -y go-toolset postgresql diffutils rpm-devel pg_repack
https://copr.fedorainfracloud.org/coprs/g/insights/postgresql-16/repo/epel-9/group_insights-postgresql-16-epel-9.repo) && \
dnf install -y go-toolset postgresql diffutils rpm-devel pg_repack

ENV GOPATH=/go \
GO111MODULE=on \
Expand All @@ -28,7 +28,7 @@ RUN if [ "$INSTALL_TOOLS" == "yes" ] ; then \
go install github.com/swaggo/swag/cmd/swag@v1.16.4 && \
go install gotest.tools/gotestsum@v1.13.0 && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b $(go env GOPATH)/bin v2.2.2 ; \
| sh -s -- -b $(go env GOPATH)/bin v2.10.1 ; \
fi

ADD --chown=insights:insights dev/kafka/secrets/ca.crt /opt/kafka/
Expand Down
18 changes: 9 additions & 9 deletions base/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ func OnConflictUpdate(db *gorm.DB, key string, updateCols ...string) *gorm.DB {

// Appends `ON CONFLICT (key...) DO UPDATE SET (fields) to following insert query with multiple key fields
func OnConflictUpdateMulti(db *gorm.DB, keys []string, updateCols ...string) *gorm.DB {
confilctColumns := []clause.Column{}
for _, key := range keys {
confilctColumns = append(confilctColumns, clause.Column{Name: key})
conflictColumns := make([]clause.Column, len(keys))
for i, key := range keys {
conflictColumns[i] = clause.Column{Name: key}
}
onConflict := clause.OnConflict{Columns: confilctColumns}
onConflict := clause.OnConflict{Columns: conflictColumns}
if len(updateCols) > 0 {
onConflict.DoUpdates = clause.AssignmentColumns(updateCols)
} else {
Expand All @@ -31,17 +31,17 @@ type UpExpr struct {
}

func OnConflictDoUpdateExpr(db *gorm.DB, keys []string, updateExprs ...UpExpr) *gorm.DB {
updateColsValues := make(map[string]interface{})
updateColsValues := make(map[string]interface{}, len(updateExprs))
for _, v := range updateExprs {
updateColsValues[v.Name] = v.Expr
}
confilctColumns := []clause.Column{}
for _, key := range keys {
confilctColumns = append(confilctColumns, clause.Column{Name: key})
conflictColumns := make([]clause.Column, len(keys))
for i, key := range keys {
conflictColumns[i] = clause.Column{Name: key}
}
if len(updateColsValues) > 0 {
return db.Clauses(clause.OnConflict{
Columns: confilctColumns,
Columns: conflictColumns,
DoUpdates: clause.Assignments(updateColsValues),
})
}
Expand Down
2 changes: 1 addition & 1 deletion base/database/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type PostgreSQLConfig struct {
Port int
User string
Database string
Passwd string
Passwd string // #nosec G117
SSLMode string
SSLRootCert string
Debug bool
Expand Down
2 changes: 2 additions & 0 deletions base/utils/awscloudwatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import (
"os"
"time"

// nolint: staticcheck
"github.com/aws/aws-sdk-go/aws"
// nolint: staticcheck
"github.com/aws/aws-sdk-go/aws/credentials"
lc "github.com/redhatinsights/platform-go-middlewares/logging/cloudwatch"
log "github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion base/utils/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func CallAPI(client *http.Client, request *http.Request, debugEnabled bool) (*ht
LogDebug("dump", fmt.Sprintf("\n%s\n", string(dump)), "http call")
}

resp, err := client.Do(request)
resp, err := client.Do(request) // #nosec G704
if err != nil {
return resp, err
}
Expand Down
54 changes: 27 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module app

go 1.24.10
go 1.25.7

require (
github.com/MichaelMraka/gorpm v0.0.0-20251128174203-65cf25f01bac
github.com/aws/aws-sdk-go v1.55.7
github.com/aws/aws-sdk-go v1.55.8
github.com/bytedance/sonic v1.15.0
github.com/getkin/kin-openapi v0.133.0
github.com/gin-contrib/timeout v1.0.2
github.com/gin-gonic/gin v1.11.0
github.com/gin-contrib/timeout v1.1.0
github.com/gin-gonic/gin v1.12.0
github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1
github.com/golang-migrate/migrate/v4 v4.19.1
github.com/google/uuid v1.6.0
Expand All @@ -20,18 +20,18 @@ require (
github.com/pkg/errors v0.9.1
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/project-kessel/kessel-sdk-go v1.4.0
github.com/prometheus/client_golang v1.23.0
github.com/prometheus/client_golang v1.23.2
github.com/redhatinsights/app-common-go v1.6.9
github.com/redhatinsights/platform-go-middlewares v1.0.0
github.com/segmentio/kafka-go v0.4.50
github.com/sirupsen/logrus v1.9.4
github.com/stretchr/testify v1.11.1
github.com/swaggo/files v1.0.1
github.com/swaggo/gin-swagger v1.6.1
github.com/zsais/go-gin-prometheus v0.1.0
github.com/zsais/go-gin-prometheus v1.0.3
go.uber.org/automaxprocs v1.6.0
go.uber.org/ratelimit v0.3.1
golang.org/x/exp v0.0.0-20260112195511-716be5621a96
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa
google.golang.org/grpc v1.79.1
gorm.io/driver/postgres v1.6.0
gorm.io/gorm v1.31.1
Expand All @@ -56,16 +56,16 @@ require (
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.22.4 // indirect
github.com/go-openapi/jsonreference v0.21.4 // indirect
github.com/go-openapi/spec v0.22.3 // indirect
github.com/go-openapi/swag/conv v0.25.4 // indirect
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
github.com/go-openapi/swag/loading v0.25.4 // indirect
github.com/go-openapi/swag/stringutils v0.25.4 // indirect
github.com/go-openapi/swag/typeutils v0.25.4 // indirect
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
github.com/go-openapi/jsonpointer v0.22.5 // indirect
github.com/go-openapi/jsonreference v0.21.5 // indirect
github.com/go-openapi/spec v0.22.4 // indirect
github.com/go-openapi/swag/conv v0.25.5 // indirect
github.com/go-openapi/swag/jsonname v0.25.5 // indirect
github.com/go-openapi/swag/jsonutils v0.25.5 // indirect
github.com/go-openapi/swag/loading v0.25.5 // indirect
github.com/go-openapi/swag/stringutils v0.25.5 // indirect
github.com/go-openapi/swag/typeutils v0.25.5 // indirect
github.com/go-openapi/swag/yamlutils v0.25.5 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.30.1 // indirect
Expand Down Expand Up @@ -100,7 +100,7 @@ require (
github.com/pierrec/lz4/v4 v4.1.25 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.5 // indirect
github.com/prometheus/procfs v0.19.2 // indirect
github.com/prometheus/procfs v0.20.1 // indirect
github.com/quic-go/qpack v0.6.0 // indirect
github.com/quic-go/quic-go v0.59.0 // indirect
github.com/swaggo/swag v1.16.6 // indirect
Expand All @@ -111,27 +111,27 @@ require (
github.com/xdg-go/scram v1.2.0 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/zitadel/logging v0.7.0 // indirect
github.com/zitadel/oidc/v3 v3.45.4 // indirect
github.com/zitadel/oidc/v3 v3.45.5 // indirect
github.com/zitadel/schema v1.3.2 // indirect
go.mongodb.org/mongo-driver/v2 v2.5.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel v1.40.0 // indirect
go.opentelemetry.io/otel/metric v1.40.0 // indirect
go.opentelemetry.io/otel/trace v1.40.0 // indirect
go.opentelemetry.io/otel v1.41.0 // indirect
go.opentelemetry.io/otel/metric v1.41.0 // indirect
go.opentelemetry.io/otel/trace v1.41.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/mock v0.6.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.24.0 // indirect
golang.org/x/crypto v0.48.0 // indirect
golang.org/x/mod v0.33.0 // indirect
golang.org/x/net v0.49.0 // indirect
golang.org/x/net v0.51.0 // indirect
golang.org/x/oauth2 v0.35.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/text v0.34.0 // indirect
golang.org/x/tools v0.41.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect
golang.org/x/tools v0.42.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Expand Down
Loading
Loading