Skip to content

Conversation

@kkk777-7
Copy link
Member

What this PR does / why we need it:
Fix arko's comment.

• I'm pinpointing a medium-severity bug where merged routes get overwritten instead of appended when both listener-specific and gateway-level merges exist—leading to inaccurate status reporting. I'm
  crafting a detailed comment referencing internal/gatewayapi/helpers.go:1187, explaining how replacing the assignment with an append fixes the issue. After careful reasoning about listener keys,
  section names, and merge logic, I see this as a correctness regression worth flagging while confirming no other major regressions appear.

> - internal/gatewayapi/helpers.go:1187 — Medium — When sectionName != nil we populate mergedRoutes with the listener-specific entries, but the fallback that also checks the gateway-level key
  (SectionName: "") assigns into the same slice again. If both map entries exist (e.g. a listener-scoped merge plus a gateway-scoped merge coming from SectionName-less parent refs), the second
  assignment overwrites the first list. That drops the listener-level merges from the merged message and they'll leak back into the "overridden" condition. Please append instead of overwrite:

    mergedRoutes = append(mergedRoutes, routeSet.UnsortedList()...)

Fix Description

Related PR

#6888

Which issue(s) this PR fixes:

Fixes #

Release Notes: No

@kkk777-7 kkk777-7 requested a review from a team as a code owner October 30, 2025 04:42
@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.32%. Comparing base (689d266) to head (b872a25).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7376      +/-   ##
==========================================
- Coverage   72.39%   72.32%   -0.07%     
==========================================
  Files         231      231              
  Lines       33896    33892       -4     
==========================================
- Hits        24538    24513      -25     
- Misses       7601     7619      +18     
- Partials     1757     1760       +3     

☔ 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 arkodg added this to the v1.6.0 Milestone milestone Oct 30, 2025
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.

2 participants