WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@y-rabie
Copy link
Contributor

@y-rabie y-rabie commented Nov 19, 2025

First PR split of #7307. Includes only changes in the gateway-api runner.
E2e tests are included in the second PR.

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 12.76596% with 123 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.39%. Comparing base (0fa26d7) to head (f8dd034).

Files with missing lines Patch % Lines
internal/gatewayapi/runner/runner.go 0.00% 121 Missing ⚠️
internal/gatewayapi/extensionserverpolicy.go 90.00% 1 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (12.76%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7557      +/-   ##
==========================================
- Coverage   72.43%   72.39%   -0.04%     
==========================================
  Files         232      232              
  Lines       34307    34373      +66     
==========================================
+ Hits        24849    24884      +35     
- Misses       7682     7715      +33     
+ Partials     1776     1774       -2     

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

@arkodg
Copy link
Contributor

arkodg commented Nov 19, 2025

hey @y-rabie I agree with the overall logic here, suggesting improvements in the algo to avoid the nested for loops

  • can replace the .Store with an internal Merge
  • common state can be stored in map with status ptr as values

@y-rabie
Copy link
Contributor Author

y-rabie commented Nov 30, 2025

@arkodg Apologies I don't think I get what you're saying. Can you illustrate further?

@zhaohuabing
Copy link
Member

zhaohuabing commented Dec 3, 2025

Hi @y-rabie I guess this is what @arkodg is asking about (please correct me if I'm misunderstanding anything @arkodg 🙂 ) :

Optimize the current two-level loop by using a map, reducing the lookup of the inner loop from O(n) to O(1), and avoid consuming more memories by storing ptr to the original status instead of copying its value.

					for _, ar := range aggregatedResult.HTTPRoutes {
						if utils.NamespacedName(httpRoute) == utils.NamespacedName(ar) {
							aggregatedRoute = ar
							break
						}
					}
					// If already found (because processed in an earlier gatewayclass), append its status parents.
					// Otherwise, append it to the list of *Routes in the accumulated result.
					if aggregatedRoute != nil {
						aggregatedRoute.Status.Parents = append(aggregatedRoute.Status.Parents, httpRoute.Status.Parents...)
					} else {
						aggregatedRoute = httpRoute
						aggregatedResult.HTTPRoutes = append(aggregatedResult.HTTPRoutes, aggregatedRoute)
					}

@y-rabie y-rabie force-pushed the merge-status-across-gatewayclasses branch from e5e5925 to 878cec5 Compare December 5, 2025 01:21
@y-rabie y-rabie force-pushed the merge-status-across-gatewayclasses branch from 878cec5 to f8dd034 Compare December 5, 2025 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants