Skip to content

Add lint target to makefile#51

Merged
cfergeau merged 1 commit into
crc-org:masterfrom
praveenkumar:fix_lint
Jun 23, 2026
Merged

Add lint target to makefile#51
cfergeau merged 1 commit into
crc-org:masterfrom
praveenkumar:fix_lint

Conversation

@praveenkumar

@praveenkumar praveenkumar commented Mar 31, 2026

Copy link
Copy Markdown
Member
  • Install latest version of golangci-lint if not available
  • Fix all the lint error
  • Update the ci job

Summary by CodeRabbit

  • Bug Fixes

    • Improved error logging during startup to report event handler registration failures.
  • Chores

    • Switched lint execution to a tools-driven workflow and updated linter configuration.
    • Added tooling support and Makefile wiring for deterministic lint installs.
    • Simplified and made application startup/shutdown sequencing more robust.

@coderabbitai

coderabbitai Bot commented Mar 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 298 files, which is 148 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eb130b5a-91f2-444a-9470-9c620848af2b

📥 Commits

Reviewing files that changed from the base of the PR and between 80801d8 and 07b2fcc.

⛔ Files ignored due to path filters (2)
  • tools/go.sum is excluded by !**/*.sum
  • tools/vendor/github.com/alecthomas/chroma/v2/chroma.jpg is excluded by !**/*.jpg
📒 Files selected for processing (298)
  • .github/workflows/ci.yml
  • .golangci.yml
  • Makefile
  • main.go
  • pkg/node-port-handler/node-port-handler.go
  • pkg/routes-handler/routes-handler.go
  • pkg/routes-handler/routes-handler_test.go
  • tools/bin/.gitignore
  • tools/go.mod
  • tools/tools.go
  • tools/tools.mk
  • tools/vendor/4d63.com/gocheckcompilerdirectives/LICENSE
  • tools/vendor/4d63.com/gocheckcompilerdirectives/checkcompilerdirectives/checkcompilerdirectives.go
  • tools/vendor/4d63.com/gochecknoglobals/LICENSE
  • tools/vendor/4d63.com/gochecknoglobals/checknoglobals/check_no_globals.go
  • tools/vendor/codeberg.org/chavacava/garif/.gitignore
  • tools/vendor/codeberg.org/chavacava/garif/LICENSE
  • tools/vendor/codeberg.org/chavacava/garif/README.md
  • tools/vendor/codeberg.org/chavacava/garif/constructors.go
  • tools/vendor/codeberg.org/chavacava/garif/decorators.go
  • tools/vendor/codeberg.org/chavacava/garif/doc.go
  • tools/vendor/codeberg.org/chavacava/garif/enums.go
  • tools/vendor/codeberg.org/chavacava/garif/io.go
  • tools/vendor/codeberg.org/chavacava/garif/models.go
  • tools/vendor/codeberg.org/polyfloyd/go-errorlint/LICENSE
  • tools/vendor/codeberg.org/polyfloyd/go-errorlint/errorlint/allowed.go
  • tools/vendor/codeberg.org/polyfloyd/go-errorlint/errorlint/analysis.go
  • tools/vendor/codeberg.org/polyfloyd/go-errorlint/errorlint/lint.go
  • tools/vendor/codeberg.org/polyfloyd/go-errorlint/errorlint/options.go
  • tools/vendor/codeberg.org/polyfloyd/go-errorlint/errorlint/printf.go
  • tools/vendor/dev.gaijin.team/go/exhaustruct/v4/LICENSE
  • tools/vendor/dev.gaijin.team/go/exhaustruct/v4/analyzer/analyzer.go
  • tools/vendor/dev.gaijin.team/go/exhaustruct/v4/analyzer/config.go
  • tools/vendor/dev.gaijin.team/go/exhaustruct/v4/internal/comment/cache.go
  • tools/vendor/dev.gaijin.team/go/exhaustruct/v4/internal/comment/directive.go
  • tools/vendor/dev.gaijin.team/go/exhaustruct/v4/internal/pattern/list.go
  • tools/vendor/dev.gaijin.team/go/exhaustruct/v4/internal/structure/fields-cache.go
  • tools/vendor/dev.gaijin.team/go/exhaustruct/v4/internal/structure/fields.go
  • tools/vendor/dev.gaijin.team/go/golib/LICENSE
  • tools/vendor/dev.gaijin.team/go/golib/e/doc.go
  • tools/vendor/dev.gaijin.team/go/golib/e/err.go
  • tools/vendor/dev.gaijin.team/go/golib/e/log.go
  • tools/vendor/dev.gaijin.team/go/golib/fields/dict.go
  • tools/vendor/dev.gaijin.team/go/golib/fields/doc.go
  • tools/vendor/dev.gaijin.team/go/golib/fields/field.go
  • tools/vendor/dev.gaijin.team/go/golib/fields/list.go
  • tools/vendor/github.com/4meepo/tagalign/.gitignore
  • tools/vendor/github.com/4meepo/tagalign/.golangci.yml
  • tools/vendor/github.com/4meepo/tagalign/.goreleaser.yml
  • tools/vendor/github.com/4meepo/tagalign/LICENSE
  • tools/vendor/github.com/4meepo/tagalign/Makefile
  • tools/vendor/github.com/4meepo/tagalign/README.md
  • tools/vendor/github.com/4meepo/tagalign/options.go
  • tools/vendor/github.com/4meepo/tagalign/tagalign.go
  • tools/vendor/github.com/Abirdcfly/dupword/.gitignore
  • tools/vendor/github.com/Abirdcfly/dupword/.goreleaser.yml
  • tools/vendor/github.com/Abirdcfly/dupword/LICENSE
  • tools/vendor/github.com/Abirdcfly/dupword/README.md
  • tools/vendor/github.com/Abirdcfly/dupword/dupword.go
  • tools/vendor/github.com/Abirdcfly/dupword/version.go
  • tools/vendor/github.com/AdminBenni/iota-mixing/LICENSE
  • tools/vendor/github.com/AdminBenni/iota-mixing/pkg/analyzer/analyzer.go
  • tools/vendor/github.com/AdminBenni/iota-mixing/pkg/analyzer/flags/flags.go
  • tools/vendor/github.com/AlwxSin/noinlineerr/.gitignore
  • tools/vendor/github.com/AlwxSin/noinlineerr/.golangci.yml
  • tools/vendor/github.com/AlwxSin/noinlineerr/.goreleaser.yml
  • tools/vendor/github.com/AlwxSin/noinlineerr/LICENSE
  • tools/vendor/github.com/AlwxSin/noinlineerr/README.md
  • tools/vendor/github.com/AlwxSin/noinlineerr/noinlineerr.go
  • tools/vendor/github.com/Antonboom/errname/LICENSE
  • tools/vendor/github.com/Antonboom/errname/pkg/analyzer/analyzer.go
  • tools/vendor/github.com/Antonboom/errname/pkg/analyzer/facts.go
  • tools/vendor/github.com/Antonboom/nilnil/LICENSE
  • tools/vendor/github.com/Antonboom/nilnil/pkg/analyzer/analyzer.go
  • tools/vendor/github.com/Antonboom/nilnil/pkg/analyzer/config.go
  • tools/vendor/github.com/Antonboom/nilnil/pkg/analyzer/func_type_stack.go
  • tools/vendor/github.com/Antonboom/testifylint/LICENSE
  • tools/vendor/github.com/Antonboom/testifylint/analyzer/analyzer.go
  • tools/vendor/github.com/Antonboom/testifylint/analyzer/checkers_factory.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/analysisutil/doc.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/analysisutil/encoded.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/analysisutil/file.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/analysisutil/format.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/analysisutil/object.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/analysisutil/pkg.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/blank_import.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/bool_compare.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/call_meta.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/checker.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/checkers_registry.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/compares.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/contains.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/empty.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/encoded_compare.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/equal_values.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/error_is_as.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/error_nil.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/expected_actual.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/float_compare.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/formatter.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/go_require.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_basic_type.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_bool.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_comparison.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_context.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_diagnostic.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_encoded.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_error.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_format.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_http.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_interface.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_len.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_naming.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_nil.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_pkg_func.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_suite.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/helpers_testing.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/len.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/negative_positive.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/nil_compare.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/printf/LICENSE
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/printf/doc.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/printf/printf.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/regexp.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/require_error.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_broken_parallel.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_dont_use_pkg.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_extra_assert_call.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_method_signature.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_subtest_run.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_thelper.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/checkers/useless_assert.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/config/config.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/config/flag_value_types.go
  • tools/vendor/github.com/Antonboom/testifylint/internal/testify/const.go
  • tools/vendor/github.com/BurntSushi/toml/.gitignore
  • tools/vendor/github.com/BurntSushi/toml/COPYING
  • tools/vendor/github.com/BurntSushi/toml/README.md
  • tools/vendor/github.com/BurntSushi/toml/decode.go
  • tools/vendor/github.com/BurntSushi/toml/deprecated.go
  • tools/vendor/github.com/BurntSushi/toml/doc.go
  • tools/vendor/github.com/BurntSushi/toml/encode.go
  • tools/vendor/github.com/BurntSushi/toml/error.go
  • tools/vendor/github.com/BurntSushi/toml/internal/tz.go
  • tools/vendor/github.com/BurntSushi/toml/lex.go
  • tools/vendor/github.com/BurntSushi/toml/meta.go
  • tools/vendor/github.com/BurntSushi/toml/parse.go
  • tools/vendor/github.com/BurntSushi/toml/type_fields.go
  • tools/vendor/github.com/BurntSushi/toml/type_toml.go
  • tools/vendor/github.com/Djarvur/go-err113/.gitignore
  • tools/vendor/github.com/Djarvur/go-err113/.golangci.yml
  • tools/vendor/github.com/Djarvur/go-err113/.travis.yml
  • tools/vendor/github.com/Djarvur/go-err113/LICENSE
  • tools/vendor/github.com/Djarvur/go-err113/README.adoc
  • tools/vendor/github.com/Djarvur/go-err113/comparison.go
  • tools/vendor/github.com/Djarvur/go-err113/definition.go
  • tools/vendor/github.com/Djarvur/go-err113/err113.go
  • tools/vendor/github.com/Masterminds/semver/v3/.gitignore
  • tools/vendor/github.com/Masterminds/semver/v3/.golangci.yml
  • tools/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md
  • tools/vendor/github.com/Masterminds/semver/v3/LICENSE.txt
  • tools/vendor/github.com/Masterminds/semver/v3/Makefile
  • tools/vendor/github.com/Masterminds/semver/v3/README.md
  • tools/vendor/github.com/Masterminds/semver/v3/SECURITY.md
  • tools/vendor/github.com/Masterminds/semver/v3/collection.go
  • tools/vendor/github.com/Masterminds/semver/v3/constraints.go
  • tools/vendor/github.com/Masterminds/semver/v3/doc.go
  • tools/vendor/github.com/Masterminds/semver/v3/version.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/.gitignore
  • tools/vendor/github.com/MirrexOne/unqueryvet/.golangci.yml
  • tools/vendor/github.com/MirrexOne/unqueryvet/.unqueryvet.example.yaml
  • tools/vendor/github.com/MirrexOne/unqueryvet/CONTRIBUTING.md
  • tools/vendor/github.com/MirrexOne/unqueryvet/Dockerfile
  • tools/vendor/github.com/MirrexOne/unqueryvet/LICENSE
  • tools/vendor/github.com/MirrexOne/unqueryvet/README.md
  • tools/vendor/github.com/MirrexOne/unqueryvet/RELEASE.md
  • tools/vendor/github.com/MirrexOne/unqueryvet/Taskfile.yml
  • tools/vendor/github.com/MirrexOne/unqueryvet/action.yml
  • tools/vendor/github.com/MirrexOne/unqueryvet/analyzer.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/config.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/analyzer.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/concat.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/filter.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/fixes.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/format.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/n1detector.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/bun.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/ent.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/goqu.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/gorm.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/interface.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/jet.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/pgx.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/reform.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/rel.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/sqlboiler.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/sqlc.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/sqlx.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqlbuilders/squirrel.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/sqli_scanner.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/internal/analyzer/tx_leak_detector.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/pkg/config/config.go
  • tools/vendor/github.com/MirrexOne/unqueryvet/schema.json
  • tools/vendor/github.com/OpenPeeDeeP/depguard/v2/.gitignore
  • tools/vendor/github.com/OpenPeeDeeP/depguard/v2/LICENSE
  • tools/vendor/github.com/OpenPeeDeeP/depguard/v2/README.md
  • tools/vendor/github.com/OpenPeeDeeP/depguard/v2/depguard.go
  • tools/vendor/github.com/OpenPeeDeeP/depguard/v2/internal/utils/errors.go
  • tools/vendor/github.com/OpenPeeDeeP/depguard/v2/internal/utils/variables.go
  • tools/vendor/github.com/OpenPeeDeeP/depguard/v2/settings.go
  • tools/vendor/github.com/alecthomas/chroma/v2/.editorconfig
  • tools/vendor/github.com/alecthomas/chroma/v2/.gitignore
  • tools/vendor/github.com/alecthomas/chroma/v2/.golangci.yml
  • tools/vendor/github.com/alecthomas/chroma/v2/.goreleaser.yml
  • tools/vendor/github.com/alecthomas/chroma/v2/AGENTS.md
  • tools/vendor/github.com/alecthomas/chroma/v2/Bitfile
  • tools/vendor/github.com/alecthomas/chroma/v2/COPYING
  • tools/vendor/github.com/alecthomas/chroma/v2/Dockerfile
  • tools/vendor/github.com/alecthomas/chroma/v2/Justfile
  • tools/vendor/github.com/alecthomas/chroma/v2/README.md
  • tools/vendor/github.com/alecthomas/chroma/v2/biome.json
  • tools/vendor/github.com/alecthomas/chroma/v2/coalesce.go
  • tools/vendor/github.com/alecthomas/chroma/v2/colour.go
  • tools/vendor/github.com/alecthomas/chroma/v2/delegate.go
  • tools/vendor/github.com/alecthomas/chroma/v2/doc.go
  • tools/vendor/github.com/alecthomas/chroma/v2/emitters.go
  • tools/vendor/github.com/alecthomas/chroma/v2/formatter.go
  • tools/vendor/github.com/alecthomas/chroma/v2/formatters/api.go
  • tools/vendor/github.com/alecthomas/chroma/v2/formatters/html/html.go
  • tools/vendor/github.com/alecthomas/chroma/v2/formatters/json.go
  • tools/vendor/github.com/alecthomas/chroma/v2/formatters/svg/font_liberation_mono.go
  • tools/vendor/github.com/alecthomas/chroma/v2/formatters/svg/svg.go
  • tools/vendor/github.com/alecthomas/chroma/v2/formatters/tokens.go
  • tools/vendor/github.com/alecthomas/chroma/v2/formatters/tty_indexed.go
  • tools/vendor/github.com/alecthomas/chroma/v2/formatters/tty_truecolour.go
  • tools/vendor/github.com/alecthomas/chroma/v2/iterator.go
  • tools/vendor/github.com/alecthomas/chroma/v2/lexer.go
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/README.md
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/caddyfile.go
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/cl.go
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/dns.go
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/emacs.go
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/abap.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/abnf.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/actionscript.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/actionscript_3.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ada.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/agda.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/al.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/alloy.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/angular2.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/antlr.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/apacheconf.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/apl.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/applescript.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/arangodb_aql.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/arduino.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/armasm.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/atl.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/autohotkey.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/autoit.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/awk.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ballerina.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bash.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bash_session.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/batchfile.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/beef.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bibtex.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bicep.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/blitzbasic.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bnf.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bqn.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/brainfuck.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/c#.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/c++.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/c.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/c3.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cap_n_proto.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cassandra_cql.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ceylon.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cfengine3.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cfstatement.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/chaiscript.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/chapel.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cheetah.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/clojure.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cmake.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cobol.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/coffeescript.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/common_lisp.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/coq.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/core.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/crystal.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/css.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/csv.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cue.xml
  • tools/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cython.xml

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Consolidates linting into a Makefile-driven flow and tooling module, updates golangci-lint configuration and formatters, renames several packages from snake_case to camelCase, adds error checks when registering informer handlers, and adjusts startup/shutdown ordering in main.go.

Changes

Cohort / File(s) Summary
CI workflow
.github/workflows/ci.yml
Replaced pinned golangci/golangci-lint-action@v6 step with run: make lint.
GolangCI config
.golangci.yml
Set version: "2", adjusted enabled linters (removed errcheck, goimports, gofmt, deadcode; added/retained others including unused), added linters.exclusions and presets, customized revive rules, and enabled formatters with generated: lax.
Makefile & tools wiring
Makefile, tools/tools.mk, tools/bin/.gitignore
Introduced TOOLS_DIR := tools, TOOLS_BINDIR, directory rule, and a target to install golangci-lint into $(TOOLS_BINDIR); lint target now depends on and invokes $(TOOLS_BINDIR)/golangci-lint.
Tools module
tools/go.mod, tools/tools.go
Added a new tools Go module (pins golangci-lint v2.8.0 and many transitive deps) and a //go:build tools file that blank-imports the linter cmd to track the tool dependency.
Package renames & handler error checks
pkg/node-port-handler/node-port-handler.go, pkg/routes-handler/routes-handler.go, pkg/routes-handler/routes-handler_test.go
Renamed packages node_port_handlernodeporthandler, routes_handlerrouteshandler; updated informer handler registration to capture/check returned err; test handlers mark unused *http.Request as _; added //nolint:gosec for a http.Post call.
Application startup
main.go
Moved creation of stop channel until after clientsets are built, start nodePortHandler after stop exists, removed redundant return after log.Fatal, and simplified signal wait to a blocking <-signalCh.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰
I hopped through Make and golangci,
Renamed my friends so neat and spry,
Handlers now report their woes,
Tools installed where tidy grows,
I nibble code — the tests run by!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Add lint target to makefile' is partially related to the changeset but undersells the scope. While a lint target is added to the Makefile, the PR also installs golangci-lint to a tools directory, fixes lint errors across multiple packages, and updates the CI workflow—making the title incomplete. Consider a more comprehensive title such as 'Set up golangci-lint tooling and fix lint errors' or 'Migrate lint checks to managed tooling' to better reflect the full scope of changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
main.go (1)

