Skip to content

use consistent import aliases, enforce importas rule in golanci.yaml #11616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

devc007
Copy link
Contributor

@devc007 devc007 commented Jul 8, 2025

Description

Fixes #11607

Change Type

/kind cleanup

Changelog

NONE

@github-actions github-actions bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note labels Jul 8, 2025
.golangci.yaml Outdated
- pkg: github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3
alias: clusterv3
- pkg: github.com/envoyproxy/go-control-plane/envoy/config/route/v3
alias: envoy_config_route_v3
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be routev3

Copy link
Contributor

Choose a reason for hiding this comment

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

I strongly prefer prefixing the project name to avoid conflicts envoy_config_route_v3|envoyroutev3|envoy_route_v3|envoy_routev3

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm ok with envoyroutev3 but we need @timflannagan to weigh in lol

Copy link
Member

Choose a reason for hiding this comment

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

No strong opinion as long as we're consistent - envoyroutev3 would be my preference over envoy_route_v3.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same applies to other envoy types, not just route/v3

Copy link
Member

Choose a reason for hiding this comment

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

Right, I think prefixing the import with envoy sgtm and following the https://go.dev/doc/effective_go#package-names guidance would be my 2c.

.golangci.yaml Outdated
@@ -62,6 +62,18 @@ linters:
alias: metav1
- pkg: k8s.io/api/batch/v1
alias: batchv1
- pkg: github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3
alias: envoy_config_endpoint_v3
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be endpointv3

.golangci.yaml Outdated
- pkg: github.com/envoyproxy/go-control-plane/pkg/cache/types
alias: envoycachetypes
- pkg: github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3
alias: envoyauth
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps this could be tlsv3

@@ -141,9 +141,9 @@ func (h *httpRouteConfigurationTranslator) computeVirtualHost(

type backendConfigContext struct {
typedPerFilterConfigRoute ir.TypedFilterConfigMap
RequestHeadersToAdd []*envoy_config_core_v3.HeaderValueOption
RequestHeadersToAdd []*corev3.HeaderValueOption
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that this makes us lose a lot of context.
what is core with regards to our routes?

@nfuden
Copy link
Contributor

nfuden commented Jul 8, 2025

I am not convinced on this approach see #11607 (comment)

@devc007
Copy link
Contributor Author

devc007 commented Jul 9, 2025

Thank you, maintainers, for the review. I will now update the PR with the suggested changes: envoyroutev3, envoyclusterv3, envoycorev3, tlsv3, and envoyendpointv3.
Please let me know if I'm good to proceed with these changes

@puertomontt
Copy link
Contributor

@devc007 make sure to use "envoy" in the name for all, so make it envoytlsv3. I think you can go ahead with that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

standardize import names for envoy imports
5 participants