Skip to content

Conversation

@puertomontt
Copy link
Contributor

Description

The comment says Each of the functions here will be called in the order they appear in the interface. This was not true.

Change Type

/kind cleanup

Changelog

NONE

Additional Notes

Copilot AI review requested due to automatic review settings November 6, 2025 20:36
@github-actions github-actions bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none labels Nov 6, 2025
Copy link
Contributor

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 improves code quality through grammar corrections and documentation enhancements. The primary focus is correcting the grammatically incorrect phrase "lesser than" to the proper "less than" in validation error messages across the codebase.

Key Changes:

  • Fixed grammar in validation error messages from "lesser than" to "less than"
  • Enhanced documentation comments in the ProxyTranslationPass interface
  • Reorganized the order of methods in the ProxyTranslationPass interface for better logical flow

Reviewed Changes

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

File Description
test/e2e/tests/api_validation_test.go Updated test case names and expected error messages to use correct grammar
api/v1alpha1/traffic_policy_types.go Corrected validation error message in kubebuilder annotation
install/helm/kgateway-crds/templates/gateway.kgateway.dev_trafficpolicies.yaml Updated CRD validation message to match API changes
pkg/pluginsdk/ir/iface.go Improved interface documentation with clearer comments and reordered ApplyRouteConfigPlugin method

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

Copy link
Contributor

@lgadban lgadban left a comment

Choose a reason for hiding this comment

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

so the main fix is to reorder the functions in order they are called?
and the only one that was incorrect was ApplyRouteConfigPlugin ?

I am a bit surprised that ApplyForRouteBackend is called before some of the others

)

// ApplyRouteConfigPlugin is called 1 time for all the routes in a filter chain. Use this to set default PerFilterConfig
// Applies policy for a Gateway that has a policy attached via a targetRef.
Copy link
Contributor

Choose a reason for hiding this comment

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

Applies policy for a Gateway that has a policy attached via a targetRef.

Is this fully correct? I think it is only called in certain circumstances, e.g. only for HTTP (or HTTPS) listeners? (as opposed to ApplyVHost)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely sure. I think ApplyForVHost runs when section name is used, where ApplyRouteConfigPlugin runs when targeting whole gateway

Copy link
Contributor Author

@puertomontt puertomontt Nov 6, 2025

Choose a reason for hiding this comment

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

feel free to check my work but this is what I noted in the code

  1. ComputeListener
  2. ApplyListenerPlugin
  3. ComputeRouteConfiguration
  4. computeVirtualHost
  5. envoyRoutes
  6. translateRouteAction
  7. ApplyForBackend
  8. ApplyForRouteBackend
  9. runRoutePlugins
  10. ApplyForRoute
  11. runVhostPlugins
  12. ApplyVhostPlugin
  13. ApplyRouteConfigPlugin
  14. HttpFilters

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.

2 participants