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

build: set min build version to Go 1.22.6 #9007

Merged
merged 4 commits into from
Aug 20, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env:
# /dev.Dockerfile
# /make/builder.Dockerfile
# /.github/workflows/release.yml
GO_VERSION: 1.22.5
GO_VERSION: 1.22.6
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's now also a version in the main Makefile, which is used to check all other versions (see linter failure). So I think we could remove the above comments now, since the linter will catch any version that's not updated but should be (with one exception, we'll want to pin the version of the linter base image, as that can cause issues).

Copy link
Member Author

Choose a reason for hiding this comment

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

SGTM


jobs:
########################
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ defaults:

env:
# If you change this value, please change it in the following files as well:
# /.travis.yml
# /Dockerfile
# /dev.Dockerfile
# /make/builder.Dockerfile
# /.github/workflows/main.yml
GO_VERSION: 1.22.5
GO_VERSION: 1.22.6

jobs:
main:
Expand Down
63 changes: 34 additions & 29 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
run:
# timeout for analysis
deadline: 10m
go: "1.22.6"

# Skip autogenerated files for mobile and gRPC as well as copied code for
# internal use.
skip-files:
- "mobile\\/.*generated\\.go"
- "\\.pb\\.go$"
- "\\.pb\\.gw\\.go$"
- "internal\\/musig2v040"

skip-dirs:
- channeldb/migration_01_to_11
- channeldb/migration/lnwire21
# Abort after 10 minutes.
timeout: 10m

build-tags:
- autopilotrpc
Expand Down Expand Up @@ -57,7 +47,6 @@ linters-settings:
- G306 # Poor file permissions used when writing to a new file.

staticcheck:
go: "1.22.5"
checks: ["-SA1019"]

lll:
Expand Down Expand Up @@ -131,25 +120,15 @@ linters:
- gochecknoinits

# Deprecated linters. See https://golangci-lint.run/usage/linters/.
- interfacer
- golint
- maligned
- scopelint
- exhaustivestruct
- bodyclose
- contextcheck
- nilerr
- noctx
- rowserrcheck
- sqlclosecheck
- structcheck
- tparallel
- unparam
- wastedassign
- ifshort
- varcheck
- deadcode
- nosnakecase


# Disable gofumpt as it has weird behavior regarding formatting multiple
Expand Down Expand Up @@ -189,7 +168,7 @@ linters:
- wrapcheck

# Allow dynamic errors.
- goerr113
- err113

# We use ErrXXX instead.
- errname
Expand All @@ -205,15 +184,41 @@ linters:
# The linter is too aggressive and doesn't add much value since reviewers
# will also catch magic numbers that make sense to extract.
- gomnd
- mnd

# Some of the tests cannot be parallelized. On the other hand, we don't
# gain much performance with this check so we disable it for now until
# unit tests become our CI bottleneck.
# Some of the tests cannot be parallelized. On the other hand, we don't
# gain much performance with this check so we disable it for now until
# unit tests become our CI bottleneck.
- paralleltest

# New linters that we haven't had time to address yet.
- testifylint
- perfsprint
- inamedparam
- copyloopvar
- tagalign
- protogetter
- revive
- depguard
- gosmopolitan
- intrange


Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: an alternative way is to update new-from-rev: whenever we enable new linters - it may be helpful to reduce the rebase conflicts for other PRs.

issues:
# Only show newly introduced problems.
new-from-rev: 8c66353e4c02329abdacb5a8df29998035ec2e24
new-from-rev: 77c7f776d5cbf9e147edc81d65ae5ba177a684e5

# Skip autogenerated files for mobile and gRPC as well as copied code for
# internal use.
skip-files:
- "mobile\\/.*generated\\.go"
- "\\.pb\\.go$"
- "\\.pb\\.gw\\.go$"
- "internal\\/musig2v040"

skip-dirs:
- channeldb/migration_01_to_11
- channeldb/migration/lnwire21

exclude-rules:
# Exclude gosec from running for tests so that tests with weak randomness
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# /make/builder.Dockerfile
# /.github/workflows/main.yml
# /.github/workflows/release.yml
FROM golang:1.22.5-alpine as builder
FROM golang:1.22.6-alpine as builder

# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
# queries required to connect to linked containers succeed.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ endif
# GO_VERSION is the Go version used for the release build, docker files, and
# GitHub Actions. This is the reference version for the project. All other Go
# versions are checked against this version.
GO_VERSION = 1.22.5
GO_VERSION = 1.22.6

GOBUILD := $(LOOPVARFIX) go build -v
GOINSTALL := $(LOOPVARFIX) go install -v
Expand Down
2 changes: 1 addition & 1 deletion channeldb/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,7 @@ func TestStressTestChannelGraphAPI(t *testing.T) {
methodsMu.Unlock()

err := fn()
require.NoErrorf(t, err, fmt.Sprintf(name))
require.NoErrorf(t, err, name)
}
})
}
Expand Down
8 changes: 5 additions & 3 deletions contractcourt/channel_arbitrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1982,9 +1982,11 @@ func (c *ChannelArbitrator) isPreimageAvailable(hash lntypes.Hash) (bool,
// have the incoming contest resolver decide that we don't want to
// settle this invoice.
invoice, err := c.cfg.Registry.LookupInvoice(context.Background(), hash)
switch err {
case nil:
case invoices.ErrInvoiceNotFound, invoices.ErrNoInvoicesCreated:
switch {
case err == nil:
case errors.Is(err, invoices.ErrInvoiceNotFound) ||
errors.Is(err, invoices.ErrNoInvoicesCreated):

return false, nil
default:
return false, err
Expand Down
3 changes: 2 additions & 1 deletion contractcourt/mock_htlcnotifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ type mockHTLCNotifier struct {
}

func (m *mockHTLCNotifier) NotifyFinalHtlcEvent(key models.CircuitKey,
info channeldb.FinalHtlcInfo) { //nolint:whitespace
info channeldb.FinalHtlcInfo) {

}
2 changes: 1 addition & 1 deletion dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# /make/builder.Dockerfile
# /.github/workflows/main.yml
# /.github/workflows/release.yml
FROM golang:1.22.5-alpine as builder
FROM golang:1.22.6-alpine as builder

LABEL maintainer="Olaoluwa Osuntokun <laolu@lightning.engineering>"

Expand Down
2 changes: 1 addition & 1 deletion docker/btcd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.5-alpine as builder
FROM golang:1.22.6-alpine as builder

LABEL maintainer="Olaoluwa Osuntokun <laolu@lightning.engineering>"

Expand Down
6 changes: 3 additions & 3 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ the following commands for your OS:
<summary>Linux (x86-64)</summary>

```
wget https://dl.google.com/go/go1.22.5.linux-amd64.tar.gz
wget https://dl.google.com/go/go1.22.6.linux-amd64.tar.gz
sha256sum go1.22.5.linux-amd64.tar.gz | awk -F " " '{ print $1 }'
```

The final output of the command above should be
`904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0`. If it
`999805bed7d9039ec3da1a53bfbcafc13e367da52aa823cb60b68ba22d44c616`. If it
isn't, then the target REPO HAS BEEN MODIFIED, and you shouldn't install
this version of Go. If it matches, then proceed to install Go:
```
Expand All @@ -123,7 +123,7 @@ the following commands for your OS:
```

The final output of the command above should be
`8c4587cf3e63c9aefbcafa92818c4d9d51683af93ea687bf6c7508d6fa36f85e`. If it
`b566484fe89a54c525dd1a4cbfec903c1f6e8f0b7b3dbaf94c79bc9145391083`. If it
isn't, then the target REPO HAS BEEN MODIFIED, and you shouldn't install
this version of Go. If it matches, then proceed to install Go:
```
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,6 @@ replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-d

// If you change this please also update .github/pull_request_template.md,
// docs/INSTALL.md and GO_IMAGE in lnrpc/gen_protos_docker.sh.
go 1.21.4
go 1.22.6

retract v0.0.2
2 changes: 1 addition & 1 deletion graph/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ func (b *Builder) handleNetworkUpdate(vb *ValidationBarrier,
update.err <- err

case IsError(err, ErrParentValidationFailed):
update.err <- newErrf(ErrIgnored, err.Error())
update.err <- newErrf(ErrIgnored, err.Error()) //nolint

default:
log.Warnf("unexpected error during validation "+
Expand Down
Loading
Loading