Skip to content

fix(dashboard): fix External IPs factory EnrichedTable rendering#2175

Merged
kvaps merged 1 commit intomainfrom
fix/external-ips-enriched-table
Mar 10, 2026
Merged

fix(dashboard): fix External IPs factory EnrichedTable rendering#2175
kvaps merged 1 commit intomainfrom
fix/external-ips-enriched-table

Conversation

@IvanHunters
Copy link
Collaborator

@IvanHunters IvanHunters commented Mar 9, 2026

Summary

  • Fix External IPs page showing empty rows in the dashboard by correcting EnrichedTable properties in the external-ips factory
  • Replace clusterNamePartOfUrl with cluster and change pathToItems from array format to dot-path string to match convention used by all other EnrichedTable instances

Test plan

  • Open Administration → External IPs in dashboard for a tenant with LoadBalancer services
  • Verify table columns (Name, ClusterIP, LoadbalancerIP, Created) are rendered
  • Verify service data is displayed correctly in the rows

Summary by CodeRabbit

  • Bug Fixes
    • Fixed configuration handling for the external-ips dashboard tab to ensure cluster names display correctly and service items are consistently listed, improving stability and data presentation.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where the External IPs page in the dashboard was not displaying data, appearing with empty rows. The problem stemmed from misconfigured properties within the external-ips factory's EnrichedTable definition. The changes update these properties, specifically clusterNamePartOfUrl to cluster and pathToItems to a dot-path string, to ensure proper data fetching and rendering for LoadBalancer services.

Highlights

  • Dashboard Fix: Corrected the EnrichedTable properties within the external-ips factory to resolve empty rows on the External IPs dashboard page.
  • Property Renaming: Replaced the clusterNamePartOfUrl property with cluster for consistency with other EnrichedTable instances.
  • Path Format Update: Modified the pathToItems property from an array format to a dot-path string to match established conventions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • internal/controller/dashboard/static_refactored.go
    • Replaced clusterNamePartOfUrl with cluster in the external-ips-table configuration.
    • Updated pathToItems from an array []any{"items"} to a string ".items" for the external-ips-table.
Activity
  • No human activity (comments, reviews, etc.) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3f70c9a0-7e98-493e-9101-92f5675a7da3

📥 Commits

Reviewing files that changed from the base of the PR and between 4d2dd0b and 49601b1.

📒 Files selected for processing (1)
  • internal/controller/dashboard/static_refactored.go

📝 Walkthrough

Walkthrough

Updated the EnrichedTable configuration for the external-ips services tab: renamed the key "clusterNamePartOfUrl" to "cluster" and changed "pathToItems" from an array ["items"] to a dot-path string ".items", plus minor formatting adjustments.

Changes

Cohort / File(s) Summary
External IPs Services Configuration
internal/controller/dashboard/static_refactored.go
Updated EnrichedTable config: renamed clusterNamePartOfUrlcluster, converted pathToItems from array ["items"] to dot-path string ".items", and adjusted surrounding key formatting (id, fetchUrl, baseprefix, customizationId, fieldSelector).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through keys and dotted the trails,
Swapped a name, smoothed an array into rails,
Configs now neat, the table hums bright,
A rabbit's small tweak — tidy and light ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: fixing External IPs factory EnrichedTable rendering. It accurately reflects the primary objective of correcting EnrichedTable properties to fix dashboard display.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/external-ips-enriched-table

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@IvanHunters IvanHunters marked this pull request as ready for review March 9, 2026 10:58
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Mar 9, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a rendering issue on the External IPs page by updating the properties of an EnrichedTable component, specifically replacing clusterNamePartOfUrl with cluster and modifying pathToItems to use a dot-path string. A security audit identified two existing vulnerabilities in the dashboard controller logic: a recursive function in customformsoverride.go lacks a depth limit, potentially leading to a stack overflow and Denial of Service (DoS), and factory.go constructs UI templates using unescaped property names from OpenAPI schemas, which could result in template injection or Cross-Site Scripting (XSS) in the dashboard frontend. Additionally, there's an inconsistency in the pathToItems format across the codebase, with several instances still using an old array format, which could impact maintainability and lead to similar issues elsewhere.

