btcd icon indicating copy to clipboard operation
btcd copied to clipboard

feat: fix ci / makefile

Open gosunuts opened this issue 11 months ago β€’ 8 comments

Overview

fix / cleanup makefile and correcting several commands. Related to https://github.com/btcsuite/btcd/issues/2319 https://github.com/btcsuite/btcd/pull/2316

gosunuts avatar Feb 12 '25 01:02 gosunuts

Is this still under development?

yyforyongyu avatar Mar 07 '25 10:03 yyforyongyu

@yyforyongyu It is still in development, but it would be good to recreate the PR to follow Ideal Git Commit Structure.

gosunuts avatar Mar 10 '25 01:03 gosunuts

@rabbitprincess Cool thanks - I think it's better to do a force push on this PR once you fix the commit structure, it's easier that way as we won't lose the context/comments from this PR.

yyforyongyu avatar Mar 10 '25 06:03 yyforyongyu

Pull Request Test Coverage Report for Build 16746440587

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 6 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.009%) to 54.8%

Files with Coverage Reduction New Missed Lines %
connmgr/connmanager.go 2 83.9%
database/ffldb/blockio.go 4 88.81%
<!-- Total: 6
Totals Coverage Status
Change from base Build 16582220057: 0.009%
Covered Lines: 31094
Relevant Lines: 56741

πŸ’› - Coveralls

coveralls avatar Mar 10 '25 08:03 coveralls

@yyforyongyu this pr and https://github.com/btcsuite/btcd/pull/2307 are force-pushed. can you review again?

gosunuts avatar Mar 10 '25 08:03 gosunuts

@GustavoStingelin Sure! It's been updated to v2.1.6.

gosunuts avatar Jun 12 '25 10:06 gosunuts

LGTM!

@Roasbeef @yyforyongyu with the updated golangci-lint, we're now seeing 162 issues across several linters. Since the linter isn’t part of the pipeline yet, would you prefer merging this PR as-is and handling the fixes in follow-up PRs? Or should we resolve all the issues before merging?

Breakdown of issues:

  • errcheck: 50
  • ineffassign: 16
  • staticcheck: 50
  • unused: 46

GustavoStingelin avatar Jun 12 '25 19:06 GustavoStingelin

or maybe copy the .golangci.yml from lnd as mentioned previously

GustavoStingelin avatar Jun 13 '25 21:06 GustavoStingelin

@kcalvinalvin any thoughts?

GustavoStingelin avatar Jul 01 '25 14:07 GustavoStingelin

Since the linter isn’t part of the pipeline yet, would you prefer merging this PR as-is and handling the fixes in follow-up PRs?

Usually what we do is set a commit hash that grandfathers in any violations. So then only new PRs that introduce new linting errors get triggered.

Roasbeef avatar Jul 02 '25 22:07 Roasbeef

@rabbitprincess please, add the file .golangci.yml to the root path with the value

version: "2"
issues:
  # Only show newly introduced problems.
  new-from-rev: 80b74d6c5a0088a66dc96df6777d21e15c04849c

Sure! It's been applied.

gosunuts avatar Jul 11 '25 09:07 gosunuts

I think you will need to rebase your first commit with the changes from the last

GustavoStingelin avatar Jul 24 '25 12:07 GustavoStingelin

@GustavoStingelin Sure. It's been applied.

gosunuts avatar Jul 25 '25 03:07 gosunuts

If I run make lint, I get this error:

β›°   make lint
 Linting source.
/Users/roasbeef/gocode/bin/golangci-lint run -v
panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt

goroutine 1 [running]:
github.com/go-critic/go-critic/checkers.init.22()
        /Users/roasbeef/gocode/pkg/mod/github.com/go-critic/[email protected]/checkers/embedded_rules.go:47 +0x494
make: *** [lint] Error 2

Can you check the output of go env? It looks like go module might not be enabled in your environment (e.g., GO111MODULE=off )

gosunuts avatar Jul 29 '25 01:07 gosunuts

If I run make lint, I get this error:

FYI, make lint still works fine on my env (Go 1.24.4, Linux amd64, GO111MODULE='').

GustavoStingelin avatar Jul 29 '25 02:07 GustavoStingelin

Ah I'm on Go 1.23.6 locally. So seems that we'll need to update the top level go.mod to use Go 1.24.

Go 1.25 comes out in August, so that should line up with our policy to support the past two go versions.

Roasbeef avatar Jul 31 '25 17:07 Roasbeef

Ah I'm on Go 1.23.6 locally. So seems that we'll need to update the top level go.mod to use Go 1.24.

Go 1.25 comes out in August, so that should line up with our policy to support the past two go versions.

works well on version 1.23.6 here.

➜  btcd git:(feature/fix-ci) βœ— mise use [email protected]
mise ~/code/btcd/mise.toml tools: [email protected]

➜  btcd git:(feature/fix-ci) βœ— go version
go version go1.23.6 linux/amd64

➜  btcd git:(feature/fix-ci) βœ— rm $GOBIN/golangci-lint

➜  btcd git:(feature/fix-ci) βœ— make lint 
 Fetching linter
go install -v  github.com/golangci/golangci-lint/v2/cmd/[email protected]
 Linting source.
/home/head/.local/share/mise/installs/go/1.23.6/bin/golangci-lint run -v  --timeout=5m
INFO golangci-lint has version v2.1.6 built with go1.23.6 from (unknown, modified: ?, mod sum: "h1:LXqShFfAGM5BDzEOWD2SL1IzJAgUOqES/HRBsfKjI+w=") on (unknown) 
... omited logs
INFO [runner] linters took 116.4495ms with stages: goanalysis_metalinter: 38.478262ms 
0 issues.
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 5 samples, avg is 59.6MB, max is 94.0MB 
INFO Execution took 360.073736ms 

GustavoStingelin avatar Jul 31 '25 18:07 GustavoStingelin