Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump the github-actions-deps group with 4 updates plus newly required lint fixes #3762

Merged
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/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -59,7 +59,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
uses: github/codeql-action/autobuild@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -72,6 +72,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
with:
category: "/language:${{matrix.language}}"
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # v6.5.1
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
with:
version: v1.61.0
version: v2.0.1
args: --timeout=8m
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
uses: github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
with:
sarif_file: results.sarif
10 changes: 5 additions & 5 deletions .github/workflows/test_crdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
check-latest: true
cache: true

- uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # v6.5.1
- uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
with:
version: 'v1.61.0'
version: 'v2.0.1'
args: ./storage/crdb

unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
check-latest: true
Expand All @@ -49,7 +49,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
check-latest: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_pgdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
check-latest: true
cache: true

- uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # v6.5.1
- uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
with:
version: 'v1.61.0'
version: 'v2.0.1'
args: ./storage/postgresql

integration-and-unit-tests:
Expand All @@ -50,7 +50,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version-file: go.mod
check-latest: true
Expand Down
64 changes: 34 additions & 30 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 90s

linters-settings:
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
# TODO(mhutchinson): lower this again after reworking interceptor
min-complexity: 26
depguard:
version: "2"
linters:
settings:
depguard:
rules:
main:
deny:
- pkg: golang.org/x/net/context
- pkg: github.com/gogo/protobuf/proto
gocyclo:
min-complexity: 26
exclusions:
generated: lax
rules:
main:
deny:
- pkg: "golang.org/x/net/context"
- pkg: "github.com/gogo/protobuf/proto"

issues:
# Don't turn off any checks by default. We can do this explicitly if needed.
exclude-use-default: false

exclude-rules:
# The following grpc linters are excluded because grpc.Dial, grpc.DialContext and grpc.WithBlock will be supported throughout 1.x.
- linters: [staticcheck]
text: 'SA1019: grpc.Dial is deprecated: use NewClient instead'
- linters: [staticcheck]
text: 'SA1019: grpc.DialContext is deprecated: use NewClient instead'
- linters: [staticcheck]
text: 'SA1019: grpc.WithBlock is deprecated: this DialOption is not supported by NewClient'

