Skip to content

Add support for percentage based request mirroring #3627

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 14 commits into from
Jul 17, 2025

Conversation

bjee19
Copy link
Contributor

@bjee19 bjee19 commented Jul 15, 2025

Proposed changes

Add support for percentage based request mirroring by supporting the percent and fraction fields in the HTTPRequestMirrorFilter API.

Problem: Users would like to enable percentage based request mirroring.

Solution: Add support for the percent and fraction fields in the HTTPRequestMirrorFilter API.

Testing: Added unit tests, updated conformance tests run, manually ran these test cases:

  • Single HTTPRoute with single filter
  • Single HTTPRoute with two filters to separate backends (one is the same backend as specified on HTTPRoute)
  • Single HTTPRoute with two filters targeting same backend, higher percentage wins
  • Single HTTPRoute with two filters targeting same backend, higher percentage wins (higher percentage is 100, so no split clients is made)
  • Single HTTPRoute with two filters on separate RULES -- two split clients and internal locations are made even if they target the same backend
  • Two HTTPRoutes with single filter create separate split clients and locations.
  • 0 percentage works, same with fraction

Closes #3314

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 percentage based request mirroring.

@bjee19 bjee19 requested a review from a team as a code owner July 15, 2025 19:04
@github-actions github-actions bot added enhancement New feature or request tests Pull requests that update tests labels Jul 15, 2025
@bjee19 bjee19 force-pushed the enh/percentage-mirroring branch from 8248ac9 to f6a2982 Compare July 15, 2025 19:06
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.06%. Comparing base (fc0a5a7) to head (2aba5c9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3627      +/-   ##
==========================================
+ Coverage   86.91%   87.06%   +0.14%     
==========================================
  Files         127      127              
  Lines       15287    15471     +184     
  Branches       62       62              
==========================================
+ Hits        13287    13470     +183     
  Misses       1847     1847              
- Partials      153      154       +1     

☔ 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.

Copy link
Contributor

@sarthyparty sarthyparty left a comment

Choose a reason for hiding this comment

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

reviewing is harder than I thought

@github-project-automation github-project-automation bot moved this from 🆕 New to 🏗 In Progress in NGINX Gateway Fabric Jul 15, 2025
Copy link
Collaborator

@sjberman sjberman left a comment

Choose a reason for hiding this comment

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

Nice work!

@bjee19 bjee19 requested a review from salonichf5 July 17, 2025 17:10
Copy link
Contributor

@salonichf5 salonichf5 left a comment

Choose a reason for hiding this comment

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

lgtm 🚀

@bjee19 bjee19 force-pushed the enh/percentage-mirroring branch from e13d020 to 27e033e Compare July 17, 2025 21:02
@bjee19 bjee19 enabled auto-merge (squash) July 17, 2025 21:43
@bjee19 bjee19 merged commit c56b771 into main Jul 17, 2025
43 checks passed
@bjee19 bjee19 deleted the enh/percentage-mirroring branch July 17, 2025 22:07
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in NGINX Gateway Fabric Jul 17, 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 tests Pull requests that update tests
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Percentage-based request mirroring
4 participants