[dashboard] fix: restore stock-instance sidebars for namespace-level pages#2136
[dashboard] fix: restore stock-instance sidebars for namespace-level pages#2136
Conversation
…ages PR #2106 removed stock-instance-* sidebar resources to fix broken URLs on the main page before namespace selection. However, these sidebars are required for rendering namespace-level pages (api-table, api-form, etc.) such as the Backup Plans page. Without stock-instance-api-table, the frontend cannot find the sidebar for namespace-scoped api-table pages and renders an empty page instead. The original bug (broken URLs with empty namespace placeholder) is already fixed by CUSTOMIZATION_SIDEBAR_FALLBACK_ID="" in web.yaml, so re-adding stock-instance-* sidebars does not reintroduce it. Co-Authored-By: Claude <[email protected]> Signed-off-by: Kirill Ilin <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughFour new stock-instance sidebar resources are added to the dashboard controller's expected resources and upsert targets: stock-instance-api-form, stock-instance-api-table, stock-instance-builtin-form, and stock-instance-builtin-table. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
Summary of ChangesHello, 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 restores the Highlights
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request restores several stock-instance-* sidebar resources that are necessary for namespace-level pages. The changes correctly add these sidebar IDs to the list of sidebars to be created in sidebar.go and to the allowlist for orphan cleanup in manager.go. My review includes suggestions to address code duplication for the newly added sidebar IDs to improve future maintainability.
| "stock-instance-api-form", | ||
| "stock-instance-api-table", | ||
| "stock-instance-builtin-form", | ||
| "stock-instance-builtin-table", |
There was a problem hiding this comment.
This list of stock-instance-* sidebar IDs is duplicated from internal/controller/dashboard/sidebar.go. To avoid duplication and potential inconsistencies, it would be better to define this list as a shared package-level variable and reuse it in both places. This would also make it more apparent that this list can be defined outside the for loop for better performance.
| "stock-instance-api-form", | ||
| "stock-instance-api-table", | ||
| "stock-instance-builtin-form", | ||
| "stock-instance-builtin-table", |
There was a problem hiding this comment.
These stock-instance-* sidebar IDs are also being added in internal/controller/dashboard/manager.go, creating duplication. To improve maintainability, consider defining this list of IDs as a shared package-level variable (e.g., stockInstanceSidebars). This variable could then be used here and in manager.go to avoid inconsistencies in the future.
|
Successfully created backport PR for |
What this PR does
Restores
stock-instance-api-form,stock-instance-api-table,stock-instance-builtin-form, andstock-instance-builtin-tablesidebarresources that were removed in #2106, and adds them back to the orphan
cleanup allowlist.
PR #2106 removed these sidebars to fix broken URLs on the main page before
namespace selection (
default//api-table/...). However,stock-instance-*sidebars are required by the frontend for namespace-level api-table/api-form
pages. Without them and with
CUSTOMIZATION_SIDEBAR_FALLBACK_ID="", thefrontend cannot find a sidebar for pages like Backup Plans and renders an
empty page where no interaction is possible.
The broken-URL bug is already fully fixed by
CUSTOMIZATION_SIDEBAR_FALLBACK_ID=""in
web.yaml. Re-addingstock-instance-*does not reintroduce it, sincethese sidebars are only shown when the user is on a namespace-level page
where the
{namespace}placeholder is filled.Release note
Summary by CodeRabbit