66-69: Consider handling SIGINT for local development.

Currently only SIGTERM is handled. For easier local development/debugging, you may want to also handle SIGINT (Ctrl+C). This is optional since container orchestrators typically use SIGTERM.

♻️ Optional: Add SIGINT handling
 	signalCh := make(chan os.Signal, 1)
-	signal.Notify(signalCh, syscall.SIGTERM)
+	signal.Notify(signalCh, syscall.SIGTERM, syscall.SIGINT)
 	<-signalCh
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@main.go` around lines 66 - 69, The shutdown handling only listens for SIGTERM
on signalCh; update the signal.Notify call to also listen for SIGINT so local
Ctrl+C triggers graceful shutdown—for example modify the call referencing
signalCh and signal.Notify to include syscall.SIGINT alongside syscall.SIGTERM
(and adjust the comment to note SIGINT is for local development). Ensure the
rest of the code that reads from signalCh (the <-signalCh line) remains
unchanged.
pkg/routes-handler/routes-handler.go (1)

21-21: Same pattern as node-port-handler: consider failing fast on registration error.

This has the same concern as NodePortHandler - the informer runs without event handlers if registration fails. Consider propagating the error to the caller for consistent behavior.

Also applies to: 50-52

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/routes-handler/routes-handler.go` at line 21, The informer event-handler
registration (informer.AddEventHandler with cache.ResourceEventHandlerFuncs)
currently ignores registration failures; change the code to check the returned
error and propagate it to the caller so the informer doesn't run without
handlers. Specifically, after calling informer.AddEventHandler(...) (and the
other similar calls around the second occurrence), if err != nil return that
error (or wrap it with context) from the enclosing function instead of
discarding it; ensure the enclosing function's signature allows returning an
error so failures are surfaced consistently.
pkg/node-port-handler/node-port-handler.go (1)

26-26: Consider failing fast if event handler registration fails.

The error is logged but the informer is still returned and will be run. If AddEventHandler fails, the informer will run without processing any events, silently doing nothing useful. Consider returning an error or using log.Fatal to prevent silent failure.

♻️ Suggested approach: return error to caller
-func NodePortHandler(clientset *kubernetes.Clientset) cache.SharedIndexInformer {
+func NodePortHandler(clientset *kubernetes.Clientset) (cache.SharedIndexInformer, error) {
 	factory := informers.NewSharedInformerFactory(clientset, 5*time.Minute)
 	informer := factory.Core().V1().Services().Informer()

 	_, err := informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
 		// ... handlers ...
 	})
 	if err != nil {
-		log.Errorf("failed to add event handler: %v", err)
+		return nil, fmt.Errorf("failed to add event handler: %w", err)
 	}

-	return informer
+	return informer, nil
 }

Then update main.go to handle the error appropriately.

Also applies to: 80-82

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/node-port-handler/node-port-handler.go` at line 26, The informer
registration currently swallows AddEventHandler errors (in the call to
informer.AddEventHandler with cache.ResourceEventHandlerFuncs) and only logs
them, so the informer may run without handlers; change the code to fail fast by
returning an error from the function when informer.AddEventHandler returns a
non-nil err (i.e., update the function signature to return (informerType, error)
or appropriate value+error, propagate the error instead of logging and returning
the informer), and update callers (e.g., main.go) to handle the returned error;
apply the same change for the other AddEventHandler occurrence that currently
logs but continues.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Makefile`:
- Around line 21-24: The Makefile currently checks only $(shell go env
GOPATH)/bin for golangci-lint and installs with `@latest`, which is
non-deterministic and ignores GOBIN; update the lint target to resolve the
binary using $(shell go env GOBIN) if set else $(shell go env GOPATH)/bin (or
use a small helper variable like GOBIN_FALLBACK) and use a pinned version
variable (e.g., GOLANGCI_LINT_VERSION) instead of `@latest` when invoking go
install; ensure the target references that resolved path when both checking
existence and running golangci-lint so the install and execution are GOBIN-aware
and CI-reproducible.

---

Nitpick comments:
In `@main.go`:
- Around line 66-69: The shutdown handling only listens for SIGTERM on signalCh;
update the signal.Notify call to also listen for SIGINT so local Ctrl+C triggers
graceful shutdown—for example modify the call referencing signalCh and
signal.Notify to include syscall.SIGINT alongside syscall.SIGTERM (and adjust
the comment to note SIGINT is for local development). Ensure the rest of the
code that reads from signalCh (the <-signalCh line) remains unchanged.

In `@pkg/node-port-handler/node-port-handler.go`:
- Line 26: The informer registration currently swallows AddEventHandler errors
(in the call to informer.AddEventHandler with cache.ResourceEventHandlerFuncs)
and only logs them, so the informer may run without handlers; change the code to
fail fast by returning an error from the function when informer.AddEventHandler
returns a non-nil err (i.e., update the function signature to return
(informerType, error) or appropriate value+error, propagate the error instead of
logging and returning the informer), and update callers (e.g., main.go) to
handle the returned error; apply the same change for the other AddEventHandler
occurrence that currently logs but continues.

In `@pkg/routes-handler/routes-handler.go`:
- Line 21: The informer event-handler registration (informer.AddEventHandler
with cache.ResourceEventHandlerFuncs) currently ignores registration failures;
change the code to check the returned error and propagate it to the caller so
the informer doesn't run without handlers. Specifically, after calling
informer.AddEventHandler(...) (and the other similar calls around the second
occurrence), if err != nil return that error (or wrap it with context) from the
enclosing function instead of discarding it; ensure the enclosing function's
signature allows returning an error so failures are surfaced consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 34cee140-3697-4b13-a41e-a1d2c2396e7b

📥 Commits

Reviewing files that changed from the base of the PR and between 691912f and 76a7c77.

📒 Files selected for processing (7)
  • .github/workflows/ci.yml
  • .golangci.yml
  • Makefile
  • main.go
  • pkg/node-port-handler/node-port-handler.go
  • pkg/routes-handler/routes-handler.go
  • pkg/routes-handler/routes-handler_test.go

Comment thread Makefile Outdated
Comment thread pkg/routes-handler/routes-handler.go Outdated
Comment thread Makefile Outdated
@@ -1,5 +1,11 @@
TAG ?= $(shell git describe --match=NeVeRmAtCh --always --abbrev=40 --dirty)
CONTAINER_RUNTIME ?= podman
GOLANGCI_LINT_VERSION ?= v1.62.2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

with something like crc-org/vfkit@3cc650a ,

  • golangci-lint with a hardcoded version does not get installed in GOBIN, potentially conflicting with the version needed by other modules
  • dependabot updates golangci-lint for us

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, I am trying out how good claude is for this task.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tools/tools.mk`:
- Line 1: The TOOLS_BINDIR assignment uses realpath which returns empty for
non-existent paths; change the assignment to use abspath (i.e. TOOLS_BINDIR :=
$(abspath $(TOOLS_DIR)/bin)) so the bin path is correct on a fresh clone, and
update the install/lint recipe(s) that rely on TOOLS_BINDIR (and GOBIN) to
create the directory first (mkdir -p $(TOOLS_BINDIR)) before installing
golangci-lint or setting GOBIN so installations go into the intended tools/bin
location.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a4ca8e58-a814-4d8b-8605-6d888e677b68

📥 Commits

Reviewing files that changed from the base of the PR and between 76a7c77 and 6c8c40c.

⛔ Files ignored due to path filters (1)
  • tools/go.sum is excluded by !**/*.sum
📒 Files selected for processing (11)
  • .github/workflows/ci.yml
  • .golangci.yml
  • Makefile
  • main.go
  • pkg/node-port-handler/node-port-handler.go
  • pkg/routes-handler/routes-handler.go
  • pkg/routes-handler/routes-handler_test.go
  • tools/bin/.gitignore
  • tools/go.mod
  • tools/tools.go
  • tools/tools.mk
✅ Files skipped from review due to trivial changes (4)
  • tools/bin/.gitignore
  • tools/tools.go
  • .github/workflows/ci.yml
  • pkg/routes-handler/routes-handler_test.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • Makefile
  • pkg/routes-handler/routes-handler.go
  • .golangci.yml
  • pkg/node-port-handler/node-port-handler.go
  • main.go

Comment thread tools/tools.mk Outdated
Comment thread tools/bin/.gitignore Outdated
makefat
mockery
goimports
goimports.exe

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We will only be building golangci-lint, not the other ones. This could be * or such instead of naming the individual binaries.

@cfergeau cfergeau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few minor comments, but overall /lgtm

Comment thread .golangci.yml
- gofmt
- goimports
exclusions:
generated: lax

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this coming from another project? Maybe we can have stricter rules than the project this came from?

@cfergeau

Copy link
Copy Markdown
Contributor

A few minor comments, but overall /lgtm

I’ve pushed a fixup commit which:

  • changes tools/bin/.gitignore
  • updates golangci-lint to the latest version
  • adds a tools/vendor directory
  • tweaks golangci-lint config file, this should enable a few more warnings.

- Install golangci-lint if not available
- Fix all the lint error
- Update the ci job
@cfergeau
cfergeau merged commit a72a2df into crc-org:master Jun 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants