Skip to content

dynamic query invalidation for ConfigMaps and Secrets#398

Open
RafsanNeloy wants to merge 2 commits intokarmada-io:mainfrom
RafsanNeloy:working2
Open

dynamic query invalidation for ConfigMaps and Secrets#398
RafsanNeloy wants to merge 2 commits intokarmada-io:mainfrom
RafsanNeloy:working2

Conversation

@RafsanNeloy
Copy link
Copy Markdown
Contributor

What type of PR is this?
/kind bug

What this PR does / why we need it: In the Multi-cloud Resource Management configuration page. Previously, the dashboard would fail to update the list view automatically after a user successfully created or edited a Secret, or edited an existing ConfigMap.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Signed-off-by: rafsanneloy <rafsanneloy@gmail.com>
@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 28, 2026
@karmada-bot karmada-bot requested a review from samzong January 28, 2026 11:51
@karmada-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rainbowmango for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot requested a review from warjiang January 28, 2026 11:51
@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 28, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @RafsanNeloy, 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 addresses a bug in the Multi-cloud Resource Management configuration page where the dashboard's list view did not automatically refresh after certain operations. The changes ensure that the UI accurately reflects the latest state of ConfigMaps and Secrets by implementing a more comprehensive and dynamic query invalidation mechanism.

Highlights

  • Dynamic Query Invalidation: The query invalidation logic has been updated to dynamically invalidate either 'GetConfigMaps' or 'GetSecrets' based on the filter.kind after a successful configuration operation (create or edit).
  • Expanded Invalidation Scope: The invalidation now applies to both creation and editing of configurations, resolving an issue where the dashboard failed to update after editing existing ConfigMaps or creating/editing Secrets.
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.

Copy link
Copy Markdown

@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 bug where the UI would not automatically refresh after creating or editing ConfigMaps and Secrets. The fix correctly invalidates the React Query cache for the appropriate resource type, ensuring the list view is updated. The change is logical and effectively solves the problem. I have included one suggestion for improving maintainability by replacing hardcoded query key strings with constants.

Comment on lines +158 to +160
filter.kind === ConfigKind.ConfigMap
? 'GetConfigMaps'
: 'GetSecrets',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To improve maintainability and avoid using 'magic strings' for query keys, it's a good practice to define 'GetConfigMaps' and 'GetSecrets' as constants. These constants could be placed in a shared file (e.g., types.ts or a new queryKeys.ts) and then imported for use here and in the ConfigMapTable and SecretTable components where the queries are defined. This ensures consistency and simplifies future refactoring.

@karmada-bot karmada-bot added the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Feb 14, 2026
@karmada-bot
Copy link
Copy Markdown
Contributor

Adding label do-not-merge/contains-merge-commits because PR contains merge commits, which are not allowed in this repository.
Use git rebase to reapply your commits on top of the target branch. Detailed instructions for doing so can be found here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants