Skip to content

pkg/kube: remove legacy import comments#31931

Merged
gjenkins8 merged 1 commit into
helm:mainfrom
abhay1999:fix/remove-legacy-import-comments-pkg-kube
Mar 12, 2026
Merged

pkg/kube: remove legacy import comments#31931
gjenkins8 merged 1 commit into
helm:mainfrom
abhay1999:fix/remove-legacy-import-comments-pkg-kube

Conversation

@abhay1999

Copy link
Copy Markdown
Contributor

What

Import path comments (e.g. // import "helm.sh/helm/v4/pkg/kube") are a pre-Go modules convention that is no longer needed in module-aware builds. Some files in pkg/kube/ had these comments while others did not, causing inconsistency that triggered downstream Kythe indexing errors.

Affected files:

  • pkg/kube/client.go
  • pkg/kube/statuswait.go
  • pkg/kube/ready.go
  • pkg/kube/wait.go
  • pkg/kube/resource.go
  • pkg/kube/converter.go
  • pkg/kube/factory.go
  • pkg/kube/resource_policy.go

Why

Since Go 1.11 (modules), import path comments are redundant — the go.mod file is the authoritative source for the module path. Having them in some files but not others within the same package causes inconsistency and breaks downstream static analysis tools like Kythe.

Fixes #31846

Copilot AI review requested due to automatic review settings March 12, 2026 05:38
@pull-request-size pull-request-size Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 12, 2026

Copilot AI 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.

Pull request overview

This PR removes legacy Go import path comments from pkg/kube package files to eliminate inconsistent package import comments that can break downstream tooling (e.g., Kythe) in module-aware builds.

Changes:

  • Removed // import "helm.sh/helm/v4/pkg/kube" package import comments from multiple pkg/kube/*.go source files.
  • Standardized package kube declarations across the affected files to rely on go.mod as the canonical module path.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/kube/client.go Removes legacy import path comment from the package declaration.
pkg/kube/converter.go Removes legacy import path comment from the package declaration.
pkg/kube/factory.go Removes legacy import path comment from the package declaration.
pkg/kube/ready.go Removes legacy import path comment from the package declaration.
pkg/kube/resource.go Removes legacy import path comment from the package declaration.
pkg/kube/resource_policy.go Removes legacy import path comment from the package declaration.
pkg/kube/statuswait.go Removes legacy import path comment from the package declaration.
pkg/kube/wait.go Removes legacy import path comment from the package declaration.

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

Comment thread pkg/kube/statuswait.go
*/

package kube // import "helm.sh/helm/v4/pkg/kube"
package kube

Copilot AI Mar 12, 2026

Copy link

Choose a reason for hiding this comment

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

There are still legacy import path comments in this package’s *_test.go files (e.g., ready_test.go/resource_test.go/statuswait_test.go). If the goal is to eliminate package-level import comments from pkg/kube for consistency/tooling (Kythe), those should be removed as well so the package is consistently module-path-only across all files.

Copilot uses AI. Check for mistakes.

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.

@copilot open a new pull request to apply changes based on this feedback

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.

Import path comments (e.g. `// import "helm.sh/helm/v4/pkg/kube"`) are
a pre-Go modules convention no longer needed in module-aware builds.
Some files in pkg/kube had these comments while others did not, causing
inconsistency that triggered downstream Kythe indexing errors.

Remove the import comments from all affected files to make the package
declaration consistent across the directory.

Fixes helm#31846

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: abhay1999 <[email protected]>
@abhay1999
abhay1999 force-pushed the fix/remove-legacy-import-comments-pkg-kube branch from 7831073 to d7cdc9e Compare March 12, 2026 05:40

@TerryHowe TerryHowe 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.

/lgtm

abhay1999 added a commit to abhay1999/helm that referenced this pull request Mar 12, 2026
Pre-Go-modules import path comments (e.g. `// import "helm.sh/helm/v4/..."`)
are obsolete since Go 1.11 where go.mod is the authoritative module path.
These stale comments cause issues with downstream tooling such as Kythe.

Removes the legacy import comments from 64 files across 20 packages:
- cmd/helm
- internal/chart/v3/lint and sub-packages
- internal/plugin and sub-packages
- internal/release/v2/util
- pkg/chart/v2/lint and sub-packages
- pkg/cmd, pkg/engine, pkg/ignore, pkg/provenance
- pkg/registry
- pkg/release/v1/util
- pkg/repo/v1
- pkg/storage and pkg/storage/driver

Follows up on helm#31931 and helm#31932 which addressed pkg/kube.

Fixes helm#31846

Signed-off-by: abhay1999 <[email protected]>
Signed-off-by: abhay1999 <[email protected]>
@gjenkins8
gjenkins8 merged commit 2cba43c into helm:main Mar 12, 2026
5 checks passed
@abhay1999
abhay1999 deleted the fix/remove-legacy-import-comments-pkg-kube branch March 13, 2026 15:53
TerryHowe pushed a commit that referenced this pull request Jul 18, 2026
Pre-Go-modules import path comments (e.g. `// import "helm.sh/helm/v4/..."`)
are obsolete since Go 1.11 where go.mod is the authoritative module path.
These stale comments cause issues with downstream tooling such as Kythe.

Removes the legacy import comments from 64 files across 20 packages:
- cmd/helm
- internal/chart/v3/lint and sub-packages
- internal/plugin and sub-packages
- internal/release/v2/util
- pkg/chart/v2/lint and sub-packages
- pkg/cmd, pkg/engine, pkg/ignore, pkg/provenance
- pkg/registry
- pkg/release/v1/util
- pkg/repo/v1
- pkg/storage and pkg/storage/driver

Follows up on #31931 and #31932 which addressed pkg/kube.

Fixes #31846

Signed-off-by: abhay1999 <[email protected]>
Signed-off-by: abhay1999 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect Go pkg import comment causing downstream processing error (kythe)

4 participants