Skip to content

chore: bump Go 1.19→1.25, replace k8s dep, remove golangci-lint from …#22

Merged
ankurs merged 5 commits into
mainfrom
feat/dep-cleanup-go125
Mar 20, 2026
Merged

chore: bump Go 1.19→1.25, replace k8s dep, remove golangci-lint from …#22
ankurs merged 5 commits into
mainfrom
feat/dep-cleanup-go125

Conversation

@ankurs
Copy link
Copy Markdown
Member

@ankurs ankurs commented Mar 20, 2026

  • Bump go directive to 1.25
  • Replace k8s.io/apimachinery sets.String with internal stringset.go (sheds massive k8s dep tree)
  • Remove golangci-lint from tools/tools.go (keep gomarkdoc); sheds ~170 indirect deps
  • Replace 22 interface{} → any across 5 files

Summary by CodeRabbit

  • Chores

    • Upgraded Go toolchain to 1.25.0
    • Updated GitHub Actions (checkout v4, setup-go v5)
    • Refreshed direct and indirect project dependencies
    • Modernized code to newer Go language features (updated public APIs and types)
    • Replaced an external string-set utility with an internal, deterministic string-set implementation
  • Tests

    • Added unit tests covering the new string-set behavior

…go.mod

- Bump go directive to 1.25
- Replace k8s.io/apimachinery sets.String with internal stringset.go (sheds massive k8s dep tree)
- Remove golangci-lint from tools/tools.go (keep gomarkdoc); sheds ~170 indirect deps
- Replace 22 interface{} → any across 5 files
@ankurs ankurs requested a review from Copilot March 20, 2026 01:34
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 68090568-5065-4bee-bfde-3c6abcb884cf

📥 Commits

Reviewing files that changed from the base of the PR and between a57954d and 5fbdb67.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • go.mod
  • plan.go

📝 Walkthrough

Walkthrough

This PR updates CI and the Go toolchain to 1.25, replaces interface{} with any across APIs, removes k8s.io/apimachinery/pkg/util/sets, and adds an internal stringSet with tests.

Changes

Cohort / File(s) Summary
CI & Module
.github/workflows/go.yml, go.mod
Upgrade GitHub Actions (checkout v2→v4, setup-go v2→v5) and Go toolchain to 1.25.0; refresh and prune direct/indirect dependencies; remove k8s.io/apimachinery from requirements.
API & Types Modernization
context.go, types.go, databuilder.go, plan.go
Replace interface{} with any in exported/internal signatures; change result maps from map[string]interface{} to map[string]any.
Custom stringSet
databuilder/stringset.go, databuilder/stringset_test.go, dependency.go, databuilder.go, plan.go
Add stringSet implementation and tests; replace usages of sets.String with stringSet and remove external sets import.
Graph Rendering Context
plan.go
Make graph-building context-aware: BuildGraph now accepts context.Context and uses context-scoped graphviz rendering.
Tools
tools/tools.go
Remove blank import for golangci-lint, retain gomarkdoc blank import.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I hopped through lines of Go tonight,
I traded interface{} for any—what a sight!
I planted a set of strings neat and small,
CI and Go updated to answer the call.
Paws on the keyboard, I celebrate it all.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: bumping Go version, replacing k8s dependencies, and removing golangci-lint, which are the three primary objectives of the changeset.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dep-cleanup-go125
📝 Coding Plan
  • Generate coding plan for human review comments

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.3)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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 and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the module to a newer Go version, reduces dependency footprint by removing Kubernetes apimachinery (replacing sets.String with an internal implementation), and modernizes a few type usages (interface{}any) across the public API and internals.

Changes:

  • Bump the Go version and refresh module dependencies (including tracing and go-graphviz).
  • Replace k8s.io/apimachinery/pkg/util/sets.String usage with an internal stringSet to shed the k8s dependency tree.
  • Remove golangci-lint from tracked tool dependencies and migrate interface{} to any.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
go.mod Updates Go directive and dependency versions; removes k8s dependency and golangci-lint.
stringset.go Adds internal stringSet implementation to replace k8s sets.String.
dependency.go Switches dependency-resolution set logic from k8s sets.String to stringSet.
plan.go Removes k8s set usage, updates result/init maps to any, and updates graphviz construction/rendering API usage.
databuilder.go Updates builder storage and set tracking to any/stringSet, removing k8s import.
types.go Updates public interfaces to use any instead of interface{}.
context.go Updates GetFromResult signature to any.
tools/tools.go Removes golangci-lint from tools tracking imports.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go.mod
module github.com/go-coldbrew/data-builder