"cluster": "{2}",
"baseprefix": "/openapi-ui",
"customizationId": "factory-details-v1.services",
"pathToItems": ".items",
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While changing pathToItems to a dot-path string fixes the issue here, the PR description claims this is to match a convention that is not consistently applied throughout the codebase. I've found other EnrichedTable instances that still use the array format for pathToItems:

  • internal/controller/dashboard/static_refactored.go: line 1318 ([]any{"spec", "rules"}) and line 1474 ([]any{"items"})
  • internal/controller/dashboard/factory.go: multiple instances (e.g., line 171, 196, 272, etc.)

If the array format is indeed incorrect, leaving these other instances unchanged could lead to similar bugs elsewhere. For consistency and to improve maintainability, I recommend refactoring all instances. Would it be possible to expand the scope of this PR to update them, or should a follow-up issue be created to track this technical debt?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
internal/controller/dashboard/static_refactored.go (1)

1927-1936: The cluster field rename is correct; note pathToItems format is a minority pattern.

The change from clusterNamePartOfUrl to cluster aligns with the established pattern in factory.go (e.g., vpc-subnets-table, resource-quotas-table).

The pathToItems change from []any{"items"} to ".items" fixes the rendering bug, but uses a format that is less prevalent in the codebase:

  • Array format []any{...}: 9 instances (7 in factory.go, 2 in static_refactored.go) — 69%
  • String format "...": 4 instances (all in static_refactored.go) — 31%

While both formats are functionally supported, the array format is the established convention, especially in factory.go where it is used consistently. Future updates should consider aligning to the array format for consistency across the codebase.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/controller/dashboard/static_refactored.go` around lines 1927 - 1936,
The change correctly renames clusterNamePartOfUrl to cluster and fixes rendering
by switching pathToItems from []any{"items"} to the string ".items", but
repository convention prefers the array format; update the pathToItems value
back to the array form (e.g., []any{"items"}) in the static_refactored.go entry
where pathToItems is currently ".items" so it matches the established pattern
used in factory.go and the other table definitions while keeping the cluster
field rename as-is.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@internal/controller/dashboard/static_refactored.go`:
- Around line 1927-1936: The change correctly renames clusterNamePartOfUrl to
cluster and fixes rendering by switching pathToItems from []any{"items"} to the
string ".items", but repository convention prefers the array format; update the
pathToItems value back to the array form (e.g., []any{"items"}) in the
static_refactored.go entry where pathToItems is currently ".items" so it matches
the established pattern used in factory.go and the other table definitions while
keeping the cluster field rename as-is.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c68afc65-53bf-46de-a0d8-e5df3c9a096f

📥 Commits

Reviewing files that changed from the base of the PR and between adacd44 and 4d2dd0b.

📒 Files selected for processing (1)
  • internal/controller/dashboard/static_refactored.go

"cluster": "{2}",
"baseprefix": "/openapi-ui",
"customizationId": "factory-details-v1.services",
"pathToItems": ".items",
Copy link
Contributor

Choose a reason for hiding this comment

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

We use slice style for pathToItems everywhere

The external-ips factory used incorrect EnrichedTable properties causing
empty rows in the dashboard. Replace `clusterNamePartOfUrl` with
`cluster` and change `pathToItems` from array to dot-path string format
to match the convention used by all other working EnrichedTable instances.

Signed-off-by: IvanHunters <[email protected]>
@kvaps kvaps force-pushed the fix/external-ips-enriched-table branch from 4d2dd0b to 49601b1 Compare March 10, 2026 11:41
@kvaps kvaps added backport Should change be backported on previus release backport-previous labels Mar 10, 2026
Copy link
Member

@kvaps kvaps left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 10, 2026
@kvaps kvaps merged commit a13481b into main Mar 10, 2026
12 checks passed
@kvaps kvaps deleted the fix/external-ips-enriched-table branch March 10, 2026 14:18
@github-actions
Copy link

Successfully created backport PR for release-1.0:

@github-actions
Copy link

Successfully created backport PR for release-1.1:

kvaps added a commit that referenced this pull request Mar 10, 2026
…hedTable rendering (#2192)

# Description
Backport of #2175 to `release-1.0`.
kvaps added a commit that referenced this pull request Mar 10, 2026
…hedTable rendering (#2193)

# Description
Backport of #2175 to `release-1.1`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Should change be backported on previus release backport-previous bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants