Skip to content

Add support for RequestMirror filter #3306

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

Merged
merged 2 commits into from
Apr 22, 2025
Merged

Add support for RequestMirror filter #3306

merged 2 commits into from
Apr 22, 2025

Conversation

sjberman
Copy link
Collaborator

Problem: As a user, I want to be able to mirror requests to another backend(s) using the RequestMirror filter on an HTTPRoute or GRPCRoute.

Solution: Add support for the RequestMirror filter, allowing users to mirror requests with HTTPRoutes or GRPCRoutes.

Testing: Manually verified single mirror filter, multiple mirror filter, mirror filter with other filters.

Note: the RequestMirror conformance tests seem to have a bug in 1.2.1 Gateway API, which may be fixed in 1.3. We can hopefully enable them at that point.

Closes #533

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

Add support for request mirroring using the RequestMirror filter.

@sjberman sjberman requested a review from a team as a code owner April 17, 2025 16:59
@github-actions github-actions bot added the enhancement New feature or request label Apr 17, 2025
Copy link

codecov bot commented Apr 17, 2025

Codecov Report

Attention: Patch coverage is 90.09585% with 31 lines in your changes missing coverage. Please review.

Project coverage is 86.20%. Comparing base (8d5ef4d) to head (0b0bec8).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/mode/static/state/validation/validator.go 0.00% 14 Missing ⚠️
internal/mode/static/state/graph/grpcroute.go 90.29% 8 Missing and 2 partials ⚠️
internal/mode/static/state/graph/backend_refs.go 88.46% 2 Missing and 1 partial ⚠️
internal/mode/static/state/graph/httproute.go 96.38% 2 Missing and 1 partial ⚠️
...e/static/nginx/config/validation/http_validator.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3306      +/-   ##
==========================================
+ Coverage   86.16%   86.20%   +0.04%     
==========================================
  Files         113      116       +3     
  Lines       11664    11928     +264     
  Branches       62       62              
==========================================
+ Hits        10050    10283     +233     
- Misses       1553     1580      +27     
- Partials       61       65       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sjberman sjberman force-pushed the feat/request-mirror branch from 63572c7 to c4c62ce Compare April 17, 2025 17:29
@ciarams87
Copy link
Contributor

Note: the RequestMirror conformance tests seem to have a bug in 1.2.1 Gateway API, which may be fixed in 1.3. We can hopefully enable them at that point.

Do we have something tracking this?

Other than that, nice work! 🚀

@sjberman
Copy link
Collaborator Author

@ciarams87 I was planning on adding it as acceptance criteria to the 1.3 story when we create that

@sjberman sjberman force-pushed the feat/request-mirror branch from a802d7c to b5daf3e Compare April 22, 2025 14:47
@sjberman sjberman requested review from bjee19 and ciarams87 April 22, 2025 14:47
Problem: As a user, I want to be able to mirror requests to another backend(s) using the RequestMirror filter on an HTTPRoute or GRPCRoute.

Solution: Add support for the RequestMirror filter, allowing users to mirror requests with HTTPRoutes or GRPCRoutes.
@sjberman sjberman force-pushed the feat/request-mirror branch from b5daf3e to 0b0bec8 Compare April 22, 2025 14:50
Copy link
Contributor

@bjee19 bjee19 left a comment

Choose a reason for hiding this comment

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

lgtm! 🚀

@sjberman sjberman merged commit 1768129 into main Apr 22, 2025
40 checks passed
@sjberman sjberman deleted the feat/request-mirror branch April 22, 2025 20:13
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request release-notes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

HTTP Request Mirror
3 participants