go 1.19
go 1.25.0
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

go directive should use the Go language version in major.minor form; go 1.25.0 is rejected by the go command (expects e.g. go 1.25). Update this line to a valid format so module tooling can parse the file.

Suggested change
go 1.25.0
go 1.25

Copilot uses AI. Check for mistakes.
Comment thread dependency.go
Comment on lines +28 to 33
readyset := newStringSet(initData...)
order := make([][]*builder, 0)
for len(structMap) > 0 {
blocked := sets.NewString()
blocked := newStringSet()
for k, v := range structMap {
if v.Len() == 0 {
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

Switching from sets.String to stringSet removes the String() implementation that k8s sets provide. Later in this function, blocked is formatted with %s, which will now produce a %!s(...) formatting error instead of a readable list of missing fields. Add a String() method on stringSet (to preserve existing error text behavior) or update the error formatting to use blocked.List() / %v.

Copilot uses AI. Check for mistakes.
ankurs added 4 commits March 20, 2026 09:44
Go 1.26 toolchain normalizes go directive to 1.25.0; upgrade
actions/checkout to v4 and actions/setup-go to v5 so CI
installs a Go version that understands this format.
The stringSet type replaced k8s sets.String but was missing a String()
method. This caused %s formatting in error messages to produce
unreadable output instead of the expected [a b c] format.
- Rename local var 'max' to 'maxParallel' to avoid shadowing Go 1.21+
  builtin.
- Replace TODO comments with descriptive comments.
- Update go-git/go-git v5.3→v5.17 (fixes CVE-2023-49569, CVE-2025-21613,
  CVE-2023-49568, CVE-2025-21614).
- Update logrus v1.8→v1.9.4 (fixes CVE-2025-65637).
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
stringset.go (1)

57-68: Consider using strings.Builder for better performance.

String concatenation in a loop creates a new string on each iteration, resulting in O(n²) complexity. Using strings.Builder would be O(n).

♻️ Suggested improvement
+import (
+	"sort"
+	"strings"
+)
+
 // String returns a human-readable representation of the set, e.g. "[a b c]".
 func (s stringSet) String() string {
 	items := s.List()
-	result := "["
-	for i, item := range items {
-		if i > 0 {
-			result += " "
-		}
-		result += item
-	}
-	result += "]"
-	return result
+	var b strings.Builder
+	b.WriteByte('[')
+	for i, item := range items {
+		if i > 0 {
+			b.WriteByte(' ')
+		}
+		b.WriteString(item)
+	}
+	b.WriteByte(']')
+	return b.String()
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@stringset.go` around lines 57 - 68, The stringSet.String() implementation
builds the output via repeated string concatenation which is quadratic; replace
the loop with a strings.Builder: import "strings", create a builder, WriteString
the "[" prefix, loop over items := s.List() and write a space separator and each
item via builder.WriteString, then append "]" and return builder.String(); keep
function name stringSet.String and use s.List() to obtain items.
stringset_test.go (1)

10-32: Good test coverage for String() method.

The tests correctly verify:

  • Empty set formatting
  • Single element formatting
  • Multiple elements with deterministic sorting
  • fmt.Stringer interface integration

Consider adding tests for Has, Insert, IsSuperset, Difference, and Len methods to ensure comprehensive coverage of the new stringSet type.

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

In `@stringset_test.go` around lines 10 - 32, Add unit tests for stringSet
behavior beyond String(): create tests using newStringSet(...) and assert Has,
Insert, Len, IsSuperset, and Difference semantics; specifically add table-driven
cases that verify Insert adds items and updates Len and Has, Has returns false
for absent items, IsSuperset correctly identifies superset/subset relations
between stringSet instances, and Difference returns the expected set of items
(and does not mutate operands). Use the existing test style (testing.T, t.Run,
assert.Equal/assert.True/assert.False) and reference the constructors and
methods newStringSet, Insert, Has, Len, IsSuperset, and Difference when locating
code to test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@go.mod`:
- Line 3: Update the Go module directive to the canonical format by changing the
go directive value from "1.25.0" to "1.25" in the go.mod file; locate the go
directive (the line that currently reads go 1.25.0) and replace the patch
version with the major.minor version so it reads go 1.25 to satisfy the Go
modules specification.
- Line 27: Update the go-git dependency from github.com/go-git/go-git/v5 v5.3.0
to v5.17.0 to pull in security fixes; modify the version string for the module
reference (github.com/go-git/go-git/v5) in go.mod and then run the module update
commands (e.g., go get github.com/go-git/go-git/v5@v5.17.0 and go mod tidy) so
the lockfile and vendor state are consistent.
- Line 50: Update the logrus dependency in go.mod from
github.com/sirupsen/logrus v1.8.1 to a fixed version (at least v1.8.3,
preferably v1.9.4) to mitigate CVE-2025-65637; after editing the dependency
entry for github.com/sirupsen/logrus, run the Go module update commands (eg. go
get github.com/sirupsen/logrus@v1.9.4 and go mod tidy) so go.sum is refreshed
and the new version is used throughout the build.

---

Nitpick comments:
In `@stringset_test.go`:
- Around line 10-32: Add unit tests for stringSet behavior beyond String():
create tests using newStringSet(...) and assert Has, Insert, Len, IsSuperset,
and Difference semantics; specifically add table-driven cases that verify Insert
adds items and updates Len and Has, Has returns false for absent items,
IsSuperset correctly identifies superset/subset relations between stringSet
instances, and Difference returns the expected set of items (and does not mutate
operands). Use the existing test style (testing.T, t.Run,
assert.Equal/assert.True/assert.False) and reference the constructors and
methods newStringSet, Insert, Has, Len, IsSuperset, and Difference when locating
code to test.

In `@stringset.go`:
- Around line 57-68: The stringSet.String() implementation builds the output via
repeated string concatenation which is quadratic; replace the loop with a
strings.Builder: import "strings", create a builder, WriteString the "[" prefix,
loop over items := s.List() and write a space separator and each item via
builder.WriteString, then append "]" and return builder.String(); keep function
name stringSet.String and use s.List() to obtain items.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 576bf495-d17f-4ca6-bdd7-1bdb81a67ea2

📥 Commits

Reviewing files that changed from the base of the PR and between 8725113 and a57954d.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (10)
  • .github/workflows/go.yml
  • context.go
  • databuilder.go
  • dependency.go
  • go.mod
  • plan.go
  • stringset.go
  • stringset_test.go
  • tools/tools.go
  • types.go
💤 Files with no reviewable changes (1)
  • tools/tools.go

Comment thread go.mod
module github.com/go-coldbrew/data-builder

go 1.19
go 1.25.0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Has Go 1.25 been released and what is the correct go.mod directive format for Go 1.25?

💡 Result:

Yes, Go 1.25 was released on August 12, 2025. The correct go.mod directive format for Go 1.25 is the standard 'go 1.25' line, unchanged from previous versions. There are no special syntax changes for the go directive in Go 1.25; it follows the established format as documented in the official Go modules reference: go 1.25. New features like the go.mod ignore directive exist, but the Go version directive remains go . When using go mod init with Go 1.26+, it may default to go 1.25.0 for compatibility, but can be set explicitly with go mod edit -go=1.25 or go get go@1.25.x.

Citations:


Change go 1.25.0 to go 1.25 to match the official Go modules specification.

The go directive format must be go <version> without a patch number. The pipeline failure occurs because 1.25.0 does not match the expected format pattern. Update line 3 to go 1.25.

🧰 Tools
🪛 GitHub Actions: PR `#22`

[error] 3-3: go.mod parse failed: invalid go version '1.25.0' at /home/runner/work/data-builder/data-builder/go.mod:3. Must match format 1.23.

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

In `@go.mod` at line 3, Update the Go module directive to the canonical format by
changing the go directive value from "1.25.0" to "1.25" in the go.mod file;
locate the go directive (the line that currently reads go 1.25.0) and replace
the patch version with the major.minor version so it reads go 1.25 to satisfy
the Go modules specification.

Comment thread go.mod Outdated
Comment thread go.mod Outdated
@ankurs ankurs merged commit b0c74ee into main Mar 20, 2026
2 of 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