Skip to content

Comments

bump deps, fix lint errs#703

Merged
Mzack9999 merged 3 commits intodevfrom
bump_deps
Sep 25, 2025
Merged

bump deps, fix lint errs#703
Mzack9999 merged 3 commits intodevfrom
bump_deps

Conversation

@dogancanbakir
Copy link
Member

@dogancanbakir dogancanbakir commented Sep 25, 2025

closes #702

Summary by CodeRabbit

  • Refactor
    • Standardized error construction and wrapping across DNS, GCP, and Kubernetes providers for more consistent, clearer error messages.
  • Chores
    • Upgraded multiple third‑party dependencies (logging, utilities, network, retrying, compression, and related libraries) to newer versions for improved stability and compatibility.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Walkthrough

This PR updates dependency versions in go.mod and replaces usages of the errorutil helper with errkit (New/Wrap/Newf) across DNSimple, GCP, and Kubernetes provider code. No public APIs, function signatures, or control flow logic were changed.

Changes

Cohort / File(s) Summary
Dependencies
go.mod
Bumped multiple direct and indirect module versions (e.g., github.com/projectdiscovery/gologger, github.com/projectdiscovery/utils, github.com/ulikunitz/xz, github.com/projectdiscovery/networkpolicy, github.com/projectdiscovery/retryablehttp-go, github.com/gaissmai/bart, github.com/projectdiscovery/fastdialer, github.com/projectdiscovery/hmap, github.com/projectdiscovery/retryabledns).
DNSimple provider
pkg/providers/dnssimple/dnssimple.go
Replaced errorutil usages with errkit.New / errkit.Wrap for authentication and missing-account errors; imports updated.
GCP — asset parsing helpers
pkg/providers/gcp/assets_api.go
Switched error construction from errorutil.New to errkit.New in asset-name parsing helpers; imports updated.
GCP — auth and core flows
pkg/providers/gcp/auth.go, pkg/providers/gcp/gcp.go
Replaced errorutil.NewWithErr(...).Msgf and errorutil.New with errkit.Wrap / errkit.New; added fmt for one formatted error message; imports updated.
Kubernetes provider
pkg/providers/k8s/kubernetes.go
Migrated many errorutil patterns (New, NewWithErr, Msgf) to errkit equivalents (New, Wrap, Newf) across kubeconfig checks, decoding, clientset creation, resource listing, and file reads; imports updated.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I hop through patches, soft and spry,
Swapping error tales beneath the sky.
Modules fresh, the burrow neat,
Errkit stitched where messages meet.
A crunchy carrot — change complete. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The provided title “bump deps, fix lint errs” is overly generic and uses informal abbreviations that do not clearly convey the primary changes of dependency updates and error handling refactoring; it fails to present a concise summary of the main change and lacks clarity for future maintainers. Consider renaming the pull request to clearly state the primary changes such as “Bump dependencies and switch errorutil to errkit for lint compliance” to provide a concise and descriptive summary.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues Check ✅ Passed The pull request updates the go.mod dependencies as requested and refactors all errorutil usages to errkit to address lint errors, fulfilling the coding objectives of issue #702 without introducing any unrelated functionality.
Out of Scope Changes Check ✅ Passed All changes in this pull request are confined to dependency version bumps and error handling refactoring in service providers, which directly relate to the linked issue objectives and no unrelated code or features have been introduced.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bump_deps

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5f3163 and 25a68c3.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: release-test
  • GitHub Check: Test Builds (1.22.x, windows-latest)
  • GitHub Check: Lint Test
  • GitHub Check: Test Builds (1.22.x, macOS-latest)
  • GitHub Check: Test Builds (1.22.x, ubuntu-latest)
  • GitHub Check: Analyze (go)

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

Copy link
Contributor

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
go.mod (1)

3-5: Remove leftover errorutil calls and update CI to Go 1.24 toolchain

  • pkg/providers/gcp/gcp.go & pkg/providers/gcp/auth.go still reference errorutil.New/NewWithErr—replace or remove these usages.
  • No .github/workflows found; ensure your CI (GitHub Actions, CircleCI, etc.) installs Go 1.24 or respects the toolchain go1.24.2 directive in go.mod.
🧹 Nitpick comments (6)
pkg/providers/gcp/assets_api.go (4)

435-446: Include the offending asset name in errors for faster triage

Use errkit.Newf to embed assetName in the error for on-call debugging.

-		return "", "", "", errkit.New("invalid compute asset name format")
+		return "", "", "", errkit.Newf("invalid compute asset name format: %q", assetName)
@@
-		return "", "", "", errkit.New("unexpected compute asset name format")
+		return "", "", "", errkit.Newf("unexpected compute asset name format: %q", assetName)

451-463: Do the same for Cloud Functions parse errors

Embed the assetName.

-		return "", "", "", errkit.New("invalid function asset name format")
+		return "", "", "", errkit.Newf("invalid function asset name format: %q", assetName)
@@
-		return "", "", "", errkit.New("unexpected function asset name format")
+		return "", "", "", errkit.Newf("unexpected function asset name format: %q", assetName)

468-480: Do the same for Cloud Run parse errors

Embed the assetName.

-		return "", "", "", errkit.New("invalid cloud run asset name format")
+		return "", "", "", errkit.Newf("invalid cloud run asset name format: %q", assetName)
@@
-		return "", "", "", errkit.New("unexpected cloud run asset name format")
+		return "", "", "", errkit.Newf("unexpected cloud run asset name format: %q", assetName)

485-504: Do the same for DNS parse errors

Embed the assetName on the error path.

-		return "", "", "", "", errkit.New("invalid DNS asset name format")
+		return "", "", "", "", errkit.Newf("invalid DNS asset name format: %q", assetName)
@@
-	return "", "", "", "", errkit.New("unexpected DNS asset name format")
+	return "", "", "", "", errkit.Newf("unexpected DNS asset name format: %q", assetName)
pkg/providers/k8s/kubernetes.go (2)

39-41: Fix message typo (double space)

Minor text nit.

-		return nil, errkit.New("no kubeconfig_file or kubeconfig_encoded  provided")
+		return nil, errkit.New("no kubeconfig_file or kubeconfig_encoded provided")

168-171: Use errkit.Wrap instead of fmt.Errorf for consistency

Aligns with the rest of the file and keeps error chains uniform.

-	kubeConfig, err := modifiedClientConfig.ClientConfig()
-	if err != nil {
-		return nil, fmt.Errorf("could not get client config: %v", err)
-	}
+	kubeConfig, err := modifiedClientConfig.ClientConfig()
+	if err != nil {
+		return nil, errkit.Wrap(err, "could not get client config")
+	}

After this change, fmt becomes unused; please drop it from imports (goimports will handle):

 import (
 	"context"
 	"encoding/base64"
-	"fmt"
 	"strings"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b6a171 and d145641.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • go.mod (4 hunks)
  • pkg/providers/dnssimple/dnssimple.go (2 hunks)
  • pkg/providers/gcp/assets_api.go (6 hunks)
  • pkg/providers/k8s/kubernetes.go (7 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
pkg/providers/gcp/assets_api.go (3)
pkg/providers/dnssimple/dnssimple.go (1)
  • New (45-94)
pkg/providers/k8s/kubernetes.go (1)
  • New (33-89)
pkg/providers/gcp/gcp.go (1)
  • New (182-199)
pkg/providers/dnssimple/dnssimple.go (1)
pkg/providers/k8s/kubernetes.go (1)
  • New (33-89)
pkg/providers/k8s/kubernetes.go (2)
pkg/providers/dnssimple/dnssimple.go (1)
  • New (45-94)
pkg/providers/gcp/gcp.go (1)
  • New (182-199)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Test Builds (1.22.x, macOS-latest)
  • GitHub Check: Test Builds (1.22.x, ubuntu-latest)
  • GitHub Check: Test Builds (1.22.x, windows-latest)
  • GitHub Check: Lint Test
  • GitHub Check: Analyze (go)
  • GitHub Check: release-test
🔇 Additional comments (5)
pkg/providers/gcp/assets_api.go (1)

11-11: errkit import — LGTM

Consistent with the repo-wide migration.

pkg/providers/k8s/kubernetes.go (2)

10-10: errkit import — LGTM


49-54: Error wrapping migration — LGTM

errkit.Wrap usage is consistent and preserves context.

Also applies to: 58-65, 111-112, 122-123, 135-136, 150-155

pkg/providers/dnssimple/dnssimple.go (1)

83-87: errkit.Wrap/New migration — LGTM

Error context is preserved and messages remain clear.

go.mod (1)

32-34: Dependency bumps — LGTM

Updates look safe; utils v0.5.0 aligns with errkit usage; xz v0.5.14 addresses prior CVEs.

Also applies to: 146-146, 183-185, 209-209, 217-220

@Mzack9999 Mzack9999 merged commit eaf70fe into dev Sep 25, 2025
9 checks passed
@Mzack9999 Mzack9999 deleted the bump_deps branch September 25, 2025 21:18
visnetodev pushed a commit to visnetotest/cloudlist that referenced this pull request Dec 7, 2025
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.

bump deps, fix lint errs

2 participants