Skip to content

Conversation

@adity1raut
Copy link

@adity1raut adity1raut commented Nov 6, 2025

Description

Fixed #12817

Change Type

/kind feature

Changelog

Added missing unit tests for traffic policy subfields in AgentGateway


# Additional Notes

<!--
Any extra context or edge cases for reviewers.
-->

This PR adds unit tests for missing traffic policy subfields under the AgentGatewayPolicy, ensuring better coverage and stability for future updates.



---

You can copy and paste this content directly into your **PR description** or save it as a file named `PULL_REQUEST_TEMPLATE.md`.  
It will pass the CI release-note check ✅

Signed-off-by: adity1raut <[email protected]>
@adity1raut adity1raut marked this pull request as ready for review November 6, 2025 16:33
Copilot AI review requested due to automatic review settings November 6, 2025 16:33
@github-actions github-actions bot added do-not-merge/release-note-invalid Indicates that a PR should not merge because it's missing one of the release note labels. kind/feature Categorizes issue or PR as related to a new feature. 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 adds five new YAML test data files for traffic policy configurations. These files serve as test fixtures for the AgentGatewayPolicy API, demonstrating various traffic management features such as timeouts, retries, header manipulation, CORS, and combinations thereof.

  • Adds test data for traffic policy features including timeout, retry, CORS, and header manipulation configurations
  • Creates a combined traffic policy test file demonstrating multiple features together
  • All files target HTTPRoute resources with policy configurations

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
traffic-timeout.yaml Test fixture for request and idle timeout configuration
traffic-retries.yaml Test fixture for retry policy with backoff configuration
traffic-header-manipulation.yaml Test fixture for request/response header manipulation
traffic-cors.yaml Test fixture for CORS policy configuration
traffic-combined.yaml Test fixture demonstrating multiple traffic policies combined

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

@@ -0,0 +1,14 @@
apiVersion: gateway.kgateway.dev/v1alpha1
kind: AgentGatewayPolicy
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'AgentGatewayPolicy' to 'AgentgatewayPolicy'. The Kubernetes API type is defined as 'AgentgatewayPolicy' with a lowercase 'g' in 'gateway', as confirmed in api/v1alpha1/agentgateway_policy_types.go.

Suggested change
kind: AgentGatewayPolicy
kind: AgentgatewayPolicy

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,21 @@
apiVersion: gateway.kgateway.dev/v1alpha1
kind: AgentGatewayPolicy
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'AgentGatewayPolicy' to 'AgentgatewayPolicy'. The Kubernetes API type is defined as 'AgentgatewayPolicy' with a lowercase 'g' in 'gateway', as confirmed in api/v1alpha1/agentgateway_policy_types.go.

Suggested change
kind: AgentGatewayPolicy
kind: AgentgatewayPolicy

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,30 @@
apiVersion: gateway.kgateway.dev/v1alpha1
kind: AgentGatewayPolicy
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'AgentGatewayPolicy' to 'AgentgatewayPolicy'. The Kubernetes API type is defined as 'AgentgatewayPolicy' with a lowercase 'g' in 'gateway', as confirmed in api/v1alpha1/agentgateway_policy_types.go.

Suggested change
kind: AgentGatewayPolicy
kind: AgentgatewayPolicy

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,27 @@
apiVersion: gateway.kgateway.dev/v1alpha1
kind: AgentGatewayPolicy
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'AgentGatewayPolicy' to 'AgentgatewayPolicy'. The Kubernetes API type is defined as 'AgentgatewayPolicy' with a lowercase 'g' in 'gateway', as confirmed in api/v1alpha1/agentgateway_policy_types.go.

Suggested change
kind: AgentGatewayPolicy
kind: AgentgatewayPolicy

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,38 @@
apiVersion: gateway.kgateway.dev/v1alpha1
kind: AgentGatewayPolicy
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'AgentGatewayPolicy' to 'AgentgatewayPolicy'. The Kubernetes API type is defined as 'AgentgatewayPolicy' with a lowercase 'g' in 'gateway', as confirmed in api/v1alpha1/agentgateway_policy_types.go.

Suggested change
kind: AgentGatewayPolicy
kind: AgentgatewayPolicy

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@npolshakova npolshakova left a comment

Choose a reason for hiding this comment

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

Please refer to the code of conduct on AI generated code https://github.com/kgateway-dev/community/blob/main/CODE-OF-CONDUCT.md It's totally okay to use AI to help you write code, but it's important to understand what the tests are actually checking for. In this case, the yaml configs are not quiet correct (AgentGatewayPolicy -> AgentgatewayPolicy), and there's no output files for the resulting xds, and the tests are not registered to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/release-note-invalid Indicates that a PR should not merge because it's missing one of the release note labels. kind/feature Categorizes issue or PR as related to a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AgentgatewayPolicy: Add Traffic policy tests

2 participants