exclude-files:
- types/internal/tls/tls.go
- linters:
- staticcheck
text: 'SA1019: grpc.Dial is deprecated: use NewClient instead'
- linters:
- staticcheck
text: 'SA1019: grpc.DialContext is deprecated: use NewClient instead'
- linters:
- staticcheck
text: 'SA1019: grpc.WithBlock is deprecated: this DialOption is not supported by NewClient'
paths:
- types/internal/tls/tls.go
- third_party$
- builtin$
- examples$
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion experimental/batchmap/cmd/build/mapdemo.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ type mapEntryFn struct {

func (fn *mapEntryFn) ProcessElement(i int64) *batchmap.Entry {
h := hash.New()
h.Write([]byte(fmt.Sprintf("%d", i)))
_, _ = fmt.Fprintf(h, "%d", i)
kbs := h.Sum(nil)
leafID := node.NewID(string(kbs), uint(len(kbs)*8))

Expand Down
2 changes: 1 addition & 1 deletion experimental/batchmap/cmd/verify/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func main() {
// If the map needs to return the values to clients then it is recommended that the
// map operator uses a Content Addressable Store to store these values.
h := hash.New()
h.Write([]byte(fmt.Sprintf("%d", *key)))
_, _ = fmt.Fprintf(h, "%d", *key)
keyPath := h.Sum(nil)
leafID := node.NewID(string(keyPath), uint(len(keyPath)*8))

Expand Down
2 changes: 1 addition & 1 deletion integration/storagetest/logtests.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (*logTests) TestReadWriteTransaction(ctx context.Context, t *testing.T, s s
test.doBefore()
err := s.ReadWriteTransaction(ctx, activeLog, func(ctx context.Context, tx storage.LogTreeTX) error {
root, err := tx.LatestSignedLogRoot(ctx)
if err != nil && !(err == storage.ErrTreeNeedsInit && test.wantNeedsInit) {
if err != nil && (err != storage.ErrTreeNeedsInit || !test.wantNeedsInit) {
t.Fatalf("%v: LatestSignedLogRoot() returned err = %v", test.desc, err)
}
if got, want := root.GetLogRoot(), test.wantLogRoot; !bytes.Equal(got, want) {
Expand Down
2 changes: 1 addition & 1 deletion log/operation_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func (o *OperationManager) getLogsAndExecutePass(ctx context.Context) error {
runCtx, cancel := context.WithTimeout(ctx, o.info.Timeout)
defer cancel()

activeIDs, err := o.info.Registry.LogStorage.GetActiveLogIDs(ctx)
activeIDs, err := o.info.Registry.GetActiveLogIDs(ctx)
if err != nil {
return fmt.Errorf("failed to list active log IDs: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion quota/cacheqm/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (m *manager) evict(ctx context.Context) {
// goroutines must not access the cache, the lock is released before they complete.
wg.Add(1)
go func() {
if err := m.Manager.PutTokens(ctx, b.tokens, []quota.Spec{b.spec}); err != nil {
if err := m.PutTokens(ctx, b.tokens, []quota.Spec{b.spec}); err != nil {
klog.Warningf("Error replenishing tokens from evicted bucket (spec = %+v, bucket = %+v): %v", b.spec, b.bucket, err)
}
wg.Done()
Expand Down
8 changes: 4 additions & 4 deletions server/log_rpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (t *TrillianLogRPCServer) QueueLeaf(ctx context.Context, req *trillian.Queu
req.Leaf.LeafIdentityHash = req.Leaf.MerkleLeafHash
}

ret, err := t.registry.LogStorage.QueueLeaves(trees.NewContext(ctx, tree), tree, []*trillian.LogLeaf{req.Leaf}, t.timeSource.Now())
ret, err := t.registry.QueueLeaves(trees.NewContext(ctx, tree), tree, []*trillian.LogLeaf{req.Leaf}, t.timeSource.Now())
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -156,7 +156,7 @@ func (t *TrillianLogRPCServer) AddSequencedLeaves(ctx context.Context, req *tril
hashLeaves(req.Leaves, hasher)

ctx = trees.NewContext(ctx, tree)
leaves, err := t.registry.LogStorage.AddSequencedLeaves(ctx, tree, req.Leaves, t.timeSource.Now())
leaves, err := t.registry.AddSequencedLeaves(ctx, tree, req.Leaves, t.timeSource.Now())
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -361,7 +361,7 @@ func (t *TrillianLogRPCServer) GetLatestSignedLogRoot(ctx context.Context, req *
return nil, err
}
ctx = trees.NewContext(ctx, tree)
tx, err := t.registry.LogStorage.SnapshotForTree(ctx, tree)
tx, err := t.registry.SnapshotForTree(ctx, tree)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -643,7 +643,7 @@ func spanFor(ctx context.Context, name string) (context.Context, func()) {
}

func (t *TrillianLogRPCServer) snapshotForTree(ctx context.Context, tree *trillian.Tree, method string) (storage.ReadOnlyLogTreeTX, error) {
tx, err := t.registry.LogStorage.SnapshotForTree(ctx, tree)
tx, err := t.registry.SnapshotForTree(ctx, tree)
if err != nil && tx != nil {
// Special case to handle ErrTreeNeedsInit, which leaves the TX open.
// To avoid leaking it make sure it's closed.
Expand Down
2 changes: 1 addition & 1 deletion storage/cloudspanner/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func newTreeInfo(tree *trillian.Tree, treeID int64, now time.Time) (*spannerpb.T
}
info.StorageConfig = &spannerpb.TreeInfo_LogStorageConfig{LogStorageConfig: config}
default:
return nil, fmt.Errorf("Unknown tree type %v", tt)
return nil, fmt.Errorf("unknown tree type %v", tt)
}

return info, nil
Expand Down
12 changes: 6 additions & 6 deletions storage/cloudspanner/storage_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ type cloudSpannerProvider struct {

func configFromFlags() spanner.ClientConfig {
r := spanner.ClientConfig{}
setUint64IfNotDefault(&r.SessionPoolConfig.MaxOpened, *csSessionMaxOpened)
setUint64IfNotDefault(&r.SessionPoolConfig.MinOpened, *csSessionMinOpened)
setUint64IfNotDefault(&r.SessionPoolConfig.MaxIdle, *csSessionMaxIdle)
setIntIfNotDefault(&r.SessionPoolConfig.HealthCheckWorkers, *csSessionHCWorkers)
r.SessionPoolConfig.TrackSessionHandles = *csSessionTrackHandles
r.SessionPoolConfig.HealthCheckInterval = *csSessionHCInterval
setUint64IfNotDefault(&r.MaxOpened, *csSessionMaxOpened)
setUint64IfNotDefault(&r.MinOpened, *csSessionMinOpened)
setUint64IfNotDefault(&r.MaxIdle, *csSessionMaxIdle)
setIntIfNotDefault(&r.HealthCheckWorkers, *csSessionHCWorkers)
r.TrackSessionHandles = *csSessionTrackHandles
r.HealthCheckInterval = *csSessionHCInterval
return r
}

Expand Down
Loading
Loading