Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 4 additions & 4 deletions .github/workflows/tang-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.22"
go-version: "1.24"
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
with:
version: v1.60.3
version: v2.4.0
skip-go-installation: true
args: --timeout=5m
gotest:
Expand All @@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.22"
go-version: "1.24"
- name: start pulp
uses: isbang/compose-action@v2.0.2
with:
Expand Down
41 changes: 31 additions & 10 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
# Configuration for golangci-lint. See https://golangci-lint.run/usage/configuration/.
version: "2"
linters:
disable-all: false # use default linters
enable:
- gofmt
- whitespace
- govet
- misspell
- bodyclose
- forcetypeassert
- gosec
- misspell
- whitespace
settings:
gosec:
excludes:
- G404
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- path: (.+)\.go$
text: composite
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- bodyclose
issues:
exclude:
- composite
- gofmt
exclusions:
generated: lax
paths:
- third_party$
- builtin$
48 changes: 20 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,48 +1,40 @@
module github.com/content-services/tang

go 1.22.0

toolchain go1.22.4
go 1.24.0

require (
github.com/content-services/zest/release/v2024 v2024.11.1731697894
github.com/content-services/zest/release/v2024 v2024.12.1734541842
github.com/google/uuid v1.6.0
github.com/jackc/pgx-zerolog v0.0.0-20230315001418-f978528409eb
github.com/jackc/pgx/v5 v5.7.1
github.com/rs/zerolog v1.33.0
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f
github.com/jackc/pgx/v5 v5.7.6
github.com/rs/zerolog v1.34.0
github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1
golang.org/x/exp v0.0.0-20250911091902-df9299821621
)

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/sagikazarmark/locafero v0.12.0 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.42.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/text v0.29.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
147 changes: 41 additions & 106 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/zestwrapper/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (r *RpmZest) LookupDomain(name string) (string, error) {
if len(list.Results) == 0 {
return "", nil
} else if list.Results[0].PulpHref == nil {
return "", fmt.Errorf("Unexpectedly got a nil href for domain %v", name)
return "", fmt.Errorf("unexpectedly got a nil href for domain %v", name)
} else {
return *list.Results[0].PulpHref, nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/tangy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/rs/zerolog"
)

const DefaultMaxPoolLimit = 20
const DefaultMaxPoolLimit int32 = 20

// Logger configuration options for logger
type Logger struct {
Expand All @@ -23,7 +23,7 @@ type Database struct {
User string
Password string
CACertPath string `mapstructure:"ca_cert_path"`
PoolLimit int `mapstructure:"pool_limit"`
PoolLimit int32 `mapstructure:"pool_limit"`
}

// Url return url of database
Expand Down
2 changes: 1 addition & 1 deletion pkg/tangy/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func New(dbConfig Database, logConfig Logger) (Tangy, error) {
if dbConfig.PoolLimit == 0 {
dbConfig.PoolLimit = DefaultMaxPoolLimit
}
pxConfig.MaxConns = int32(dbConfig.PoolLimit)
pxConfig.MaxConns = dbConfig.PoolLimit
Copy link
Collaborator

@rverdile rverdile Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works! but changing types here will also require changes in the backend. Let's fix this linting issue by checking the int max, instead of changing the type of dbConfig.PoolLimit to int32, like this: https://github.com/content-services/content-sources-backend/blob/93863b503e71c6bb93e10f1b2239887efc476c86/pkg/tasks/queue/pgqueue.go#L218-L220


if logConfig.Logger != nil && logConfig.Enabled {
zlog := zerologadapter.NewLogger(*logConfig.Logger)
Expand Down
2 changes: 1 addition & 1 deletion pkg/tangy/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package tangy

import (
"fmt"
"math/rand/v2"
"strings"

"github.com/jackc/pgx/v5"
"golang.org/x/exp/rand"
)

// contentIdsInVersion forms a single query to fetch a list of content ids in a repository version
Expand Down
Loading